fix(gemini): drop sampling parameters and candidate_count for Gemini 3 models - #863
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 4 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe Gemini provider now omits selected sampling parameters for Gemini 3 and later models. Gemini 2.5 and non-Gemini models retain the previous behavior. Tests and provider documentation cover the model-specific behavior. ChangesGemini sampling parameters
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to The PR removes unsupported sampling fields from native Gemini 3 and later requests while preserving existing behavior for other models; no actionable merge-blocking risk remains after normal checks and review. Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Description checkExplanation The description is detailed, relevant, and covers the change, rationale, affected modes, preserved settings, tests, documentation, caveats, and references. It uses a "## Summary" heading instead of the template's required "## Description" heading, but the required information is present. Full details: Docstring CoverageExplanation Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Confidence Score: 5/5The native Gemini request-generation behavior is safe to merge based on direct execution across relevant Gemini and control model identifiers. Direct request-generation checks confirmed that Gemini 3+ identifiers omit the four intended fields while Gemini 2.5 and non-Gemini controls preserve them; focused package tests also passed. Files Needing Attention: No files need follow-up attention.
What T-Rex did
Reviews (1): Last reviewed commit: "fix(gemini): drop sampling parameters an..." | Re-trigger Greptile |
Summary
Google's Gemini 3 migration guides say to remove
temperature,top_pandtop_kfrom every request ("Gemini 3's reasoning capabilities are optimized for the default settings", "Remove these parameters from all requests") and listcandidate_countas unsupported on Gemini 3.x. In native mode GoModel builds thegenerationConfigitself, so it now leaves those four fields out for Gemini 3 and later and keeps forwarding them for Gemini 2.5, Gemma and other model IDs.geminiGenerationparser reads the<major>.<minor>generation fromgemini-*IDs, including Vertexgoogle/prefixes, anddropsSamplingParametersgates on major >= 3.max_tokens,stop, penalties,response_formatand thinking settings are unchanged.Caveat for reviewers: Google documents these parameters as "no longer recommended" and unsupported, not as returning HTTP 400 today. This is a proactive alignment with the migration guidance (mirrors #856 for Anthropic), and it changes behavior for callers that set
temperatureon a Gemini 3 model. Independent of #862, which fixes an actual 400 onreasoning_effort: minimal.References: What's new in Gemini 3.5 Flash, What's new in Gemini 3.8 Flash.
Summary by CodeRabbit
Bug Fixes
Documentation