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

Anthropic should backoff for http 429 responses #70

Open
michaelneale opened this issue Sep 30, 2024 · 0 comments
Open

Anthropic should backoff for http 429 responses #70

michaelneale opened this issue Sep 30, 2024 · 0 comments

Comments

@michaelneale
Copy link
Collaborator

It's not uncommon to get this:

httpx.HTTPStatusError: Client error '429 Too Many Requests' for url 'https://api.anthropic.com/v1/messages'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429
{"type":"error","error":{"type":"rate_limit_error","message":"Number of request tokens has exceeded your per-minute rate limit 
(https://docs.anthropic.com/en/api/rate-limits); see the response headers for current usage. Please reduce the prompt length or the maximum tokens requested, or
try again later. You may also contact sales at https://www.anthropic.com/contact-sales to discuss your options for a rate limit increase."}}

  File "/Users/micn/Documents/code/goose/.venv/lib/python3.12/site-packages/exchange/providers/anthropic.py", line 158, in _post
    return raise_for_status(response).json()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/micn/Documents/code/goose/.venv/lib/python3.12/site-packages/exchange/providers/utils.py", line 35, in raise_for_status
    raise httpx.HTTPStatusError(f"{e}\n{response.text}", request=e.request, response=e.response)

Ideally would do a sensible backoff for this or slow down when running

codefromthecrypt pushed a commit to codefromthecrypt/exchange that referenced this issue Oct 13, 2024
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