Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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. #2773

Open
zollty opened this issue Dec 5, 2023 · 4 comments

Comments

@zollty
Copy link
Contributor

zollty commented Dec 5, 2023

ERROR: APIRemovedInV1: 获取ChatCompletion时出错:when run \fastchat\serve\api_provider.py:

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

my openapi sdk version is
root@ub1:# pip list | grep openai
openai 1.2.3

it's because the new major version of the OpenAI SDK](openai/openai-python#742) that was unleashed in early November 2023.

@infwinston
Copy link
Member

@zollty thanks for reporting this issue. We have an ongoing PR #2765 to resolve it. Could you help us test it?

@XingchenMengxiang
Copy link

@zollty thanks for reporting this issue. We have an ongoing PR #2765 to resolve it. Could you help us test it?

Is this available in the latest version?

@mpetruc
Copy link

mpetruc commented Dec 13, 2023

@infwinston i'm on fschat ==0.2.34 and openai==1.3.9. Same issue.
Do i need to go back to openai==0.28? Thank you

@infwinston
Copy link
Member

yes you need to temporarily use 0.28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants