From 017af348667b9262988b675871b0c10f6150bc7d Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Fri, 5 Jul 2024 12:06:20 -0700 Subject: [PATCH] fix(utils.py): fix openrouter supported params Fixes https://github.com/BerriAI/litellm/issues/4508 --- litellm/utils.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/litellm/utils.py b/litellm/utils.py index 7fbb5ebac92..490b809a1cf 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -2412,7 +2412,7 @@ def get_optional_params( ): # allow dynamically setting vertex ai init logic continue passed_params[k] = v - + optional_params: Dict = {} common_auth_dict = litellm.common_cloud_provider_auth_params @@ -2431,7 +2431,10 @@ def get_optional_params( non_default_params=passed_params, optional_params=optional_params ) ) - elif custom_llm_provider == "vertex_ai" or custom_llm_provider == "vertex_ai_beta": + elif ( + custom_llm_provider == "vertex_ai" + or custom_llm_provider == "vertex_ai_beta" + ): optional_params = litellm.VertexAIConfig().map_special_auth_params( non_default_params=passed_params, optional_params=optional_params ) @@ -3856,6 +3859,8 @@ def get_supported_openai_params( "top_logprobs", "response_format", "stop", + "tools", + "tool_choice", ] elif custom_llm_provider == "mistral" or custom_llm_provider == "codestral": # mistal and codestral api have the exact same params