ChatGPT-API-Basics icon indicating copy to clipboard operation
ChatGPT-API-Basics copied to clipboard

The code Fails With Error

Open grabani opened this issue 1 year ago • 2 comments

Hi There,

I have tried several options to resolve the code failure (including using ChatGPT). Running the code as is I get the error:

AttributeError: module 'openai' has no attribute 'ChatCompletion'

Essentailly ChatGPT says that I should use:

completion = openai.Completion.create(

But that doesn't work either.

image

I then asked for more help:

image

It finaaly suggsted:

image

But that didn't work either.

Any suggetsions?

grabani avatar Apr 03 '23 16:04 grabani

The issue was caused by me using openai v0.8. I upgraded to the latest version which solved the problem.

grabani avatar Apr 05 '23 12:04 grabani

The issue was caused by me using openai v0.8. I upgraded to the latest version which solved the problem.

You might want to refer to the pull request so it always get the latest version of the library. Cheers

iMiebaka avatar Oct 05 '23 11:10 iMiebaka