Skip to content

feat(go/plugins/googlegenai): Add Gemini 3.1 Flash preview models#5179

Merged
cabljac merged 3 commits into
mainfrom
feat/go-googlegenai-gemini-3-1-preview
May 12, 2026
Merged

feat(go/plugins/googlegenai): Add Gemini 3.1 Flash preview models#5179
cabljac merged 3 commits into
mainfrom
feat/go-googlegenai-gemini-3-1-preview

Conversation

@cabljac
Copy link
Copy Markdown
Contributor

@cabljac cabljac commented Apr 23, 2026

Adds the two Gemini 3.1 preview models on both backends:

  • gemini-3.1-flash-lite-preview
  • gemini-3.1-flash-image-preview

Registered as Multimodal / ModelStageUnstable on GoogleAI and VertexAI. Also extends the imagen-gemini sample with two generate helpers (text-only and image+caption) and four flows exercising both models on each backend, gated by a hasVertexAIConfig() check so GoogleAI-only environments still run.

Closes the four gemini-3.1-flash-*-preview rows on the Go parity tracker.

Test plan

  • go test ./plugins/googlegenai/...
  • go build ./samples/imagen-gemini/...
  • Live: run the sample with GEMINI_API_KEY (and optionally GOOGLE_CLOUD_PROJECT/GOOGLE_CLOUD_LOCATION) and invoke the four new flows from the dev UI.

Evidence of manual testing:
Screenshot 2026-04-23 at 13 04 19

gemini31LiteGoogleAIFlow

Screenshot 2026-04-23 at 13 02 41 Screenshot 2026-04-23 at 13 06 50

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.
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

cabljac added 2 commits April 23, 2026 11:40
…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.
@cabljac cabljac marked this pull request as ready for review April 23, 2026 12:31
@cabljac cabljac enabled auto-merge (squash) April 23, 2026 12:31
@cabljac cabljac disabled auto-merge April 23, 2026 12:31
@cabljac cabljac requested a review from apascal07 May 5, 2026 16:57
Comment thread go/plugins/googlegenai/models.go
@cabljac cabljac enabled auto-merge (squash) May 12, 2026 10:51
@cabljac cabljac merged commit d506edb into main May 12, 2026
9 checks passed
@cabljac cabljac deleted the feat/go-googlegenai-gemini-3-1-preview branch May 12, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants