Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1-introduction.ipynb - openai.ChatCompletion no longer supported in openai>=1.0.0 #160

Closed
Jasperb3 opened this issue Nov 10, 2023 · 2 comments · Fixed by #163
Closed

1-introduction.ipynb - openai.ChatCompletion no longer supported in openai>=1.0.0 #160

Jasperb3 opened this issue Nov 10, 2023 · 2 comments · Fixed by #163
Assignees

Comments

@Jasperb3
Copy link

Describe the bug
1-introduction.ipynb fails to run Exercise 2 with the following error message:

APIRemovedInV1:

You tried to access openai.ChatCompletion, but this is no longer supported in openai>=1.0.0 - see the README at https://github.com/openai/openai-python for the API.

You can run openai migrate to automatically upgrade your codebase to use the 1.0.0 interface.

Alternatively, you can pin your installation to the old version, e.g. pip install openai==0.28

A detailed migration guide is available here: openai/openai-python#742

To Reproduce
Steps to reproduce the behavior:

  1. Install locally or on codespace
  2. Run 1-introduction.ipynb in VS Code
  3. Complete Exercise 1 successfully
  4. Error on Exercise 2

Expected behavior
OpenAI API key to be set up

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows 11
  • Conda environment
  • openai==1.2.2
Copy link

👋 Thanks for contributing @Jasperb3! We will review the issue and get back to you soon.

@leestott
Copy link
Collaborator

Fix applied in #163

The Devcontainer and codespaces environment should run a post installation after the installation and install python libraries listed in requirements.txt

Requirements
ipywidgets==7.7.1
matplotlib==3.7.0
numpy==1.24.2
pandas==1.5.3
tqdm==4.64.0
python-dotenv==1.0.0
openai>=0.28.0
tiktoken

@github-actions github-actions bot locked and limited conversation to collaborators Nov 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants