Skip to content

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

@Blatzheim

Description

@Blatzheim

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
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions