feat(ai): support Gemini 3 models and preserve tool call thought signatures
Merged
NA
2mo ago+329+329+012345678901234567890123456789-25-25-01234567890123456789
Problem
- Gemini 3 Support: Sure lacked catalog entries and pricing for Gemini 3 models (Flash, Flash-Lite, Pro).
- Tool Calling 400 Error: Gemini 3 models include an encrypted
thought_signatureinside anextra_contentfield on tool calls. When Sure sent follow-up tool results back without echoingextra_content, Google's OpenAI-compatible endpoint rejected the request with400 Bad Request.
Solution
- Added Gemini 3 models and pricing to
LlmUsage. - Preserved and passed back
extra_contenton assistant tool calls during follow-up turns, as required by Google's thought signature spec (following the same pattern as https://github.com/BerriAI/litellm/pull/16895). - Updated Gemini setup instructions in
docs/hosting/ai.md.
Testing Done
- Added unit tests for Gemini 3 pricing and provider detection.
- Added unit tests verifying
extra_contentis parsed and preserved on tool calls. - Verified test suite and RuboCop in devcontainer.
Summary by CodeRabbit
Summary
- New Features
- Added pricing information for Gemini 3 models, including promotional Flash rates and higher-context Pro tiers.
- Preserved additional provider metadata in tool calls when available, including Google-specific metadata, across requests and turns.
- Bug Fixes
- Improved Google model identification and pricing lookup, including for model names with a
google/prefix.
- Improved Google model identification and pricing lookup, including for model names with a
- Documentation
- Updated Gemini setup guidance, recommended models, pricing details, and configuration examples.