Skip to content

Forum in maintenance, we will back soon 🙂

OpenAI API intergra...
 
Notifications
Clear all

OpenAI API intergration in Python

3 Posts
3 Users
0 Reactions
387 Views
(@google-solarnebula)
Posts: 5
Member
Topic starter
 

I was following the course create AI tools and other courses where I need to install open ai in pythong to run the prompt. I have followed it and I always get the error and I tried chatgpt for help and watched videos, followed the steps that mentioned. but it is not resolving as i am not a coder and came from mechanical background. This is the error...

 

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: https://github.com/openai/openai-python/discussions/742   

 
Posted : 01/17/2024 6:56 pm
Topic Tags
SSAdvisor
(@ssadvisor)
Posts: 1139
Noble Member
 

@google-solarnebula yes, the openai module has been upgraded. You can use the previous version with

pip install --upgrade openai==0.28

which will work with the course code or you can update the course libraries by downloading the zip file at

https://github.com/hassancs91/PE-Course-codes

which contains the updated code for the new version of the openai module.

Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack

 
Posted : 01/17/2024 7:41 pm
Hasan Aboul Hasan
(@admin)
Posts: 1276
Member Admin
 

yeah, please get the updated codes as openAI updated their packages

 
Posted : 01/20/2024 8:57 am
Share:
[the_ad_group id="312"]