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

Incorrect Reference to OpenAIError in backoff Decorator Causes Failed Import #34

Open
Blatzheim opened this issue Oct 17, 2024 · 0 comments

Comments

@Blatzheim
Copy link

Blatzheim commented Oct 17, 2024

In chatgpt.py, the backoff decorator for the chat function is incorrectly referencing openai.error.OpenAIError, which causes a ModuleNotFoundError as there appears to be no openai.error submodule. The way it worked for me was to reference OpenAI's error handling is directly through openai.OpenAIError.

python v3.10.15
openai v1.51.2
graph-of-thoughts v0.0.2

Steps to reproduce:

  1. Ensure versions match (see below).
  2. run the python interpreter and try to import chatgpt.py e.g. via the controller: from graph_of_thoughts import controller

Before:

@backoff.on_exception(
    backoff.expo, openai.error.OpenAIError, max_time=10, max_tries=6
)

Solution:

@backoff.on_exception(
    backoff.expo, openai.OpenAIError, max_time=10, max_tries=6
)
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

1 participant