feat: Add Gemini 3 support with ThinkingLevel and thought signatures#97
feat: Add Gemini 3 support with ThinkingLevel and thought signatures#97
Conversation
- Deleted `README_old.md` to retire outdated information. - Updated `README.md` with links to the MCP Integration Guide and examples for better accessibility.
- Add ThinkingLevel enum (THINKING_LEVEL_UNSPECIFIED, LOW, HIGH) to control the depth of model reasoning for Gemini 3 and later models - Add ThinkingLevel property to ThinkingConfig class - Add Gemini3ProPreview and Gemini3FlashPreview model constants - Add comprehensive unit tests for ThinkingConfig serialization - Add unit tests for Part.Thought and Part.ThoughtSignature preservation - Add integration tests for function calling with thinking features Fixes #94, #87
- Add tests that verify thought signatures are returned by the API - Add manual function call test to verify thought signature preservation - Add tests that inspect response parts for thought and thoughtSignature properties - Add proper FunctionCallingBehaviour control for inspecting raw responses - Fix syntax error in unit test
- Add comprehensive integration tests for Gemini 3 ThinkingConfig - Test thought signatures with function calling - Test ThinkingLevel (HIGH/LOW) with Gemini 3 models - Test ChatSession with thinking enabled - Fix Schema.AdditionalProperties causing API errors by adding [JsonIgnore] - Update ThinkingLevel tests to use Gemini 3 models (not supported on 2.x) Closes #94
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThis PR adds Gemini 3 support with thinking configuration features. Changes include two new model constants (Gemini3ProPreview and Gemini3FlashPreview), a ThinkingLevel enum and property for ThinkingConfig, modification to Schema serialization behavior, comprehensive unit and integration tests for thinking-enabled generation and function calling, updated README guidance, and removal of the legacy README_old.md file. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant GenerativeModel
participant GoogleAI as Google AI API
participant Response as Response Handler
Client->>GenerativeModel: Request with ThinkingConfig<br/>(IncludeThoughts, ThinkingBudget,<br/>ThinkingLevel)
GenerativeModel->>GoogleAI: Send generation request<br/>with thinking configuration
rect rgb(200, 220, 255)
Note over GoogleAI: API processes with thinking enabled
GoogleAI->>GoogleAI: Generate response with<br/>thought content
end
GoogleAI->>Response: Return response with:<br/>- Thought parts<br/>- ThoughtSignature<br/>- Function call metadata
Response->>Response: Extract and preserve<br/>ThoughtSignature from parts
alt Function Call Present
Response->>Client: Return function call details<br/>with thought signature intact
Client->>GenerativeModel: Resend with function result<br/>+ preserved ThoughtSignature
GenerativeModel->>GoogleAI: Continue conversation<br/>maintaining thought context
else No Function Call
Response->>Client: Return complete response<br/>with thoughts and content
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (8)
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
Changes
New Features
Bug Fixes
Closes #94, Closes #87
Summary by CodeRabbit
Release Notes
New Features
Documentation
Tests
✏️ Tip: You can customize this high-level summary in your review settings.