From 75eb6e7a72de2abd8c889e36c3a753f197d8e8c7 Mon Sep 17 00:00:00 2001 From: Vincent Cloutier Date: Wed, 10 Apr 2024 08:11:38 -0400 Subject: [PATCH] update azure openai arguments --- .../jupyter_ai_magics/partner_providers/openai.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/jupyter-ai-magics/jupyter_ai_magics/partner_providers/openai.py b/packages/jupyter-ai-magics/jupyter_ai_magics/partner_providers/openai.py index 382a480e1..f19670ca4 100644 --- a/packages/jupyter-ai-magics/jupyter_ai_magics/partner_providers/openai.py +++ b/packages/jupyter-ai-magics/jupyter_ai_magics/partner_providers/openai.py @@ -75,23 +75,20 @@ class AzureChatOpenAIProvider(BaseProvider, AzureChatOpenAI): id = "azure-chat-openai" name = "Azure OpenAI" models = ["*"] - model_id_key = "deployment_name" + model_id_key = "azure_deployment" model_id_label = "Deployment name" pypi_package_deps = ["langchain_openai"] - auth_strategy = EnvAuthStrategy(name="AZURE_OPENAI_API_KEY") + # Confusingly, langchain uses OPENAI_API_KEY also for azure, unlike the underlying openai package + auth_strategy = EnvAuthStrategy(name="OPENAI_API_KEY") registry = True fields = [ TextField( - key="openai_api_base", label="Base API URL (required)", format="text" + key="azure_endpoint", label="Base API URL (required)", format="text" ), TextField( - key="openai_api_version", label="API version (required)", format="text" + key="api_version", label="API version (required)", format="text" ), - TextField( - key="openai_organization", label="Organization (optional)", format="text" - ), - TextField(key="openai_proxy", label="Proxy (optional)", format="text"), ]