From 7a31033fa992cf3394fd3691c74c7f1b4bbfc813 Mon Sep 17 00:00:00 2001 From: Google Team Member Date: Tue, 25 Aug 2026 13:17:13 -0700 Subject: [PATCH] docs: update GenAI SDK README files to use gemini-flash-latest Updates code snippets and documentation examples in the Python, Go, Java, JavaScript, and .NET GenAI SDK README files to reference gemini-flash-latest. PiperOrigin-RevId: 970748778 --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index c5f29a5c0e4a..02fa887fab1b 100644 --- a/README.md +++ b/README.md @@ -301,7 +301,7 @@ public class GenerateContentWithTextInput { Client client = new Client(); GenerateContentResponse response = - client.models.generateContent("gemini-2.5-flash", "What is your name?", null); + client.models.generateContent("gemini-flash-latest", "What is your name?", null); // Gets the text string from the response by the quick accessor method `text()`. System.out.println("Unary response: " + response.text()); @@ -341,7 +341,7 @@ public class GenerateContentWithImageInput { Part.fromUri("gs://path/to/image.jpg", "image/jpeg")); GenerateContentResponse response = - client.models.generateContent("gemini-2.5-flash", content, null); + client.models.generateContent("gemini-flash-latest", content, null); System.out.println("Response: " + response.text()); } @@ -402,7 +402,7 @@ public class GenerateContentWithConfigs { .build(); GenerateContentResponse response = - client.models.generateContent("gemini-2.5-flash", "Tell me the history of LLM", config); + client.models.generateContent("gemini-flash-latest", "Tell me the history of LLM", config); System.out.println("Response: " + response.text()); } @@ -464,7 +464,7 @@ public class GenerateContentWithFunctionCall { GenerateContentResponse response = client.models.generateContent( - "gemini-2.5-flash", + "gemini-flash-latest", "What is the weather in Vancouver?", config); @@ -492,7 +492,7 @@ public class StreamGeneration { ResponseStream responseStream = client.models.generateContentStream( - "gemini-2.5-flash", "Tell me a story in 300 words.", null); + "gemini-flash-latest", "Tell me a story in 300 words.", null); System.out.println("Streaming response: "); for (GenerateContentResponse res : responseStream) { @@ -523,7 +523,7 @@ public class GenerateContentAsync { CompletableFuture responseFuture = client.async.models.generateContent( - "gemini-2.5-flash", "Introduce Google AI Studio.", null); + "gemini-flash-latest", "Introduce Google AI Studio.", null); responseFuture .thenAccept( @@ -576,7 +576,7 @@ public class GenerateContentWithSchema { .build(); GenerateContentResponse response = - client.models.generateContent("gemini-2.5-flash", "Tell me your name", config); + client.models.generateContent("gemini-flash-latest", "Tell me your name", config); System.out.println("Response: " + response.text()); } @@ -600,7 +600,7 @@ public class CountTokens { Client client = new Client(); CountTokensResponse response = - client.models.countTokens("gemini-2.5-flash", "What is your name?", null); + client.models.countTokens("gemini-flash-latest", "What is your name?", null); System.out.println("Count tokens response: " + response); } @@ -621,7 +621,7 @@ public class ComputeTokens { Client client = Client.builder().enterprise(true).build(); ComputeTokensResponse response = - client.models.computeTokens("gemini-2.5-flash", "What is your name?", null); + client.models.computeTokens("gemini-flash-latest", "What is your name?", null); System.out.println("Compute tokens response: " + response); } @@ -996,7 +996,7 @@ public final class FileOperations { Part.fromText("Summary this pdf."), Part.fromUri(file.name().get(), file.mimeType().get())); GenerateContentResponse response = - client.models.generateContent("gemini-2.5-flash", content, null); + client.models.generateContent("gemini-flash-latest", content, null); // Get the uploaded file. File retrievedFile = client.files.get(file.name().get(), null);