Merge pull request #21654 from BerriAI/litellm_new_gemini_pathc

Fix _map_reasoning_effort_to_thinking_level for all gemini 3 family
This commit is contained in:
Sameer Kankute
2026-02-20 18:14:47 +05:30
committed by GitHub
@@ -759,6 +759,9 @@ class VertexGeminiConfig(VertexAIBaseConfig, BaseConfig):
"gemini-3-flash-preview" in model.lower()
or "gemini-3-flash" in model.lower()
)
is_gemini31pro = model and (
"gemini-3.1-pro-preview" in model.lower()
)
if reasoning_effort == "minimal":
if is_gemini3flash:
return {"thinkingLevel": "minimal", "includeThoughts": True}
@@ -767,7 +770,10 @@ class VertexGeminiConfig(VertexAIBaseConfig, BaseConfig):
elif reasoning_effort == "low":
return {"thinkingLevel": "low", "includeThoughts": True}
elif reasoning_effort == "medium":
if is_gemini31pro or is_gemini3flash:
return {"thinkingLevel": "medium", "includeThoughts": True}
else:
return {"thinkingLevel": "high", "includeThoughts": True}
elif reasoning_effort == "high":
return {"thinkingLevel": "high", "includeThoughts": True}
elif reasoning_effort == "disable":