Skip to content

Commit

Permalink
Add test for #1317
Browse files Browse the repository at this point in the history
  add integration test for #1317
  • Loading branch information
tzolov committed Sep 10, 2024
1 parent 26c5674 commit b5c7975
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,19 @@ void roleTest() {
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());
Expand Down

0 comments on commit b5c7975

Please sign in to comment.