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.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 39.5k
- Forks
- 4.8k
- PR merge metrics
- No merged PRs in 30d
Description
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](https://github.com/openai/openai-python/discussions/742) that was unleashed in early November 2023.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading fastchat/serve/api_provider.py and reproduce the failure with openai 1.2.3. Compare the OpenAI SDK usage there with the migration guidance linked in the issue, then run the relevant serving or provider tests. Done means the OpenAI provider no longer raises APIRemovedInV1 with the supported SDK version.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100