Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Azure OpenAI authentication from UI #794

Merged
merged 2 commits into from
May 20, 2024

Conversation

dlqqq
Copy link
Member

@dlqqq dlqqq commented May 20, 2024

Description

Fixes Azure OpenAI authentication from the UI. This issue arises from this line in LangChain: https://github.com/langchain-ai/langchain/blob/f2579096993ae460516a0aae1d3e09f3eb5c1772/libs/partners/openai/langchain_openai/llms/azure.py#L89

Previously, we assumed the keyword parameter was the same as the auth environment variable name in lowercase. However, AzureOpenAI expects the AZURE_OPENAI_API_KEY environment variable but the openai_api_key keyword parameter. This PR adds a new keyword_param: Optional[str] field to EnvAuthStrategy to specify that a different keyword parameter should be used than the default we assume.

Also removes unused imports in providers.py.

Closes #214.

@dlqqq dlqqq added the bug Something isn't working label May 20, 2024
@dlqqq dlqqq force-pushed the fix-azure-openai branch from a0aa1c2 to 48c4908 Compare May 20, 2024 21:44
@dlqqq dlqqq force-pushed the fix-azure-openai branch from 48c4908 to 253e4e1 Compare May 20, 2024 21:47
@dlqqq dlqqq merged commit e41cebf into jupyterlab:main May 20, 2024
8 checks passed
Marchlak pushed a commit to Marchlak/jupyter-ai that referenced this pull request Oct 28, 2024
* fix Azure OpenAI authentication from UI

* pre-commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chat UI not showing on jupyterhub
2 participants