(fix) using base_url Azure

This commit is contained in:
ishaan-jaff
2024-01-17 10:12:55 -08:00
parent 7178d01c8f
commit 5a8a5fa0fd
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -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")
+1 -1
View File
@@ -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"],
},
}
],