Binary-Bytes / Auto-YouTube-Shorts-Maker

Automatically generate youtube shorts easily with this simple script!
273 stars 45 forks source link

openai chatcompletions not supported #4

Closed Jesper09038 closed 7 months ago

Jesper09038 commented 8 months ago

Hi, I believe the code is outdated by now because OpenAI decided to stop supporting openai.completion this is the result I get: `Enter the name of the video > 5 fun facts Do you want AI to generate content? (yes/no) > yes

Enter the theme of the video > 5 fun facts Traceback (most recent call last): File "c:\Users\Jesper\OneDrive\Documenten\GitHub\Auto-YouTube-Shorts-Maker\shorts.py", line 21, in response = openai.Completion.create( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Jesper\AppData\Local\Programs\Python\Python312\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`

xdrushxd commented 8 months ago

Running openai migrate does not work.

With this tool you could upgrade the prject to use the new version.

Binary-Bytes commented 8 months ago

Thanks, I was made aware of this issue a few days ago... I'll try to resolve it in a few days when I get some time. Thanks for the interest in this project.

Binary-Bytes commented 7 months ago

OpenAI installation is pinned to v0.27.8 in the requirements.txt file + updated OpenAI model to gpt-3.5-turbo-instruct since text-davinci-003 was depricated.