Skip to content
site logo mobile

Forum in maintenance, we will back soon 🙂

Open AI integration...
 
Notifications
Clear all

Open AI integrations with Python

2 Posts
2 Users
2 Reactions
180 Views
(@google-solarnebula)
Posts: 5
Member
Power Member
Pythonista Prodigy Badge
Topic starter
 

Hello,

 

I was trying out the course and when I try to import open ai and run it, its showing error that its upgraded. I followed the instruction and still cannot connect my open ai into python. this is my error, even i changed the python code according to the instructions mentioned using chat gpt as i am no coder- mechanical background.

 

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 7:03 pm
SSAdvisor
(@ssadvisor)
Posts: 1065
Noble Member
Premium Member
Pythonista Prodigy Badge
Prompt Engineer
API Entrepreneur
Power 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:32 pm
Share: