Fix for FunctionToolCallbackTests

- Add more deterministic test data for assertion
This commit is contained in:
Ilayaperumal Gopinathan
2025-02-13 22:56:24 +00:00
parent 1fdda61db8
commit 5b5abc4a8b
2 changed files with 3 additions and 3 deletions

View File

@@ -158,7 +158,7 @@ public class FunctionToolCallbackTests {
var content = ChatClient.builder(this.openAiChatModel)
.build()
.prompt()
.user("What authors wrote the books %s and %s available in the library?".formatted("The Hobbit", "Narnia"))
.user("What authors wrote the books %s and %s available in the library?".formatted("The Hobbit", "The Lion, the Witch and the Wardrobe"))
.tools(Tools.AUTHORS_BY_BOOKS)
.call()
.content();
@@ -174,7 +174,7 @@ public class FunctionToolCallbackTests {
var content = ChatClient.builder(this.openAiChatModel)
.build()
.prompt()
.user("What authors wrote the books %s and %s available in the library?".formatted("The Hobbit", "Narnia"))
.user("What authors wrote the books %s and %s available in the library?".formatted("The Hobbit", "The Lion, the Witch and the Wardrobe"))
.tools(FunctionToolCallback.builder("authorsByAvailableBooks", function)
.description("Get the list of authors who wrote the given books available in the library")
.inputType(Books.class)

View File

@@ -28,7 +28,7 @@ public class BookService {
private static final ConcurrentHashMap<Integer, Book> books = new ConcurrentHashMap<>(Map
.of( // @formatter:off
1, new Book("His Dark Materials", "Philip Pullman"),
2, new Book("Narnia", "C.S. Lewis"),
2, new Book("The Lion, the Witch and the Wardrobe", "C.S. Lewis"),
3, new Book("The Hobbit", "J.R.R. Tolkien"),
4, new Book("The Lord of The Rings", "J.R.R. Tolkien"),
5, new Book("The Silmarillion", "J.R.R. Tolkien"))); // @formatter:on