Add test for #1317
add integration test for https://github.com/spring-projects/spring-ai/pull/1317
This commit is contained in:
@@ -69,6 +69,19 @@ class VertexAiGeminiChatModelIT {
|
||||
assertThat(response.getResult().getOutput().getContent()).containsAnyOf("Blackbeard", "Bartholomew");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testMessageHistory() {
|
||||
Prompt prompt = createPrompt(VertexAiGeminiChatOptions.builder().build());
|
||||
ChatResponse response = chatModel.call(prompt);
|
||||
assertThat(response.getResult().getOutput().getContent()).containsAnyOf("Blackbeard", "Bartholomew");
|
||||
|
||||
var promptWithMessageHistory = new Prompt(List.of(prompt.getInstructions().get(0),
|
||||
response.getResult().getOutput(), new UserMessage("What was the answer from the previous question?")));
|
||||
response = chatModel.call(promptWithMessageHistory);
|
||||
|
||||
assertThat(response.getResult().getOutput().getContent()).containsAnyOf("Blackbeard", "Bartholomew");
|
||||
}
|
||||
|
||||
@Test
|
||||
void googleSearchTool() {
|
||||
Prompt prompt = createPrompt(VertexAiGeminiChatOptions.builder().withGoogleSearchRetrieval(true).build());
|
||||
|
||||
Reference in New Issue
Block a user