From 7178d01c8f102fe4d5e2b63d8fae9a4736aa5c78 Mon Sep 17 00:00:00 2001 From: ishaan-jaff Date: Wed, 17 Jan 2024 10:03:25 -0800 Subject: [PATCH] (feat) support base_url with /openai passed for Azure --- litellm/llms/azure.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/litellm/llms/azure.py b/litellm/llms/azure.py index 1ca9e515388..082fa052907 100644 --- a/litellm/llms/azure.py +++ b/litellm/llms/azure.py @@ -325,6 +325,9 @@ class AzureChatCompletion(BaseLLM): "max_retries": max_retries, "timeout": timeout, } + azure_client_params = select_azure_base_url_or_endpoint( + azure_client_params=azure_client_params + ) if api_key is not None: azure_client_params["api_key"] = api_key elif azure_ad_token is not None: @@ -386,6 +389,9 @@ class AzureChatCompletion(BaseLLM): "max_retries": max_retries, "timeout": timeout, } + azure_client_params = select_azure_base_url_or_endpoint( + azure_client_params=azure_client_params + ) if api_key is not None: azure_client_params["api_key"] = api_key elif azure_ad_token is not None: @@ -436,6 +442,9 @@ class AzureChatCompletion(BaseLLM): "max_retries": data.pop("max_retries", 2), "timeout": timeout, } + azure_client_params = select_azure_base_url_or_endpoint( + azure_client_params=azure_client_params + ) if api_key is not None: azure_client_params["api_key"] = api_key elif azure_ad_token is not None: @@ -549,6 +558,9 @@ class AzureChatCompletion(BaseLLM): "max_retries": max_retries, "timeout": timeout, } + azure_client_params = select_azure_base_url_or_endpoint( + azure_client_params=azure_client_params + ) if api_key is not None: azure_client_params["api_key"] = api_key elif azure_ad_token is not None: @@ -681,6 +693,9 @@ class AzureChatCompletion(BaseLLM): "max_retries": max_retries, "timeout": timeout, } + azure_client_params = select_azure_base_url_or_endpoint( + azure_client_params=azure_client_params + ) if api_key is not None: azure_client_params["api_key"] = api_key elif azure_ad_token is not None: