[Feature] Add Gemini 3.0 thinking level and systemInstruction casing support#629
Conversation
- Add support for thinking level configuration (low/medium/high) for Gemini 3.0 - Implement thinking level extraction from model names (e.g., gemini-3.0-pro-low-thinking) - Separate thinking model variants: Gemini 2.5 (thinking/non-thinking) vs Gemini 3.0 (level-based) - Add filterKeys utility to remove null/undefined values from thinkingConfig - Update safety settings to apply 'OFF' threshold for all non-Gemini-1 models - Fix Google Search API selection logic (Gemini 1.x uses google_search_retrieval, others use google_search) - Set thinkingBudget to undefined for Gemini 3.0 (uses level instead) - Bump version to 1.3.5
… thinking defaults - Add useCamelCaseSystemInstruction config option to toggle between camelCase and snake_case - Support dynamic system instruction key selection based on configuration - Change default thinkingLevel from 'high' to 'THINKING_LEVEL_UNSPECIFIED' for consistency - Update Gemini 3.0 thinking level default to THINKING_LEVEL_UNSPECIFIED - Add i18n support for new configuration option (en-US and zh-CN) - Bump version to 1.3.6
|
Caution Review failedThe pull request is closed. Walkthrough该PR对Gemini适配器进行多项更新:重新分类思考模型处理(引入 Changes
Sequence Diagram(s)sequenceDiagram
participant Client as 请求客户端
participant Adapter as Gemini适配器
participant Config as 配置管理
participant Utils as 工具函数
Client->>Adapter: 发送请求
Adapter->>Config: 读取useCamelCaseSystemInstruction配置
alt 驼峰式模式
Config-->>Adapter: true
Adapter->>Utils: 使用systemInstruction键
else snake_case模式
Config-->>Adapter: false
Adapter->>Utils: 使用system_instruction键
end
Utils->>Utils: 检查模型是否为thinkingLevelModel (gemini-3.0-pro)
alt 匹配thinkingLevelModel
Utils->>Utils: 应用thinkingLevel配置
Utils->>Utils: 过滤空值生成thinkingConfig
else 其他模型
Utils->>Utils: 保持现有thinking逻辑
end
Utils-->>Adapter: 返回配置化的生成参数
Adapter-->>Client: 返回处理结果
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (3)
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 |
Summary of ChangesHello @dingyi222666, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly upgrades the Gemini adapter by integrating new features for Gemini 3.0 models, specifically introducing support for various thinking levels to offer more precise control over model behavior. It also enhances configurability by allowing users to specify the casing for system instructions, which is crucial for interoperability. Additionally, the PR refines how Google Search is utilized and adjusts safety settings based on the specific Gemini model version, ensuring better alignment with the capabilities and requirements of different model generations. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces support for Gemini 3.0 thinking levels and configurable casing for systemInstruction. The changes are well-structured, and the fix for the Google Search API selection logic is a good improvement. I've identified a potential bug in how the thinkingLevel is formatted for the API, a minor translation issue, and a suggestion to improve model discoverability. Overall, great work on expanding the adapter's capabilities.
This PR adds Gemini 3.0 thinking level support and systemInstruction casing configuration.
New Features
useCamelCaseSystemInstructionconfig optionOther Changes
THINKING_LEVEL_UNSPECIFIED