Skip to content

Commit 5a20eaf

Browse files
fix(vertexai): Update gemini model to gemini-2.5-flash (#10231)
1 parent b8142a7 commit 5a20eaf

File tree

12 files changed

+12
-16
lines changed

12 files changed

+12
-16
lines changed

vertexai/snippets/src/main/java/vertexai/gemini/ControlledGenerationSchema6.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public static void main(String[] args) throws IOException {
3333
// TODO(developer): Replace these variables before running the sample.
3434
String projectId = "genai-java-demos";
3535
String location = "us-central1";
36-
String modelName = "gemini-2.0-flash-001";
36+
String modelName = "gemini-2.5-flash";
3737

3838
controlGenerationWithJsonSchema6(projectId, location, modelName);
3939
}

vertexai/snippets/src/main/java/vertexai/gemini/FunctionCalling.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public static void main(String[] args) throws IOException {
3838
// TODO(developer): Replace these variables before running the sample.
3939
String projectId = "your-google-cloud-project-id";
4040
String location = "us-central1";
41-
String modelName = "gemini-2.0-flash-001";
41+
String modelName = "gemini-2.5-flash";
4242

4343
String promptText = "What's the weather like in Paris?";
4444

vertexai/snippets/src/main/java/vertexai/gemini/GetMediaTokenCount.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static void main(String[] args) throws IOException {
3030
// TODO(developer): Replace these variables before running the sample.
3131
String projectId = "your-google-cloud-project-id";
3232
String location = "us-central1";
33-
String modelName = "gemini-2.0-flash-001";
33+
String modelName = "gemini-2.5-flash";
3434

3535
getMediaTokenCount(projectId, location, modelName);
3636
}

vertexai/snippets/src/main/java/vertexai/gemini/GetTokenCount.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static void main(String[] args) throws IOException {
2828
// TODO(developer): Replace these variables before running the sample.
2929
String projectId = "your-google-cloud-project-id";
3030
String location = "us-central1";
31-
String modelName = "gemini-2.0-flash-001";
31+
String modelName = "gemini-2.5-flash";
3232

3333
getTokenCount(projectId, location, modelName);
3434
}

vertexai/snippets/src/main/java/vertexai/gemini/Multimodal.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static void main(String[] args) throws Exception {
2929
// TODO(developer): Replace these variables before running the sample.
3030
String projectId = "your-google-cloud-project-id";
3131
String location = "us-central1";
32-
String modelName = "gemini-2.0-flash-001";
32+
String modelName = "gemini-2.5-flash";
3333

3434
String output = nonStreamingMultimodal(projectId, location, modelName);
3535
System.out.println(output);

vertexai/snippets/src/main/java/vertexai/gemini/QuestionAnswer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static void main(String[] args) throws Exception {
2828
// TODO(developer): Replace these variables before running the sample.
2929
String projectId = "your-google-cloud-project-id";
3030
String location = "us-central1";
31-
String modelName = "gemini-2.0-flash-001";
31+
String modelName = "gemini-2.5-flash";
3232

3333
String output = simpleQuestion(projectId, location, modelName);
3434
System.out.println(output);

vertexai/snippets/src/main/java/vertexai/gemini/Quickstart.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static void main(String[] args) throws IOException {
3030
// TODO(developer): Replace these variables before running the sample.
3131
String projectId = "your-google-cloud-project-id";
3232
String location = "us-central1";
33-
String modelName = "gemini-2.0-flash-001";
33+
String modelName = "gemini-2.5-flash";
3434

3535
String output = quickstart(projectId, location, modelName);
3636
System.out.println(output);

vertexai/snippets/src/main/java/vertexai/gemini/StreamingMultimodal.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static void main(String[] args) throws Exception {
2727
// TODO(developer): Replace these variables before running the sample.
2828
String projectId = "your-google-cloud-project-id";
2929
String location = "us-central1";
30-
String modelName = "gemini-2.0-flash-001";
30+
String modelName = "gemini-2.5-flash";
3131

3232
streamingMultimodal(projectId, location, modelName);
3333
}

vertexai/snippets/src/main/java/vertexai/gemini/StreamingQuestionAnswer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public static void main(String[] args) throws Exception {
2626
// TODO(developer): Replace these variables before running the sample.
2727
String projectId = "your-google-cloud-project-id";
2828
String location = "us-central1";
29-
String modelName = "gemini-2.0-flash-001";
29+
String modelName = "gemini-2.5-flash";
3030

3131
streamingQuestion(projectId, location, modelName);
3232
}

vertexai/snippets/src/main/java/vertexai/gemini/TextInput.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static void main(String[] args) throws IOException {
2929
// TODO(developer): Replace these variables before running the sample.
3030
String projectId = "your-google-cloud-project-id";
3131
String location = "us-central1";
32-
String modelName = "gemini-2.0-flash-001";
32+
String modelName = "gemini-2.5-flash";
3333
String textPrompt =
3434
"What's a good name for a flower shop that specializes in selling bouquets of"
3535
+ " dried flowers?";

0 commit comments

Comments
 (0)