I have some problems with my Azure Openai..
When i use my second Recource Group in westus (my first one is germany), i always get the folowing error:
Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}
My quick and dirty python code:
from openai import AzureOpenAI
client = AzureOpenAI(
azure_endpoint = "https://XXXX.openai.azure.com/",
api_key="XXXXX",
api_version="2024-05-13"
)
message_text = [{"role":"system","content":"You are an AI assistant that helps people find information."},{"role":"user","content":"Was ist 4x6?"}]
completion = client.chat.completions.create(
model="GPT-4o", # model = "deployment_name"
messages = message_text,
temperature=0.7,
max_tokens=800,
top_p=0.95,
frequency_penalty=0,
presence_penalty=0,
stop=None
)
print(completion.choices[0].message.content)
Bild von Model Deployment:
Model Deployment
I already checked double network, api and endpoint.
In my first recource group the code work and in second doesent.
I want to use us west because there are always the new models like gpt-4o.
best regards
I already checked double network, api and endpoint. In my first recource group the code work and in second doesent.
I want to use us west because there are always the new models like gpt-4o.
2
Answers
when i click on playground --> show code --> python.
it shows me only a example code:
thx for the link and your help (https://learn.microsoft.com/en-us/azure/ai-services/openai/reference)
best regards
The error is because of api version you are using.
The version given
2024-05-13
is model version and not the api version.Use the api version
2024-02-15-preview
it works.Code in