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)
- 最新版Docker无法正常运行 HOT 4
- gpt-4o提示不存在 HOT 6
- 可以支持百川大模型吗? HOT 1
- 群聊场景下机器人无法识别聊天主体 HOT 1
- 语音回复 HOT 1
- GPT-4o返回的图片是webp格式,微信端无法正确显示,需要进行格式转化优化。 HOT 2
- 项目的docker方式存在一个必定卡死的BUG HOT 1
- 开发大佬们,项目有没有办法获取本地时间并能与提示词提交给大模型 HOT 2
- 服务时间限制代码的逻辑问题 HOT 1
- COW 是否有支持的英文插件,回复英文信息的,如果有是否可以提供一下,感谢。 HOT 1
- 微信扫码登录错误 HOT 6
- tag:1.6.5,model填: gpt-4o,无法使用 HOT 1
- 目前gpt返回的内容有可能出现markdown标签,是否能做个插件过滤处理掉这些markdown格式呢 HOT 1
- ollama做api后端 HOT 6
- 大佬,请问我在调用 fastgpt的时候,在回复的内容里面是含有图片的,请问如何在 cow 里面修改微信回复的时候,首先发送文本处理内容,然后发送相关的图片,谢谢 HOT 1
- [finish.py:23] - [Finish] inited 然后就一直卡在这里,不动了。 HOT 3
- 可以支持WhatsApp吗 HOT 1
- nas docker 部署 错误码1101 HOT 1
- 请问,不能接入自定义,本地微调后的模型吗?比如LLaMa3 HOT 2
- 使用fastgpt知识库apikey和接口,通过cow接入企微,机器人回复文字正常图片显示的是 HOT 1
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.