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

reliableGPT-0.2.953 errors #21

Open
WenchenLi opened this issue Jun 30, 2023 · 2 comments
Open

reliableGPT-0.2.953 errors #21

WenchenLi opened this issue Jun 30, 2023 · 2 comments
Assignees

Comments

@WenchenLi
Copy link

init like this:

reliableGPT(
  openai.ChatCompletion.create, 
  user_email=user_email,
  # user_token=token,
  fallback_strategy=['text-davinci-003', 'gpt-3.5-turbo','text-davinci-003'],
  queue_requests=True,)

and got errors like below from today.

Traceback (most recent call last):
  File "/******/python3.11/site-packages/openai/openai_object.py", line 59, in __getattr__
    return self[k]
           ~~~~^^^
KeyError: 'message'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  
    reply = chat.choices[0].message.content
            ^^^^^^^^^^^^^^^^^^^^^^^
  File ********/lib/python3.11/site-packages/openai/openai_object.py", line 61, in __getattr__
    raise AttributeError(*err.args)
AttributeError: message
@krrishdholakia
Copy link
Contributor

It looks like it gracefully failed and returned a string, which is causing this error. @WenchenLi would you rather we return a string or just return the openai error if we are unable to handle it?

@krrishdholakia krrishdholakia self-assigned this Jul 1, 2023
@krrishdholakia
Copy link
Contributor

Actually - my bad @WenchenLi , since the error is in 'messages' - it looks like you did receive a response. Since your fallback strategy is text-davinci-003 I believe the response format is different (from OpenAI) causing this issue. Might make sense to reformat it, to fit the chatgpt paradigm to prevent errors and ensure it returns a response

cc: @ishaan-jaff

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

2 participants