Skip to content

Commit ede08c0

Browse files
committed
Clean up tests
Signed-off-by: ddobrin <[email protected]>
1 parent f4d8d8d commit ede08c0

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

models/spring-ai-google-genai/src/main/java/org/springframework/ai/vertexai/gemini/VertexAiGeminiChatModel.java

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ public enum ChatModel implements ChatModelDescription {
948948
* See: <a href=
949949
* "https://cloud.google.com/vertex-ai/generative-ai/docs/models/gemini/2-0-flash">gemini-2.0-flash</a>
950950
*/
951-
GEMINI_2_0_FLASH("gemini-2.0-flash"),
951+
GEMINI_2_0_FLASH("gemini-2.0-flash-001"),
952952

953953
/**
954954
* <b>gemini-2.0-flash-lite</b> is the fastest and most cost efficient Flash
@@ -965,7 +965,7 @@ public enum ChatModel implements ChatModelDescription {
965965
* See: <a href=
966966
* "https://cloud.google.com/vertex-ai/generative-ai/docs/models/gemini/2-0-flash-lite">gemini-2.0-flash-lite</a>
967967
*/
968-
GEMINI_2_0_FLASH_LIGHT("gemini-2.0-flash-lite"),
968+
GEMINI_2_0_FLASH_LIGHT("gemini-2.0-flash-lite-001"),
969969

970970
/**
971971
* <b>gemini-2.5-pro</b> is the most advanced reasoning Gemini model, capable of
@@ -997,7 +997,24 @@ public enum ChatModel implements ChatModelDescription {
997997
* See: <a href=
998998
* "https://cloud.google.com/vertex-ai/generative-ai/docs/models/gemini/2-5-flash">gemini-2.5-flash</a>
999999
*/
1000-
GEMINI_2_5_FLASH("gemini-2.5-flash");
1000+
GEMINI_2_5_FLASH("gemini-2.5-flash"),
1001+
1002+
/**
1003+
* <b>gemini-2.5-flash-lite</b> is the fastest and most cost efficient Flash
1004+
* model. It's an upgrade path for 2.0 Flash users who want better quality for the
1005+
* same price and speed.
1006+
* <p>
1007+
* Inputs: Text, Code, Images, Audio, Video - 1,048,576 tokens | Outputs: Text -
1008+
* 8,192 tokens
1009+
* <p>
1010+
* Knowledge cutoff: Jan 2025
1011+
* <p>
1012+
* Model ID: gemini-2.0-flash-lite
1013+
* <p>
1014+
* See: <a href=
1015+
* "https://cloud.google.com/vertex-ai/generative-ai/docs/models/gemini/2-5-flash-lite">gemini-2.5-flash-lite</a>
1016+
*/
1017+
GEMINI_2_5_FLASH_LIGHT("gemini-2.5-flash-lite");
10011018

10021019
public final String value;
10031020

models/spring-ai-google-genai/src/test/java/org/springframework/ai/vertexai/gemini/VertexAiGeminiChatModelIT.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void googleSearchToolPro() {
9898
.googleSearchRetrieval(true)
9999
.build());
100100
ChatResponse response = this.chatModel.call(prompt);
101-
assertThat(response.getResult().getOutput().getText()).containsAnyOf("Blackbeard", "Bartholomew");
101+
assertThat(response.getResult().getOutput().getText()).containsAnyOf("Blackbeard", "Bartholomew", "Calico Jack", "Anne Bonny");
102102
}
103103

104104
@Test
@@ -129,7 +129,7 @@ void testSafetySettings() {
129129

130130
@NonNull
131131
private Prompt createPrompt(VertexAiGeminiChatOptions chatOptions) {
132-
String request = "Name 3 famous pirates from the Golden Age of Piracy and what they did.";
132+
String request = "Name 3 famous pirates from the Golden Age of Piracy and tell me what they did.";
133133
String name = "Bob";
134134
String voice = "pirate";
135135
UserMessage userMessage = new UserMessage(request);
@@ -368,7 +368,7 @@ void jsonTextToolCallingTest() {
368368
.genAiClient(genAiClient())
369369
.toolCallingManager(toolCallingManager)
370370
.defaultOptions(VertexAiGeminiChatOptions.builder()
371-
.model(VertexAiGeminiChatModel.ChatModel.GEMINI_2_0_FLASH)
371+
.model(VertexAiGeminiChatModel.ChatModel.GEMINI_2_5_FLASH)
372372
.temperature(0.1)
373373
.build())
374374
.build();
@@ -379,7 +379,7 @@ void jsonTextToolCallingTest() {
379379
// should invoke the tool
380380
String response = chatClient.prompt()
381381
.tools(new CurrentTimeTools())
382-
.user("Get the current time. Make sure to use the getCurrentDateTime tool to get this information.")
382+
.user("Get the current time in the users timezone. Make sure to use the getCurrentDateTime tool to get this information.")
383383
.call()
384384
.content();
385385

0 commit comments

Comments
 (0)