Forum in maintenance, we will back soon 🙂
I'll facing error while running the code
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.
Try running the following command:
pip install openai==0.28
Try updating the library using this command:
pip install --upgrade openai
@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
as @husein-aboul-hasan mentioned, you can install the old version, or use the updated package with:
openai.chat.completions
@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