diff --git a/litellm/llms/ollama/completion/transformation.py b/litellm/llms/ollama/completion/transformation.py index 7d35a7fc4f9..83f77b1ef62 100644 --- a/litellm/llms/ollama/completion/transformation.py +++ b/litellm/llms/ollama/completion/transformation.py @@ -473,7 +473,7 @@ class _OllamaJsonModeToolCall(BaseModel): model_config = ConfigDict(extra="forbid") name: str - arguments: dict[str, object] + arguments: dict[str, object] # mutable-ok: mirrors Ollama's arbitrary JSON argument object def _build_tool_call(response_text: str, tool_names: frozenset[str]) -> ChatCompletionToolCallChunk | None: diff --git a/litellm/utils.py b/litellm/utils.py index 1ddba30c6da..5cfce42379e 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -3915,7 +3915,7 @@ def pre_process_optional_params(passed_params: dict, non_default_params: dict, c non_default_params.pop("tool_choice", None) # causes ollama requests to hang elif "functions" in non_default_params: optional_params["functions_unsupported_model"] = non_default_params.pop("functions") - optional_params["prompted_tool_calls"] = optional_params.get("functions_unsupported_model") or [] + optional_params["prompted_tool_calls"] = optional_params.get("functions_unsupported_model") or [] # mutable-ok: fresh per-request list; empty means no tools offered elif litellm.add_function_to_prompt: # if user opts to add it to prompt instead optional_params["functions_unsupported_model"] = non_default_params.pop( "tools", non_default_params.pop("functions", None)