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

Handle ratelimit and retry #87

Open
ccorcos opened this issue Nov 6, 2024 · 1 comment
Open

Handle ratelimit and retry #87

ccorcos opened this issue Nov 6, 2024 · 1 comment

Comments

@ccorcos
Copy link

ccorcos commented Nov 6, 2024

I'm trying with a big pdf and getting a ratelimit error:

    data: {
      error: {
        message: 'Rate limit reached for gpt-4o-mini in organization org-zt8czUs8Thn5aBD4n2Jf1kve on tokens per min (TPM): Limit 200000, Used 198414, Requested 2829. Please try again in 372ms. Visit https://platform.openai.com/account/rate-limits to learn more.',
        type: 'tokens',
        param: null,
        code: 'rate_limit_exceeded'
      }
    }
  },
  status: 429
}

It would be nice if (1) this library would handle those rate limits and (2) it would return intermediate results or something so that I can save results of past pages and keep going when thigns crash or error like this.

Thanks for the help!

@tylermaran
Copy link
Contributor

Hey @ccorcos. Good suggestion.

I'd have to think through the ideal response object here. It would need to return some sort of error code as well to let you know that it was giving back a partial response.

@ccorcos ccorcos closed this as completed Nov 14, 2024
@ccorcos ccorcos reopened this Nov 14, 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

2 participants