Fix for FunctionToolCallbackTests
- Add more deterministic test data for assertion
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user