Repository navigation
Add Gemini 4 thinking levels, with xhigh for Hydrogen and Neon - #195
Merged
Merged
Conversation
Recognize argon, carbon, hydrogen, and neon as Gemini variants so suffixed ids and later versions inherit. All four take low/medium/high and reject minimal. Hydrogen and Neon also document xhigh, but @ai-sdk/google before 4.0.124 rejects it in provider options, so it is not advertised yet.
Argon, Carbon, Hydrogen, and Neon take low/medium/high on generateContent, so Databricks and OpenCode can route them natively instead of excluding them from discovery. xhigh for Hydrogen and Neon waits on @ai-sdk/google 4.0.124.
Move ai and every @ai-sdk/* package to the newest releases that share @ai-sdk/provider 4.0.38 and provider-utils 5.0.81 and satisfy min-release-age=7. @ai-sdk/google 4.0.121 accepts thinkingLevel xhigh (added in 4.0.119). @ai-sdk/google-vertex 5.0.141 requires google-auth-library 11, so the bridge moves to ^11.3.4 to keep one copy; v11's only breaking change is a Node 22 floor, which Assistant already requires.
Advertise and send xhigh on the Interactions API, Vertex, and generateContent. A wire test drives the bridge's option builders through @ai-sdk/google and asserts xhigh reaches the request body on both APIs.
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.
This PR adds thinking levels for Gemini 4 Argon, Carbon, Hydrogen and Neon, and upgrades the AI SDK packages so Hydrogen and Neon can use
xhigh. Before this, the four models weren't recognized as Gemini variants, so they had no thinking levels, and Databricks and OpenCode excluded them from discovery.What changed
findGeminiVariantDonor(ai-config/src/model-capabilities/gemini-variant.ts) parses the four names, so suffixed ids (gemini-4-argon-cyber-permissive) and later versions (gemini-4.1-neon) inherit their entries.VARIANT_ENTRIES, the bridge'sINTERACTIONS_PROFILESand the generateContent rules used by Databricks and OpenCode give all four models low, medium and high, and Hydrogen and Neon alsoxhigh. All four rejectminimal. The levels come from Google's model docs, checked 2026-11-20.aiand every@ai-sdk/*package move to the newest releases on@ai-sdk/provider4.0.38 andprovider-utils5.0.81 that meetmin-release-age=7, including@ai-sdk/google4.0.121.@ai-sdk/googlebefore 4.0.119 rejectsthinkingLevel: "xhigh"without sending a request. Newer Google releases pin newer exact provider versions, and Assistant requires a single copy of each, so all the SDK packages move together.@ai-sdk/google-vertex5.0.141 requiresgoogle-auth-library11, whose only breaking change is a Node 22 minimum, which Assistant already requires.What to watch for
The SDK upgrade affects every provider, not only Gemini. Assistant's side of the upgrade, including
@ai-sdk/mcp, is in a draft PR on posit-dev/assistant (branchgemini-4-thinking-levels).Testing
ai-provider-bridge/src/model-clients/__tests__/gemini-xhigh-wire.test.ts) drives the bridge's option builders through@ai-sdk/googleand checks thatxhighreaches the request body on both the Interactions API and generateContent.ca9eee7, the head of this branch. They weren't re-run before opening this PR.