From 4ffa9e2fec84635fd9b7a2422d6e7f9b64a32286 Mon Sep 17 00:00:00 2001 From: Luis Sanchez Date: Fri, 7 Feb 2025 20:11:25 -0500 Subject: [PATCH 1/2] Fix litellm.add_function_to_prompt --- litellm/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/utils.py b/litellm/utils.py index c89c3d5c9a..8110b4cc3f 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -2813,7 +2813,7 @@ def get_optional_params( # noqa: PLR0915 ): if ( custom_llm_provider == "ollama" - and custom_llm_provider != "text-completion-openai" + or custom_llm_provider != "text-completion-openai" and custom_llm_provider != "azure" and custom_llm_provider != "vertex_ai" and custom_llm_provider != "anyscale" From d427ba5438ed97632251c55ffcc84d37af494bbb Mon Sep 17 00:00:00 2001 From: Luis Sanchez Date: Fri, 7 Feb 2025 22:33:11 -0500 Subject: [PATCH 2/2] Revert to openai provider check --- litellm/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/utils.py b/litellm/utils.py index 8110b4cc3f..3c04da0266 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -2812,8 +2812,8 @@ def get_optional_params( # noqa: PLR0915 or "tools" in non_default_params ): if ( - custom_llm_provider == "ollama" - or custom_llm_provider != "text-completion-openai" + custom_llm_provider != "openai" + and custom_llm_provider != "text-completion-openai" and custom_llm_provider != "azure" and custom_llm_provider != "vertex_ai" and custom_llm_provider != "anyscale"