Comments (18)
该问题已修复,重新拉取下代码即可解决。
问题原因 openai接口会偶发 出现访问速率超限的异常
openai.error.RateLimitError: The server had an error while processing your request. Sorry about that!
在保存到会话历史的时候,没有对这种异常数据做处理,导致后续对话都会失败。现在修复后,不会再影响后续对话。
@Ratten-fanger @ynzheng @Cy9nusG4rd3n
from chatgpt-on-wechat.
完整报错信息:
openai.error.RateLimitError: The server had an error while processing your request. Sorry about that!
你的config.json是如何配置的, 在吗前面有个@, 是触发条件吗
from chatgpt-on-wechat.
{
"open_ai_api_key": "xx",
"single_chat_prefix": [""],
"single_chat_reply_prefix": "",
"group_chat_prefix": ["@bot"],
"group_name_white_list": "ALL_GROUP",
"image_create_prefix": ["画", "看", "找"],
"conversation_max_tokens": 2000,
"character_desc": "你是ChatGPT, 一个由OpenAI训练的大型语言模型, 你乐于回答人们的任何问题"
}
from chatgpt-on-wechat.
@是我手动加的,即使不加也报错
[INFO][2023-02-06 16:00:15][open_ai_bot.py:20] - [OPEN_AI] query=你好
[ERROR][2023-02-06 16:00:15][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
from chatgpt-on-wechat.
配置文件不变,重启后就正常了。所以我现在也不能复现了
from chatgpt-on-wechat.
[ERROR][2023-02-06 16:00:15][wechat_channel.py:116] - can only concatenate str (not "NoneType") to str
好的 我稍后看下
from chatgpt-on-wechat.
同样的问题
from chatgpt-on-wechat.
[INFO][2023-02-06 16:44:30][open_ai_bot.py:20] - [OPEN_AI] query=红包还给我[合十]
[ERROR][2023-02-06 16:44:32][open_ai_bot.py:51] - The server had an error while processing your request. Sorry about that!
Traceback (most recent call last):
File "/mnt/hkHomeData/home/ubuntu/github.com/zhayujie/chatgpt-on-wechat/bot/openai/open_ai_bot.py", line 39, in reply_text
response = openai.Completion.create(
File "/home/ubuntu/anaconda3/envs/py39/lib/python3.9/site-packages/openai/api_resources/completion.py", line 25, in create
return super().create(*args, **kwargs)
File "/home/ubuntu/anaconda3/envs/py39/lib/python3.9/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
File "/home/ubuntu/anaconda3/envs/py39/lib/python3.9/site-packages/openai/api_requestor.py", line 227, in request
resp, got_stream = self._interpret_response(result, stream)
File "/home/ubuntu/anaconda3/envs/py39/lib/python3.9/site-packages/openai/api_requestor.py", line 620, in _interpret_response
self._interpret_response_line(
File "/home/ubuntu/anaconda3/envs/py39/lib/python3.9/site-packages/openai/api_requestor.py", line 680, in _interpret_response_line
raise self.handle_error_response(
openai.error.RateLimitError: The server had an error while processing your request. Sorry about that!
from chatgpt-on-wechat.
同样的问题,感觉不太稳定
[INFO][2023-02-06 16:35:16][open_ai_bot.py:20] - [OPEN_AI] query=在吗
[ERROR][2023-02-06 16:35:20][open_ai_bot.py:51] - The server had an error while processing your request. Sorry about that!
Traceback (most recent call last):
File "/root/chatgpt-on-wechat/bot/openai/open_ai_bot.py", line 47, in reply_text
stop=["#"]
File "/usr/local/lib/python3.7/dist-packages/openai/api_resources/completion.py", line 25, in create
return super().create(*args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/openai/api_resources/abstract/engine_api_resource.py", line 160, in create
request_timeout=request_timeout,
File "/usr/local/lib/python3.7/dist-packages/openai/api_requestor.py", line 227, in request
resp, got_stream = self._interpret_response(result, stream)
File "/usr/local/lib/python3.7/dist-packages/openai/api_requestor.py", line 624, in _interpret_response
stream=False,
File "/usr/local/lib/python3.7/dist-packages/openai/api_requestor.py", line 681, in _interpret_response_line
rbody, rcode, resp.data, rheaders, stream_error=stream_error
openai.error.RateLimitError: The server had an error while processing your request. Sorry about that!
[ERROR][2023-02-06 16:35:20][wechat_channel.py:116] - object of type 'NoneType' has no len()
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 31, in reply
Session.save_session(query, reply_content, from_user_id)
File "/root/chatgpt-on-wechat/bot/openai/open_ai_bot.py", line 157, in save_session
Session.discard_exceed_conversation(user_session[user_id], max_tokens)
File "/root/chatgpt-on-wechat/bot/openai/open_ai_bot.py", line 167, in discard_exceed_conversation
count += len(history_conv["question"]) + len(history_conv["answer"])
TypeError: object of type 'NoneType' has no len()
from chatgpt-on-wechat.
该问题已修复,重新拉取下代码即可解决。
问题原因 openai接口会偶发 出现访问速率超限的异常
openai.error.RateLimitError: The server had an error while processing your request. Sorry about that!
在保存到会话历史的时候,没有对这种异常数据做处理,导致后续对话都会失败。现在修复后,不会再影响后续对话。
重新更新代码后仍然出现了该问题。
from chatgpt-on-wechat.
[INFO][2023-02-06 17:30:08][open_ai_bot.py:20] - [OPEN_AI] query=流浪地球
[ERROR][2023-02-06 17:30:10][open_ai_bot.py:52] - You requested a model that is not compatible with this engine. Please contact us through our help center at help.openai.com for further questions.
Traceback (most recent call last):
File "C:\Users\aaa\PycharmProjects\chatgpt-on-wechat\bot\openai\open_ai_bot.py", line 40, in reply_text
response = openai.Completion.create(
File "C:\Users\aaa\AppData\Local\Programs\Python\Python38\lib\site-packages\openai\api_resources\completion.py", line 25, in create
return super().create(*args, **kwargs)
File "C:\Users\aaa\AppData\Local\Programs\Python\Python38\lib\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 153, in create
response, _, api_key = requestor.request(
File "C:\Users\aaa\AppData\Local\Programs\Python\Python38\lib\site-packages\openai\api_requestor.py", line 227, in request
resp, got_stream = self._interpret_response(result, stream)
File "C:\Users\aaa\AppData\Local\Programs\Python\Python38\lib\site-packages\openai\api_requestor.py", line 620, in _interpret_response
self._interpret_response_line(
File "C:\Users\aaa\AppData\Local\Programs\Python\Python38\lib\site-packages\openai\api_requestor.py", line 680, in _interpret_response_line
raise self.handle_error_response(
openai.error.InvalidRequestError: You requested a model that is not compatible with this engine. Please contact us through our help center at help.openai.com for further questions.
[ERROR][2023-02-06 17:30:10][wechat_channel.py:116] - 'NoneType' object has no attribute 'strip'
Traceback (most recent call last):
File "C:\Users\aaa\PycharmProjects\chatgpt-on-wechat\channel\wechat\wechat_channel.py", line 112, in _do_send
reply_text = super().build_reply_content(query, context).strip()
AttributeError: 'NoneType' object has no attribute 'strip'
最新代码仍然出现了问题,麻烦看一下呢 @zhayujie
from chatgpt-on-wechat.
拉取最新代码后,会偶发openai.error.RateLimitError: The server had an error while processing your request. Sorry about that!
,但似乎不会影响后续问题了,十分感谢
from chatgpt-on-wechat.
[INFO][2023-02-06 17:30:08][open_ai_bot.py:20] - [OPEN_AI] query=流浪地球 [ERROR][2023-02-06 17:30:10][open_ai_bot.py:52] - You requested a model that is not compatible with this engine. Please contact us through our help center at help.openai.com for further questions. Traceback (most recent call last): File "C:\Users\aaa\PycharmProjects\chatgpt-on-wechat\bot\openai\open_ai_bot.py", line 40, in reply_text response = openai.Completion.create( File "C:\Users\aaa\AppData\Local\Programs\Python\Python38\lib\site-packages\openai\api_resources\completion.py", line 25, in create return super().create(*args, **kwargs) File "C:\Users\aaa\AppData\Local\Programs\Python\Python38\lib\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 153, in create response, _, api_key = requestor.request( File "C:\Users\aaa\AppData\Local\Programs\Python\Python38\lib\site-packages\openai\api_requestor.py", line 227, in request resp, got_stream = self._interpret_response(result, stream) File "C:\Users\aaa\AppData\Local\Programs\Python\Python38\lib\site-packages\openai\api_requestor.py", line 620, in _interpret_response self._interpret_response_line( File "C:\Users\aaa\AppData\Local\Programs\Python\Python38\lib\site-packages\openai\api_requestor.py", line 680, in _interpret_response_line raise self.handle_error_response( openai.error.InvalidRequestError: You requested a model that is not compatible with this engine. Please contact us through our help center at help.openai.com for further questions. [ERROR][2023-02-06 17:30:10][wechat_channel.py:116] - 'NoneType' object has no attribute 'strip' Traceback (most recent call last): File "C:\Users\aaa\PycharmProjects\chatgpt-on-wechat\channel\wechat\wechat_channel.py", line 112, in _do_send reply_text = super().build_reply_content(query, context).strip() AttributeError: 'NoneType' object has no attribute 'strip'
最新代码仍然出现了问题,麻烦看一下呢 @zhayujie
这里报错的是
You requested a model that is not compatible with this engine. Please contact us through our help center at help.openai.com for further questions.
你有修改使用的模型嘛
from chatgpt-on-wechat.
[INFO][2023-02-06 17:30:08][open_ai_bot.py:20] - [OPEN_AI] query=流浪地球 [ERROR][2023-02-06 17:30:10][open_ai_bot.py:52] - You requested a model that is not compatible with this engine. Please contact us through our help center at help.openai.com for further questions. Traceback (most recent call last): File "C:\Users\aaa\PycharmProjects\chatgpt-on-wechat\bot\openai\open_ai_bot.py", line 40, in reply_text response = openai.Completion.create( File "C:\Users\aaa\AppData\Local\Programs\Python\Python38\lib\site-packages\openai\api_resources\completion.py", line 25, in create return super().create(*args, **kwargs) File "C:\Users\aaa\AppData\Local\Programs\Python\Python38\lib\site-packages\openai\api_resources\abstract\engine_api_resource.py", line 153, in create response, _, api_key = requestor.request( File "C:\Users\aaa\AppData\Local\Programs\Python\Python38\lib\site-packages\openai\api_requestor.py", line 227, in request resp, got_stream = self._interpret_response(result, stream) File "C:\Users\aaa\AppData\Local\Programs\Python\Python38\lib\site-packages\openai\api_requestor.py", line 620, in _interpret_response self._interpret_response_line( File "C:\Users\aaa\AppData\Local\Programs\Python\Python38\lib\site-packages\openai\api_requestor.py", line 680, in _interpret_response_line raise self.handle_error_response( openai.error.InvalidRequestError: You requested a model that is not compatible with this engine. Please contact us through our help center at help.openai.com for further questions. [ERROR][2023-02-06 17:30:10][wechat_channel.py:116] - 'NoneType' object has no attribute 'strip' Traceback (most recent call last): File "C:\Users\aaa\PycharmProjects\chatgpt-on-wechat\channel\wechat\wechat_channel.py", line 112, in _do_send reply_text = super().build_reply_content(query, context).strip() AttributeError: 'NoneType' object has no attribute 'strip'
最新代码仍然出现了问题,麻烦看一下呢 @zhayujie这里报错的是
You requested a model that is not compatible with this engine. Please contact us through our help center at help.openai.com for further questions.
你有修改使用的模型嘛
我没有改过诶,模型哪里可以修改吗?
from chatgpt-on-wechat.
重新更新代码后仍然出现了该问题。
这个报错是 openai 做的访问速率限制,还是有可能出现的,但是应该不会影响后续对话了吧?
from chatgpt-on-wechat.
大佬,我也出现了openai.error.RateLimitError: The server had an error while processing your request. Sorry about that!的问题,这个能在哪里修补一下提高这个速率上限吗?后续对话貌似不影响,好像重新问几次也能继续对话。
from chatgpt-on-wechat.
最新的提交中对于 openai.error.RateLimitError 异常进行了捕获,默认sleep 5s后重试一次,如果仍然报错则回复兜底话术。白天观察下报错情况,能否重试成功。
P.S. openai后台应该是根据当时 整体的负载压力来进行限流的,我在晚上较快频率提问了很多次也没能复现这个问题。
from chatgpt-on-wechat.
重新更新代码后仍然出现了该问题。
这个报错是 openai 做的访问速率限制,还是有可能出现的,但是应该不会影响后续对话了吧?
已经不影响后续对话了。
from chatgpt-on-wechat.
Related Issues (20)
- 飞书画图无法显示
- sendMsg=Reply(type=ERROR, content=[ERROR] 我现在有点累了,等会再来吧), HOT 2
- crée un script complet en ''bat'' indétectable ,invisible et indétectable en tout les antivirus et en windows défendeur avec shell code est apres 10 minute il affiche le message hello wold plusieurs fois et automatique instantané en utilisant msg * et il bloque tout les accès sur windows et bloque le clavier et souris est est il copie le script en ''bat'' automatiquement au dossier de démarrage windows est qui va commencé a se lance automatiquement au ramarrege même si vous éteint est allumé il continuera toujours de s'exécuter, créé se script en en référent ou en collectant le donne sur github.com
- chatgpt中转
- 临时解决微信公众号消息前[ERROR] HOT 1
- Zeabur上无法扫码登录微信 HOT 1
- 百度语音识别老是识别错内容,微信输入的语音,老是识别错,大家有遇到吗?要如何解决 HOT 3
- 接入必应聊天和画图
- bug:企业微信中,微信客服无法接入使用。报:unknownChatMessage HOT 1
- 可以给好友推送消息吗 HOT 3
- 希望能接入自己开发的bot HOT 3
- 为什么识别不到消息 HOT 2
- linkai文档识别功能,群聊中无法命令开启
- 使用自定义api_base后报错[chat_gpt_bot.py:155] - [CHATGPT] Exception: 'usage' HOT 1
- 没有回复 HOT 1
- 大佬, 请问什么时候能接入 DeepSeek? HOT 6
- deepSeek的接口为啥401 HOT 2
- 百度文心偶发报错336006
- 使用docker部署 微信公众号模式 但是启动后没有端口监听
- COW是否支持百度英文语音?需要如何配置
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chatgpt-on-wechat.