Repository navigation
Conversation
This branch has not been deployed
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.
Background
au.gemini-3.5-flash,eu.gemini-3.5-flash, andus.gemini-3.1-pro) were not matched by/(^|\/)gemini-/iingetGoogleModelCapabilities, causingusesGemini3Featuresto evaluate tofalseand routing Gemini 3+ models to the Gemini 2.5thinkingBudgetconfiguration instead ofthinkingLevel.getMinimumThinkingLevelForGemini3Modelonly checked forgemini-X.Y-flashand defaulted tominimalwheneverversionMatch == null. Because Gemini 3+ Pro models (gemini-3.5-pro,gemini-3.1-pro,gemini-3.1-pro-preview,gemini-3-pro-preview) do not supportthinkingLevel: minimal(minimum supported level islow), passingreasoning: noneorminimalresulted in an HTTP 400INVALID_ARGUMENTerror from the Gemini API.resolvedThinkingwithproviderOptions.google.thinkingConfigcould leave boththinkingLevelandthinkingBudgetdefined simultaneously when a Gemini 3 model had top-levelreasoningset alongsideproviderOptions.google.thinkingConfig.thinkingBudget(or vice versa).Summary
packages/google/src/google-model-capabilities.tsandpackages/google/src/google-language-model.tsfrom/(^|\/).../ito/(^|[/.]).../iso regional endpoint prefixes (au.,eu.,us.) are properly recognized.getMinimumThinkingLevelForGemini3Modelinpackages/google/src/google-language-model.tsto strip regional dot prefixes and returnlowfor all Gemini 3+ Pro models (/^gemini-(?:\d+(?:\.\d+)?-)?pro(?:$|-)/).thinkingLevelwhenproviderOptions.google.thinkingConfig.thinkingBudgetis explicitly provided (and vice versa) so both fields are never sent simultaneously.google-model-capabilities.test.tsandgoogle-language-model.test.tscoveringgemini-3.5-flash,au.gemini-3.5-flash,eu.gemini-3.5-flash,gemini-3.5-pro,gemini-3.1-pro,us.gemini-3.1-pro, andproviderOptions.google.thinkingConfigoverride precedence.@ai-sdk/googleand@ai-sdk/google-vertex.End-to-End Verification
Verified generated
generationConfig.thinkingConfigpayloads across@ai-sdk/googleand@ai-sdk/google-vertexforgemini-3.5-flash,au.gemini-3.5-flash,gemini-3.5-pro,gemini-3.1-pro, andgemini-2.5-prowithreasoning: none,minimal,low,medium,high, andproviderOptions.google.thinkingConfigoverrides.Checklist
pnpm changesetin the project root)