feat(go/plugins/googlegenai): Add Gemini 3.1 Flash preview models#5179
Merged
Conversation
Registers gemini-3.1-flash-lite-preview and gemini-3.1-flash-image-preview on both the GoogleAI and VertexAI backends with Multimodal capability and ModelStageUnstable. Extends the imagen-gemini sample with a VertexAI config detector, two generate helpers, and four flows that exercise the new models on each backend.
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces support for Gemini 3.1 Flash Lite and Image preview models in the Google AI and Vertex AI plugins. It also updates the imagen-gemini sample to include new flows demonstrating these models, along with logic to conditionally initialize the Vertex AI plugin based on environment configuration. I have no feedback to provide.
…ngLevel ThinkingBudget is deprecated for Gemini 3.x per Google's docs; the preferred API is ThinkingLevel. ThinkingLevelMinimal preserves the "fastest, cheapest" intent that ThinkingBudget=0 was expressing.
…Global-only preview models
Ehesp
approved these changes
Apr 28, 2026
apascal07
reviewed
May 5, 2026
apascal07
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the two Gemini 3.1 preview models on both backends:
gemini-3.1-flash-lite-previewgemini-3.1-flash-image-previewRegistered as Multimodal /
ModelStageUnstableon GoogleAI and VertexAI. Also extends theimagen-geminisample with two generate helpers (text-only and image+caption) and four flows exercising both models on each backend, gated by ahasVertexAIConfig()check so GoogleAI-only environments still run.Closes the four
gemini-3.1-flash-*-previewrows on the Go parity tracker.Test plan
go test ./plugins/googlegenai/...go build ./samples/imagen-gemini/...GEMINI_API_KEY(and optionallyGOOGLE_CLOUD_PROJECT/GOOGLE_CLOUD_LOCATION) and invoke the four new flows from the dev UI.Evidence of manual testing:

gemini31LiteGoogleAIFlow