openai version : 1.1.1
Python : 3.11
model : gpt-3.5-turbo
Secret key etc setup done .
While running the basic example code by the trainer , I am getting error about attribute Chatcompletion not found
AttributeError Traceback (most recent call last)
Cell In[3], line 18
1 text = f"“”
2 You should express what you want a model to do by \
3 providing instructions that are as clear and \
(…)
11 more detailed and relevant outputs.
12 “”"
13 prompt = f"“”
14 Summarize the text delimited by triple backticks \
15 into a single sentence.
16 {text}
17 “”"
—> 18 response = get_completion(prompt)
19 print(response)
Cell In[2], line 3, in get_completion(prompt, model)
1 def get_completion(prompt, model=“gpt-3.5-turbo”):
2 messages = [{“role”: “user”, “content”: prompt}]
----> 3 response = openai.ChatCompletion.create(
4 model=model,
5 messages=messages,
6 temperature=0, # this is the degree of randomness of the model’s output
7 )
8 return response.choices[0].message[“content”]
AttributeError: module ‘openai’ has no attribute ‘ChatCompletion’