Unable to run code

In the course “ChatGPT Prompt Engineering for Developers” , Chapter : Guidelines,
Im unable to run the following code:`

response = get_completion(prompt)
print(response)

Error:

APIRemovedInV1: 

You tried to access openai.ChatCompletion, but this is no longer supported in openai>=1.0.0 

Currently im using the 0.28 version.

Name: openai
Version: 0.28.0
Summary: Python client library for the OpenAI API
Home-page: https://github.com/openai/openai-python
Author: OpenAI
Author-email: support@openai.com

Kindly help me out.

Hi @ell

Are you trying to run locally?

yes.

Don’t forget that this short courses are in a Beta stage, so some errors might occur.

For short, it wasn’t design to run locally.

But, if you intend to run locally, you have to install all the packages by your own, setup your API credentials and download the available files if they exist.

To download extra files you can follow:

  1. Click on the jupyter notebook logo on the top left
  2. Chose the file and download it
  3. Keep all the files on your main folder envirioment.

I hope this help.

Best regards

Sure. Thanks for the Help.

Merry Christmas.

1 Like

You welcome.

Happy holidays!

openai.ChatCompletion is no longer supported in openai>=1.0.0

1 Like

Hi @Jomsborg

Welcome to the community.

Thanks for your contribution

1 Like