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

[Bug]: "openai.ChatCompletion is no longer supported" in "chat_with_your_documents" example #1640

Closed
nicolasgere opened this issue Jan 16, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@nicolasgere
Copy link
Contributor

What happened?

When running the example "chat_with_your_documents", an error occurs due to openapi.ChatCompletion being deprecated.

Versions

chroma latest, python 3.10

Relevant log output

Traceback (most recent call last):
  File "/Users/nicolas/Projects/chroma/examples/chat_with_your_documents/main.py", line 139, in <module>
    main(
  File "/Users/nicolas/Projects/chroma/examples/chat_with_your_documents/main.py", line 109, in main
    response = get_chatGPT_response(query, results["documents"][0], model_name)  # type: ignore
  File "/Users/nicolas/Projects/chroma/examples/chat_with_your_documents/main.py", line 55, in get_chatGPT_response
    response = openai.ChatCompletion.create(
  File "/Users/nicolas/.pyenv/versions/3.10.13/lib/python3.10/site-packages/openai/lib/_old_api.py", line 39, in __call__
    raise APIRemovedInV1(symbol=self._symbol)
openai.lib._old_api.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/742
@nicolasgere nicolasgere added the bug Something isn't working label Jan 16, 2024
@nicolasgere nicolasgere self-assigned this Jan 16, 2024
nicolasgere added a commit that referenced this issue Jan 17, 2024
## Description of changes
- Update openai call to use the new api (#1640 )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant