Skip to content
site logo mobile

Forum in maintenance, we will back soon 🙂

I'll facing error w...
 
Notifications
Clear all

I'll facing error while running the code

6 Posts
5 Users
7 Likes
327 Views
(@ali16)
Posts: 1
New Member
Topic starter
 

Asslamualaikum Brother, I encountered an error while running the OpenAI API for a chat application. The error message I received is 'APIRemovedInV1: '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/74 2', I've attempted troubleshooting steps, but haven't been successful. Could you offer any insights or tips on how to resolve this issue? I greatly appreciate your content and any help you can provide. Thank you!" This approach is concise, acknowledges their expertise, and clearly outlines the problem, making it more likely for them to respond and offer assistance.

 

 
Posted : 01/07/2024 3:12 am
(@husein)
Posts: 265
Member Moderator
Premium Member
Prompt Engineer
Pythonista Prodigy Badge
API Entrepreneur
Power Member
 

Try running the following command:

pip install openai==0.28

 
Posted : 01/07/2024 11:30 am
(@yasser-helbawi)
Posts: 6
Active Member Customer
Premium Member
Pythonista Prodigy Badge
Prompt Engineer
Power Member
 

Try updating the library using this command:

pip install --upgrade openai
 
Posted : 01/07/2024 6:27 pm
Kazi supti reacted
SSAdvisor
(@ssadvisor)
Posts: 924
Noble Member
Premium Member
Pythonista Prodigy Badge
Prompt Engineer
API Entrepreneur
Power Member
 

@yasser-helbawi this won't stop the error. What @Husein stated rolls back to the version containing the now missing class.

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

 
Posted : 01/08/2024 1:49 am
Hasan Aboul Hasan
(@admin)
Posts: 955
Member Admin
Premium Member
Pythonista Prodigy Badge
Prompt Engineer
API Entrepreneur
Power Member
 

as @husein-aboul-hasan mentioned, you can install the old version, or use the updated package with:

openai.chat.completions
 
Posted : 01/10/2024 9:07 am
SSAdvisor
(@ssadvisor)
Posts: 924
Noble Member
Premium Member
Pythonista Prodigy Badge
Prompt Engineer
API Entrepreneur
Power Member
 

@ubab your post doesn't give us any information with regard to the subject. Please add to the comment within the context of this post so that it isn't spammish.

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

 
Posted : 02/15/2024 2:37 pm
Share: