Skip to content

Resolve OpenAI throttling #334

Description

@LeMurphant

We are getting some rate-limiting errors in the stampy-error-log discord channel

  File "/home/rob/miniconda3/envs/stampy/lib/python3.9/site-packages/openai/api_requestor.py", line 765, in _interpret_response_line
    raise self.handle_error_response(
openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/rob/stampy/servicemodules/discord.py", line 239, in on_message
    new_response = await top_response.callback(
  File "/home/rob/stampy/modules/gpt3module.py", line 198, in gpt3_chat
    response = self.openai.get_response(engine, prompt, logit_bias)
  File "/home/rob/stampy/api/openai.py", line 144, in get_response
    if self.is_text_risky(prompt):
  File "/home/rob/stampy/api/openai.py", line 110, in is_text_risky
    self.log_error(self.class_name, "OpenAI Rate Limit Exceeded", e, warning=True)
TypeError: log_error() got multiple values for argument 'warning'

I accessed the OAI console found that we were getting throttled whenever requests exceeded 0.01$/day. Surprisingly, there seemed to be no API key set. I added one for another use, but I'm wondering if there used to be a key for the stampy bot and it expired. Can somebody with access to the VM that actually runs stampy check the key it's using? It should be at ~/.openaikey

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

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