-
-
Notifications
You must be signed in to change notification settings - Fork 341
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
Update Azure OpenAI fields #722
Conversation
Thanks for submitting your first pull request! You are awesome! 🤗 |
@cloutier Thanks for making this update. Do you think this needs a fix upstream on the LangChain side? Is there a related issue opened there? |
e87f2cf
to
768a698
Compare
I looked deeper into it, and I wasn't quite right, langchain uses both env var: https://github.com/langchain-ai/langchain/blob/f2579096993ae460516a0aae1d3e09f3eb5c1772/libs/partners/openai/langchain_openai/llms/azure.py#L85 I have ammended my commit to not change the env var and added a comment about that, but upstream still has the limitation that you can't use both openai and azure openai. They do have a TODO in the code about it. |
@cloutier I reviewed the source code you linked, and think I understand the issue. Basically we assume the expected keyword argument to be the same as the environment variable name, i.e. My question to you is: how are you currently authenticating when using Azure in Jupyter AI? Are you setting the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing this issue! Approved. ✅
My thoughts:
- The fields removed in this PR were deprecated in the
openai>=1.0
upgrade in LangChain. - The issue about
AZURE_OPENAI_API_KEY
is an existing issue with Jupyter AI; thank you for bringing this to my attention again. - Therefore I'm merging this PR, and the API key issue can be addressed in a follow-up PR. 👍
768a698
to
2695301
Compare
@meeseeksdev please backport to 1.x |
Co-authored-by: Vincent Cloutier <[email protected]>
Description
I noticed Azure OpenAI wasn't working in our jupyterhub after an update, and I traced it to us having upgraded to openai 1.x.
I made the changes recommanded by the microsoft doc and I noticed there was also a regression regarding the env var. Unfortunately langchain uses the same env var for both azure and regular openai (sample code) which means people can't use both azure and openai at the same time with jupyter ai, although I think that is a very niche use case.
I have tested my patch in my org and it works now with these changes.
Related issues
azure_endpoint
param notopenai_api_base
#734