File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
litellm/llms/vertex_ai/gemini Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -465,7 +465,6 @@ def _map_thinking_param(
465
465
params ["includeThoughts" ] = True
466
466
if thinking_budget is not None and isinstance (thinking_budget , int ):
467
467
params ["thinkingBudget" ] = thinking_budget
468
-
469
468
return params
470
469
471
470
def map_response_modalities (self , value : list ) -> list :
@@ -618,7 +617,12 @@ def map_openai_params( # noqa: PLR0915
618
617
optional_params = self ._add_tools_to_optional_params (
619
618
optional_params , [_tools ]
620
619
)
621
- if supports_reasoning (model ):
620
+
621
+ ######################################################################################
622
+ # If the model supports reasoning and `thinkingConfig` is not set as yet
623
+ # we should set it to includeThoughts
624
+ ######################################################################################
625
+ if supports_reasoning (model ) and "thinkingConfig" not in optional_params :
622
626
optional_params ["thinkingConfig" ] = (
623
627
VertexGeminiConfig ._map_reasoning_effort_to_thinking_budget (
624
628
non_default_params .get ("reasoning_effort" )
Original file line number Diff line number Diff line change @@ -329,7 +329,7 @@ def test_gemini_thinking_budget_0():
329
329
"thinking" : {"type" : "enabled" , "budget_tokens" : 0 },
330
330
},
331
331
)
332
- print (raw_request )
332
+ print (json . dumps ( raw_request , indent = 4 , default = str ) )
333
333
assert "0" in json .dumps (raw_request ["raw_request_body" ])
334
334
335
335
You can’t perform that action at this time.
0 commit comments