diff --git a/litellm/utils.py b/litellm/utils.py index 0326a63462..7494a067ab 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -3010,14 +3010,10 @@ def get_optional_params( # noqa: PLR0915 if custom_llm_provider == "ollama": optional_params["format"] = "json" litellm.add_function_to_prompt = True # so that main.py adds the function call to the prompt + non_default_params.pop("tool_choice", None) # causes ollama requests to hang - if "tools" in non_default_params: - optional_params[functions_unsupported_model_key] = non_default_params.pop("tools") - non_default_params.pop("tool_choice", None) # causes ollama requests to hang - elif "functions" in non_default_params: - optional_params[functions_unsupported_model_key] = non_default_params.pop("functions") # Handle all other providers that are not OpenAI-compatible - elif litellm.add_function_to_prompt and (custom_llm_provider not in litellm.openai_compatible_providers): + if litellm.add_function_to_prompt and (custom_llm_provider not in litellm.openai_compatible_providers): # Attempt to add the supplied function call to the prompt, preferring tools > functions > function_call function_call_value = non_default_params.pop("tools", non_default_params.pop("functions",