I use python code to call ChatGPT deployed model via API and get proper response for GPT-turbo and GPT-4. But when I used same code for Chat GPT4O, it gives error openai.NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}
Sample code is as below, please suggest how can I get it working with gpt-4o?
import os
from openai import AzureOpenAI
client = AzureOpenAI(
api_key="xxxxxxxxxxxxxxx",
api_version="2024-05-13",
azure_endpoint = "https://xxxxxxx.openai.azure.com/"
)
deployment_name='gpt-4o' #This will correspond to the custom name you chose for your deployment when you deployed a model.
# client = AzureOpenAI(
# api_key="XXXXXXXXXXXXXXXXXX",
# api_version="XXXX-02-01",
# azure_endpoint = "https://xxxxxxxxxxxxx.openai.azure.com/"
# )
# deployment_name='gpt-35-turbo' #This will correspond to the custom name you chose for your deployment when you deployed a model..
# Send a completion call to generate an answer
print('Sending a test completion job')
start_phrase = 'Write a tagline for an ice cream shop. '
response = client.completions.create(model=deployment_name, prompt=start_phrase, max_tokens=10)
print(start_phrase+response.choices[0].text)