Galagen1 / Problems-openai

I wrote the code and python gives an error
0 stars 0 forks source link

Problems-openai

I wrote the code and python gives an error

Traceback (most recent call last): File "C:\Users\GoldenСуслик\PycharmProjects\pythonProject2\main.py", line 22, in result = Atext ("Who is Elon Musk?") ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\GoldenСуслик\PycharmProjects\pythonProject2\main.py", line 9, in Atext response = openai.Completion.create( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\GoldenСуслик\AppData\Local\Programs\Python\Python311\Lib\site-packages\openai\lib_old_api.py", line 39, in call raise APIRemovedInV1(symbol=self._symbol) openai.lib._old_api.APIRemovedInV1:

You tried to access openai.Completion, 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: https://github.com/openai/openai-python/discussions/742

Process finished with exit code 1

I've tried all sorts of options and even used ChatGPT, but it didn't help me with that either.