Skip to content

Azure openai key dont work #272

@sixlycos

Description

@sixlycos

After I referred to all the issues and tried all the modifications, I still got the prompt
openai.error.AuthenticationError: No API key provided. You can set your API key in code using 'openai.api_key = ', or you can set the environment variable OPENAI_API_KEY=). If your API key is stored in a file, you can point the openai module at it with 'openai.api_key_path = '. You can generate API keys in the OpenAI web interface. See https://platform.openai.com/account /api-keys for details.

The code is the same as the demo and has not been changed.
my OAI_CONFIG_LIST like :
`
[
{
"model": "mymodelname",
"api_key": "key",
"api_base": "endpoint",
"api_type": "azure",
"api_version": "2023-06-01-preview"
},
{
"model": "mymodelname",
"api_key": "key",
"api_base": "endpoint",
"api_type": "azure",
"api_version": "2023-06-01-preview"
}
]

`

This configuration works on openai.ChatCompletion.create,Indicates that my model is fully usable。

But I still don’t understand why it doesn’t work properly in autogen

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions