When using MCP tools with require_approval='never' and Gemini models,
the follow-up call after tool execution was failing with:
'Please ensure that function call turn comes immediately after a user
turn or after a function response turn.'
This was caused by adding an empty assistant message between the user
message and function calls, which violates Gemini's conversation format
requirements.
Changes:
- Only add assistant message to follow-up input if it contains actual content
- Allow function calls to come directly after user messages (as Gemini requires)
- Add explanatory comments about Gemini's format requirements
This fix allows MCP auto-execution to work correctly with Gemini models
while maintaining compatibility with other models.
Fixes: #[issue-number-if-any]
The tooltip for OpenAI api_base select fields incorrectly mentioned 'choose Custom to enter your own' but there was no Custom option available in the dropdown. This fix updates the tooltip text to accurately reflect the available options.
Affected providers:
- OpenAI
- OpenAI_Text
* fix: support Anthropic tool_use and tool_result in token counter
* refactor(token_counter): add dynamic field inference for Anthropic content blocks
* test: Add additional tests
* make format
* Fix lint error
* Fix mypy narrow type lint errors
Implements support for reasoning_effort="none" parameter for Gemini models,
providing significant cost savings (up to 96% cheaper) by disabling thinking
budget while maintaining response quality.
Changes:
- Added "supports_reasoning": true to gemini-2.0-flash-thinking-exp-01-21 in model config
- Implemented mapping for reasoning_effort="none" to thinkingConfig {thinkingBudget: 0, includeThoughts: false}
- Added unit test to verify the mapping works correctly
Performance impact:
- Without reasoning_effort: ~313 tokens
- With reasoning_effort="none": ~12 tokens (96% cheaper)
Closes#16420
Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>
Related to PR #16210 which fixed automatic summary field addition
Changes:
- Document reasoning_effort string vs dict formats
- Add summary field options (auto, detailed, concise)
- Add table of supported reasoning_effort values by GPT-5 model
- Clarify model-specific support and limitations
- Note that summary field requires org verification
The previous implementation automatically added summary field causing
400 errors for unverified orgs. Now users can opt-in by passing
reasoning_effort as dict with explicit summary field.
Fixes#16533
Before this fix, non-ASCII characters (Japanese, Spanish, Chinese, etc.)
in function call arguments were being escaped as Unicode sequences.
Example:
- Before: "やあ" → "\u3084\u3042"
- After: "やあ" → "やあ" (preserved)
Changes:
- Add ensure_ascii=False to json.dumps() in _transform_parts()
- Add test for Japanese and Spanish Unicode character preservation
This is not a breaking change as both formats are equivalent in JSON.
The fix improves readability and aligns with OpenAI's behavior.
* fix: Improve Azure auth parameter handling for None values
Previously, litellm_params.get() with default fallbacks could ignore
environment variables when the param existed but was None. Now explicitly
checks for None values before falling back to environment variables.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix lint
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>