-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Azure OpenAI API key not working for Autogen #601
Comments
Which version of pyautogen are you using? |
"model" needs to be set to match the deployment_name while "deployment_name" can be removed. |
I'm getting the same error here. This is my OAI_CONFIG_LIST.json {
"model": "gpt-35-turbo",
"base_url": "xxx",
"api_type": "azure",
"api_version": "2023-07-01-preview",
"api_key": "xxx"
} I know this instance exists because I can use it with just a normal openai call but getting 'Resource not found' when using it with autogen. pyautogen version 0.2.0b1 |
When you say it works with a regular OpenAI call, are you changing "model" -> "engine"? I think Autogen does this automatically, but the OpenAI library does not. I would expect it to fail with this same configuration. |
Yes, I switch it to engine. |
Were you able to fix it yet? |
Thanks for debugging. I think 0.2.0b2 or 0.2.0b3 moves to OpenAI 1.1.0. Perhaps this offers a fix? @sonichi knowns more. |
So, to fix it on mine I had to upgrade to 1.1.0 then I had to update the _client function call and the _process_for_azure function call in client.py to handle AzureOpenAI as well as OpenAI. It's a tad clunky since I don't know how all the code ties together but if you guys want a fix then I'd start there. |
To fix this issue, you need to install AutoGen with beta release:
Here is how to load config to fix this problem to specify
I've stuck for a lot time, that is why wanna share with you to help to fix it. |
|
This was not clear in the sample or documentation, so I created a PR for this: #734 |
THANK YOU SO MUCH! Just spent a couple of hours on this 😆 Now we know that MS research scientists don't use AOAI! |
thanks I solved the problem using this version. I also tried version 0.2.0b1, and some errors appeared. |
Hi everyone, Is there a way to use Azure OpenAI and Autogen without having the API key? In my company, we only receive information for access via the token. Here are the details we have:
Any guidance on how to proceed with this setup would be greatly appreciated. Thanks! |
Hello, I am trying to code an autogen bot using my Azure OpenAI Api key and my deployment I have created. I have used this key and deployment before in other projects not involving Autogen, and it has worked fine. However, when I try to use it for my Autogen code on a local Jupyter notebook, I get this error:
InvalidRequestError: The API deployment for this resource does not exist. If you created the deployment within the last 5 minutes, please wait a moment and try again.
I know that it's not my code and has to do with the Azure OpenAI API key itself, because when I tried my code with my own personal OpenAI API key, the code worked perfectly. However, for logistical reasons I must use my Azure OpenAI API key for this project. Does anyone know how to fix this? Here is my code for implementing my Azure OpenAI API key:
!pip install pyautogen
import sys
sys.path.append('./lib/python3.9/site-packages')
import autogen
config_list = [
{
'model' : 'gpt-3.5-turbo',
'api_key':'XXX',
'api_base' : 'XXX
'api_type' : 'azure',
'api_version' : '2023-05-15',
'deployment_name':'XXX'
}
]
The text was updated successfully, but these errors were encountered: