-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Using Azure and OpenAI at the same time #411
Comments
There are still some limitations due to underlying langchain and openai API limitations, e.g. langchain-ai/langchain#3769 and openai/openai-python#411. Notably, you can't use the Azure and non-Azure node types in the same server, since there's global openai configuration needed to choose between the two. So it's probably best to still leave the Azure node types commented out in the default config. But with this PR, if you uncomment those nodes and start the server with OPENAI_API_TYPE=azure, you will have working Azure nodes.
There are still some rough edges due to underlying langchain and openai API limitations, e.g. langchain-ai/langchain#3769 and openai/openai-python#411. Notably, you can't use the Azure and non-Azure node types in the same server, since there's global openai configuration needed to choose between the two. So it's probably best to still leave the Azure node types commented out in the default config. But with this PR, if you uncomment those nodes and start the server with OPENAI_API_TYPE=azure, you will have working Azure nodes.
+1 on this. Right now we have different models available on each side and using the two providers in tandem is a huge pain |
This is indeed annoying… I need Whisper from OpenAI but ChatCompletion from Azure. @ellis-jc How do you guys handle it? FYI, I posted this on StackOverflow: How to use the Python openai client with both Azure and OpenAI at the same time? |
+1 on this. |
According to this response, there is a non-documented feature: Many API features accept named arguments such as:
Setting the |
I just tried it with openai.Image.create() and it works. btw: looks like the upcoming 1.0.0 module version will finally support client instantiation. See #631 |
Describe the bug
Currently it seems there is no strightforward way to be able to send requests to both OpenAI and Azure from same python program. Ideally this should be possible:
openai = OpenAI(key=key)
azureai = OpenAI(key=key, api_base=xxx, ....)
While currently given key, api_base, etc. are global variables to the module, the above won't work.
To Reproduce
Code snippets
No response
OS
Linux
Python version
Python 3
Library version
latest
The text was updated successfully, but these errors were encountered: