diff --git a/litellm/llms/ollama/chat/transformation.py b/litellm/llms/ollama/chat/transformation.py index cdc0ad00786..e63448fc0d6 100644 --- a/litellm/llms/ollama/chat/transformation.py +++ b/litellm/llms/ollama/chat/transformation.py @@ -172,7 +172,13 @@ class OllamaChatConfig(BaseConfig): optional_params["format"] = value["json_schema"]["schema"] if ( param == "reasoning_effort" - and (think := think_from_reasoning_effort(model, cast(object, value))) is not None + and ( + think := think_from_reasoning_effort( + model, + cast(object, value), # cast-ok: [LIT006] untyped dict value, widened to object for the helper + ) + ) + is not None ): optional_params["think"] = think ### FUNCTION CALLING LOGIC ### diff --git a/litellm/llms/ollama/completion/transformation.py b/litellm/llms/ollama/completion/transformation.py index b0cb2d4ed27..b712bb7cc5b 100644 --- a/litellm/llms/ollama/completion/transformation.py +++ b/litellm/llms/ollama/completion/transformation.py @@ -216,7 +216,13 @@ class OllamaConfig(BaseConfig): optional_params["stop"] = value elif ( param == "reasoning_effort" - and (think := think_from_reasoning_effort(model, cast(object, value))) is not None + and ( + think := think_from_reasoning_effort( + model, + cast(object, value), # cast-ok: [LIT006] untyped dict value, widened to object for the helper + ) + ) + is not None ): optional_params["think"] = think elif param == "response_format" and isinstance(value, dict):