From 26aefc7cd6808f4fc701482967ce1ce5392991d6 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Fri, 17 May 2024 08:02:24 -0700 Subject: [PATCH] fix(utils.py): support openrouter function calling --- litellm/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/litellm/utils.py b/litellm/utils.py index bfc81ae74f6..ebf5d980c27 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -5127,7 +5127,7 @@ def get_optional_params( or "tools" in non_default_params ): if ( - custom_llm_provider != "openai" + custom_llm_provider == "ollama" and custom_llm_provider != "text-completion-openai" and custom_llm_provider != "azure" and custom_llm_provider != "vertex_ai" @@ -5141,6 +5141,8 @@ def get_optional_params( and custom_llm_provider != "cohere" and custom_llm_provider != "bedrock" and custom_llm_provider != "ollama_chat" + and custom_llm_provider != "openrouter" + and custom_llm_provider not in litellm.openai_compatible_providers ): if custom_llm_provider == "ollama": # ollama actually supports json output