Reputation: 833
I have below the Python code.
client = AzureOpenAI(
api_key = os.getenv("AZURE_OPENAI_API_KEY"),
api_version = os.getenv('AZURE_OPENAI_API_VERSION'),
azure_endpoint = os.getenv('AZURE_OPENAI_ENDPOINT')
)
messages = [
{"role": "user", "content": prompt}
]
response = client.chat.completions.create(
model="gpt-4o-mini",
messages=messages,
temperature=0,
)
I faced the below error.
openai.BadRequestError: Error code: 400 -
{
"error":{
"code":"OperationNotSupported",
"message":"The chatCompletion operation does not work with the specified model, gpt-4o-mini. Please choose different model and try again. You can learn more about which models can be used with each operation here: https://go.microsoft.com/fwlink/?linkid=2197993."
}
}
The above code works fine when I change the model to "gpt-4o"
Upvotes: 1
Views: 824
Reputation: 1459
The Azure region you selected does not support this model. You need to check this list to select the appropriate region, and select the deployment type as "Standard"
Upvotes: 1