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

对于rate limit的处理 #15

Open
JamesFlare1212 opened this issue Jun 20, 2023 · 1 comment
Open

对于rate limit的处理 #15

JamesFlare1212 opened this issue Jun 20, 2023 · 1 comment

Comments

@JamesFlare1212
Copy link
Contributor

今天又测试了一下,发现缺少对Claude API rate_limit_error 的处理,没记错OpenAI 报错会发一个message之类的信息,里面就可以写上rate limit,或者我记得官方就有rate limit error来着。

我的想法是,当探测到返回字段是:

{"error":{"type":"rate_limit_error","message":"Number of concurrent connections to Claude exceeds your rate limit. Please try again, or contact sales@anthropic.com to discuss your options for a rate limit increase."}}

的时候,就构造一个message返回,或者429报错。

此外,Claude给的免费API的rate是1秒一次,未来能否搞一个排队之类的功能。

@jtsang4
Copy link
Owner

jtsang4 commented Jun 20, 2023

很好的想法!感觉可以加一下。不过我最近很可能没时间处理,也欢迎 PR 哈

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