-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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
openai.error.RateLimitError 限流问题 #50
Comments
完整报错信息:
你的config.json是如何配置的, 在吗前面有个@, 是触发条件吗 |
{ |
@是我手动加的,即使不加也报错 |
配置文件不变,重启后就正常了。所以我现在也不能复现了 |
好的 我稍后看下 |
同样的问题 |
[INFO][2023-02-06 16:44:30][open_ai_bot.py:20] - [OPEN_AI] query=红包还给我[合十] |
该问题已修复,重新拉取下代码即可解决。 问题原因 openai接口会偶发 出现访问速率超限的异常
在保存到会话历史的时候,没有对这种异常数据做处理,导致后续对话都会失败。现在修复后,不会再影响后续对话。 |
重新更新代码后仍然出现了该问题。 |
[INFO][2023-02-06 17:30:08][open_ai_bot.py:20] - [OPEN_AI] query=流浪地球 最新代码仍然出现了问题,麻烦看一下呢 @zhayujie |
拉取最新代码后,会偶发openai.error.RateLimitError: The server had an error while processing your request. Sorry about that! |
这里报错的是
你有修改使用的模型嘛 |
我没有改过诶,模型哪里可以修改吗? |
这个报错是 openai 做的访问速率限制,还是有可能出现的,但是应该不会影响后续对话了吧? |
大佬,我也出现了openai.error.RateLimitError: The server had an error while processing your request. Sorry about that!的问题,这个能在哪里修补一下提高这个速率上限吗?后续对话貌似不影响,好像重新问几次也能继续对话。 |
最新的提交中对于 openai.error.RateLimitError 异常进行了捕获,默认sleep 5s后重试一次,如果仍然报错则回复兜底话术。白天观察下报错情况,能否重试成功。 P.S. openai后台应该是根据当时 整体的负载压力来进行限流的,我在晚上较快频率提问了很多次也没能复现这个问题。 |
已经不影响后续对话了。 |
[INFO][2023-02-06 15:49:21][open_ai_bot.py:20] - [OPEN_AI] query=@在吗
[ERROR][2023-02-06 15:49:21][wechat_channel.py:116] - can only concatenate str (not "NoneType") to str
Traceback (most recent call last):
File "/root/chatgpt-on-wechat/channel/wechat/wechat_channel.py", line 112, in _do_send
reply_text = super().build_reply_content(query, context).strip()
File "/root/chatgpt-on-wechat/channel/channel.py", line 31, in build_reply_content
return Bridge().fetch_reply_content(query, context)
File "/root/chatgpt-on-wechat/bridge/bridge.py", line 9, in fetch_reply_content
return bot_factory.create_bot("openAI").reply(query, context)
File "/root/chatgpt-on-wechat/bot/openai/open_ai_bot.py", line 26, in reply
new_query = Session.build_session_query(query, from_user_id)
File "/root/chatgpt-on-wechat/bot/openai/open_ai_bot.py", line 129, in build_session_query
prompt += "Q: " + conversation["question"] + "\n\n\nA: " + conversation["answer"] + "<|im_end|>\n"
TypeError: can only concatenate str (not "NoneType") to str
The text was updated successfully, but these errors were encountered: