Skip to content

Conversation

@sebslight
Copy link
Contributor

@sebslight sebslight commented Nov 19, 2025

Gemini 3 models require 'includeThoughts: True' in the thinkingConfig to return the actual thought text. Previously, using reasoning_effort set the 'thinkingLevel' but missed the boolean flag, resulting in empty reasoning_content.

Title

Add includeThoughts=True for Gemini 3 reasoning_effort

Relevant issues

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • I have added a screenshot of my new test passing locally
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🐛 Bug Fix

Changes

Fix:
Updated _map_reasoning_effort_to_thinking_level in vertex_httpx.py to return:

  • includeThoughts: True when effort is low/medium/high/minimal.
  • includeThoughts: False when effort is disable/none.

Testing:
Added a unit test test_reasoning_effort_maps_to_thinking_level_gemini_3 to verify that the config dictionary correctly includes the includeThoughts boolean for Gemini 3 models.

image

Gemini 3 models require 'includeThoughts: True' in the thinkingConfig to return the actual thought text. Previously, using reasoning_effort set the 'thinkingLevel' but missed the boolean flag, resulting in empty reasoning_content.

This fix:
1. Updates `_map_reasoning_effort_to_thinking_level` to include `includeThoughts: True` for low/medium/high.
2. Adds unit tests to verify the config mapping.
@vercel
Copy link

vercel bot commented Nov 19, 2025

@sebslight is attempting to deploy a commit to the CLERKIEAI Team on Vercel.

A member of the Team first needs to authorize it.

@krrishdholakia krrishdholakia merged commit cb84368 into BerriAI:main Nov 20, 2025
3 of 6 checks passed
ishaan-jaff pushed a commit that referenced this pull request Nov 22, 2025
#16838)

Gemini 3 models require 'includeThoughts: True' in the thinkingConfig to return the actual thought text. Previously, using reasoning_effort set the 'thinkingLevel' but missed the boolean flag, resulting in empty reasoning_content.

This fix:
1. Updates `_map_reasoning_effort_to_thinking_level` to include `includeThoughts: True` for low/medium/high.
2. Adds unit tests to verify the config mapping.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants