OpenaAI API Has Changed, and notebooks are broken. #3
peremartra
announced in
Announcements
Replies: 1 comment
-
All notebooks updated. If you are using Langchain to solve the compatibility issue use: !pip install --upgrade openai==0.28.1 To install a compatible OpenAI API version. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
At 07/Nov/2023 all OpenAI Notebooks are broken due some changes in the API. And all notebooks are getting the error:
AttributeError: module 'openai' has no attribute 'ChatCompletion'
I will fix it in few hours.
The old code:
response = openai.ChatCompletion.create(
model="gpt-3.5-turbo",
messages=newcontext,
temperature=0,
)
The new One:
response = openai.chat.completions.create(
model="gpt-3.5-turbo",
messages=messages,
temperature=0,
)
return (response.choices[0].message.content)
If you prefer you can update the !pip install openai to:
pip install "openai<1.0.0"
Thanks for your patience!
Beta Was this translation helpful? Give feedback.
All reactions