diff --git a/litellm/llms/azure.py b/litellm/llms/azure.py index 082fa05290..0eb70c86f7 100644 --- a/litellm/llms/azure.py +++ b/litellm/llms/azure.py @@ -106,7 +106,8 @@ def select_azure_base_url_or_endpoint(azure_client_params: dict): # } azure_endpoint = azure_client_params.get("azure_endpoint", None) if azure_endpoint is not None: - if "/openai" in azure_endpoint: + # see : https://github.com/openai/openai-python/blob/3d61ed42aba652b547029095a7eb269ad4e1e957/src/openai/lib/azure.py#L192 + if "/openai/deployments" in azure_endpoint: # this is base_url, not an azure_endpoint azure_client_params["base_url"] = azure_endpoint azure_client_params.pop("azure_endpoint") diff --git a/litellm/tests/test_completion.py b/litellm/tests/test_completion.py index e35abf7630..71884bde73 100644 --- a/litellm/tests/test_completion.py +++ b/litellm/tests/test_completion.py @@ -252,7 +252,7 @@ def test_completion_azure_gpt4_vision(): "type": "AzureComputerVision", "parameters": { "endpoint": "https://gpt-4-vision-enhancement.cognitiveservices.azure.com/", - "key": "efcd55c055ca47e08f61a8c54ba1707b", + "key": os.environ["AZURE_VISION_ENHANCE_KEY"], }, } ],