Hello
I am using openai v1(0.28.1) because my application has dependency on pydantic v1… so I cannot migrate to openai v2…
with the code underneath
sometimes it works and sometimes it doesn’t
it responds with this error - Must provide an 'engine' or 'deployment_id' parameter to create a <class 'openai.api_resources.chat_completion.ChatCompletion'>
I thought it was because of my openai key? because testing with other openai keys it seems to work
what should I check? and what may be the problem?
import openai
openai.api_key="sk-********"
body = {
"model": "gpt-4o-2024-05-13",
"messages": [
{
"role": "system",
"content": 'Here is who you are:\nYou are a chatbot who only answer questions about a company policy and work guideline in json format.\n',
},
{
"role": "user",
"content": '"user query:"""What can\'t be infringed even if you limit your basic rights?""""',
},
],
"temperature": 0,
"max_tokens": 1000,
"top_p": 1,
"frequency_penalty": 0,
"presence_penalty": 0,
"response_format": {"type": "json_object"},
}
response = openai.ChatCompletion.create(**body)