feat: add thinkingLevel and thinkingBudget config for Gemini models#1110
feat: add thinkingLevel and thinkingBudget config for Gemini models#1110brendan-kellam merged 5 commits intomainfrom
Conversation
Add per-model thinking configuration for Google Generative AI and Google Vertex providers. `thinkingLevel` controls reasoning depth for Gemini 3 models, and `thinkingBudget` sets the thinking token budget for Gemini 2.5 models. Deprecates the GOOGLE_VERTEX_THINKING_BUDGET_TOKENS env var in favor of the new per-model config (with fallback). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
This comment has been minimized.
This comment has been minimized.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughAdds per-model Google thinking options ( Changes
Sequence Diagram(s)sequenceDiagram
participant ChatUtil as Chat Utility
participant Env as Environment
participant ProviderSDK as Google Provider SDK
ChatUtil->>ChatUtil: Read model config (thinkingLevel/thinkingBudget)
ChatUtil->>Env: If google-vertex and thinkingBudget missing -> read GOOGLE_VERTEX_THINKING_BUDGET_TOKENS
ChatUtil->>ProviderSDK: Build providerOptions { includeThoughts: true, thinkingLevel?, thinkingBudget? }
ProviderSDK->>ProviderSDK: Initialize request with thinkingConfig
ProviderSDK->>ProviderSDK: Execute API call
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
thinkingLevelandthinkingBudgetparameters to theGoogleGenerativeAILanguageModelandGoogleVertexLanguageModelschema definitions, allowing per-model thinking configuration.thinkingLevel(enum:minimal,low,medium,high) controls reasoning depth for Gemini 3 models.thinkingBudget(integer,-1for dynamic) sets the thinking token budget for Gemini 2.5 models.google-generative-aiandgoogle-vertexproviders.GOOGLE_VERTEX_THINKING_BUDGET_TOKENSenv var in favor of the new per-model config, with env var fallback for backward compatibility.🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Breaking Changes