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:
- Ensure versions match (see below).
- 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
)