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

[BUG] 加入百度云审核就出现这个 #862

Closed
2 of 3 tasks
renxiaolei99 opened this issue May 22, 2023 · 7 comments
Closed
2 of 3 tasks

[BUG] 加入百度云审核就出现这个 #862

renxiaolei99 opened this issue May 22, 2023 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@renxiaolei99
Copy link

renxiaolei99 commented May 22, 2023

提交 issue 前,请先确认:

  • 我已看过 FAQ,此问题不在列表中
  • 我已看过其他 issue,他们不能解决我的问题
  • 我认为这不是 Mirai 或者 OpenAI 的 BUG

表现
描述 BUG 的表现情况

加入百度云审核就出现这个
/
QQ截图20230522103653
QQ截图20230522103949

@renxiaolei99 renxiaolei99 added the bug Something isn't working label May 22, 2023
@lss233
Copy link
Owner

lss233 commented May 22, 2023

看样子是没处理错误信息

@renxiaolei99
Copy link
Author

看样子是没处理错误信息

我直接复制过去的!

@Haibersut
Copy link
Collaborator

之前测试的时候模拟不了qps上限,现在知道了,感谢,之后的版本会修改

但是实际上不应该触发qps限制(百度云免费给的是每秒一次),你能具体告诉我你配置了什么吗

@liu2-3zhi
Copy link
Contributor

liu2-3zhi commented Jun 24, 2023

我也出现了这个问题

chatgpt-qq-gocqhttp-1 | [2023-06-24 12:06:39] [INFO]: 收到好友 异端(手动打码) 的消息: 你好 (手动打码2)
chatgpt-qq-chatgpt-1 | 2023-06-24 04:06:39.253 | DEBUG | platforms.onebot_bot:_:148 - 私聊消息:你好
chatgpt-qq-chatgpt-1 | 2023-06-24 04:06:39.962 | DEBUG | middlewares.concurrentlock:handle_request:40 - [Concurrent] 排队中,前面还有 0 个人!
chatgpt-qq-chatgpt-1 | 2023-06-24 04:06:39.962 | DEBUG | middlewares.concurrentlock:handle_request:42 - [Concurrent] 排到了!
chatgpt-qq-chatgpt-1 | 2023-06-24 04:06:39.963 | DEBUG | middlewares.timeout:create_timeout_task:55 - [Timeout] 开始计时……
chatgpt-qq-chatgpt-1 | 2023-06-24 04:06:43.083 | DEBUG | adapter.chatgpt.api:ask:103 - [ChatGPT-API:gpt-3.5-turbo] 响应:你好,有什么可以帮助您的吗?
chatgpt-qq-chatgpt-1 | 2023-06-24 04:06:43.083 | DEBUG | adapter.chatgpt.api:ask:104 - 使用 token 数:36
chatgpt-qq-chatgpt-1 | 2023-06-24 04:06:43.279 | ERROR | universal:handle_message:295 - 'conclusion'
chatgpt-qq-chatgpt-1 | Traceback (most recent call last):
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/app/bot.py", line 54, in
chatgpt-qq-chatgpt-1 | loop.run_until_complete(asyncio.gather(*bots))
chatgpt-qq-chatgpt-1 | │ │ │ │ └ [<Task pending name='Task-2' coro=<start_task() running at /app/platforms/onebot_bot.py:356> wait_for=<_GatheringFuture pendi...
chatgpt-qq-chatgpt-1 | │ │ │ └ <function gather at 0x7fe8a8e745e0>
chatgpt-qq-chatgpt-1 | │ │ └ <module 'asyncio' from '/usr/local/lib/python3.11/asyncio/init.py'>
chatgpt-qq-chatgpt-1 | │ └ <function BaseEventLoop.run_until_complete at 0x7fe8a8e853a0>
chatgpt-qq-chatgpt-1 | └ <_UnixSelectorEventLoop running=True closed=False debug=False>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.11/asyncio/base_events.py", line 640, in run_until_complete
chatgpt-qq-chatgpt-1 | self.run_forever()
chatgpt-qq-chatgpt-1 | │ └ <function BaseEventLoop.run_forever at 0x7fe8a8e85300>
chatgpt-qq-chatgpt-1 | └ <_UnixSelectorEventLoop running=True closed=False debug=False>
chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.11/asyncio/base_events.py", line 607, in run_forever
chatgpt-qq-chatgpt-1 | self._run_once()
chatgpt-qq-chatgpt-1 | │ └ <function BaseEventLoop._run_once at 0x7fe8a8e87100>
chatgpt-qq-chatgpt-1 | └ <_UnixSelectorEventLoop running=True closed=False debug=False>
chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1922, in _run_once
chatgpt-qq-chatgpt-1 | handle._run()
chatgpt-qq-chatgpt-1 | │ └ <function Handle._run at 0x7fe8a93e0040>
chatgpt-qq-chatgpt-1 | └ <Handle Task.task_wakeup()>
chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.11/asyncio/events.py", line 80, in _run
chatgpt-qq-chatgpt-1 | self._context.run(self._callback, *self._args)
chatgpt-qq-chatgpt-1 | │ │ │ │ │ └ <member '_args' of 'Handle' objects>
chatgpt-qq-chatgpt-1 | │ │ │ │ └ <Handle Task.task_wakeup()>
chatgpt-qq-chatgpt-1 | │ │ │ └ <member '_callback' of 'Handle' objects>
chatgpt-qq-chatgpt-1 | │ │ └ <Handle Task.task_wakeup()>
chatgpt-qq-chatgpt-1 | │ └ <member '_context' of 'Handle' objects>
chatgpt-qq-chatgpt-1 | └ <Handle Task.task_wakeup()>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/app/platforms/onebot_bot.py", line 151, in _
chatgpt-qq-chatgpt-1 | await handle_message(
chatgpt-qq-chatgpt-1 | └ <function handle_message at 0x7fe8619af6a0>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | > File "/app/universal.py", line 269, in handle_message
chatgpt-qq-chatgpt-1 | await action(session_id, message.strip(), conversation_context, respond)
chatgpt-qq-chatgpt-1 | │ │ │ │ │ └ <function handle_message..respond at 0x7fe861a05b20>
chatgpt-qq-chatgpt-1 | │ │ │ │ └ None
chatgpt-qq-chatgpt-1 | │ │ │ └ <method 'strip' of 'str' objects>
chatgpt-qq-chatgpt-1 | │ │ └ '你好'
chatgpt-qq-chatgpt-1 | │ └ 'friend-手动打码'
chatgpt-qq-chatgpt-1 | └ <function handle_message..wrap_request..call at 0x7fe861a06c00>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/app/universal.py", line 53, in call
chatgpt-qq-chatgpt-1 | await m.handle_request(session_id, message, respond, conversation_context, n)
chatgpt-qq-chatgpt-1 | │ │ │ │ │ │ └ <function handle_message..wrap_request..call at 0x7fe861a06b60>
chatgpt-qq-chatgpt-1 | │ │ │ │ │ └ None
chatgpt-qq-chatgpt-1 | │ │ │ │ └ <function handle_message..respond at 0x7fe861a05b20>
chatgpt-qq-chatgpt-1 | │ │ │ └ '你好'
chatgpt-qq-chatgpt-1 | │ │ └ 'friend-手动打码'
chatgpt-qq-chatgpt-1 | │ └ <function MiddlewareConcurrentLock.handle_request at 0x7fe8619dd8a0>
chatgpt-qq-chatgpt-1 | └ <middlewares.concurrentlock.MiddlewareConcurrentLock object at 0x7fe8619db4d0>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/app/middlewares/concurrentlock.py", line 43, in handle_request
chatgpt-qq-chatgpt-1 | await action(session_id, prompt, conversation_context, respond)
chatgpt-qq-chatgpt-1 | │ │ │ │ └ <function handle_message..respond at 0x7fe861a05b20>
chatgpt-qq-chatgpt-1 | │ │ │ └ None
chatgpt-qq-chatgpt-1 | │ │ └ '你好'
chatgpt-qq-chatgpt-1 | │ └ 'friend-手动打码'
chatgpt-qq-chatgpt-1 | └ <function handle_message..wrap_request..call at 0x7fe861a06b60>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/app/universal.py", line 53, in call
chatgpt-qq-chatgpt-1 | await m.handle_request(session_id, message, respond, conversation_context, n)
chatgpt-qq-chatgpt-1 | │ │ │ │ │ │ └ <function handle_message..wrap_request..call at 0x7fe861a06ac0>
chatgpt-qq-chatgpt-1 | │ │ │ │ │ └ None
chatgpt-qq-chatgpt-1 | │ │ │ │ └ <function handle_message..respond at 0x7fe861a05b20>
chatgpt-qq-chatgpt-1 | │ │ │ └ '你好'
chatgpt-qq-chatgpt-1 | │ │ └ 'friend-手动打码'
chatgpt-qq-chatgpt-1 | │ └ <function Middleware.handle_request at 0x7fe8619dccc0>
chatgpt-qq-chatgpt-1 | └ <middlewares.baiducloud.MiddlewareBaiduCloud object at 0x7fe8619d96d0>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/app/middlewares/middleware.py", line 9, in handle_request
chatgpt-qq-chatgpt-1 | await action(session_id, prompt, conversation_context, respond)
chatgpt-qq-chatgpt-1 | │ │ │ │ └ <function handle_message..respond at 0x7fe861a05b20>
chatgpt-qq-chatgpt-1 | │ │ │ └ None
chatgpt-qq-chatgpt-1 | │ │ └ '你好'
chatgpt-qq-chatgpt-1 | │ └ 'friend-手动打码'
chatgpt-qq-chatgpt-1 | └ <function handle_message..wrap_request..call at 0x7fe861a06ac0>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/app/universal.py", line 53, in call
chatgpt-qq-chatgpt-1 | await m.handle_request(session_id, message, respond, conversation_context, n)
chatgpt-qq-chatgpt-1 | │ │ │ │ │ │ └ <function handle_message..wrap_request..call at 0x7fe861a06a20>
chatgpt-qq-chatgpt-1 | │ │ │ │ │ └ None
chatgpt-qq-chatgpt-1 | │ │ │ │ └ <function handle_message..respond at 0x7fe861a05b20>
chatgpt-qq-chatgpt-1 | │ │ │ └ '你好'
chatgpt-qq-chatgpt-1 | │ │ └ 'friend-手动打码'
chatgpt-qq-chatgpt-1 | │ └ <function MiddlewareRatelimit.handle_request at 0x7fe8619dcf40>
chatgpt-qq-chatgpt-1 | └ <middlewares.ratelimit.MiddlewareRatelimit object at 0x7fe8619d9a10>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/app/middlewares/ratelimit.py", line 23, in handle_request
chatgpt-qq-chatgpt-1 | await action(session_id, prompt, conversation_context, respond)
chatgpt-qq-chatgpt-1 | │ │ │ │ └ <function handle_message..respond at 0x7fe861a05b20>
chatgpt-qq-chatgpt-1 | │ │ │ └ None
chatgpt-qq-chatgpt-1 | │ │ └ '你好'
chatgpt-qq-chatgpt-1 | │ └ 'friend-手动打码'
chatgpt-qq-chatgpt-1 | └ <function handle_message..wrap_request..call at 0x7fe861a06a20>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/app/universal.py", line 53, in call
chatgpt-qq-chatgpt-1 | await m.handle_request(session_id, message, respond, conversation_context, n)
chatgpt-qq-chatgpt-1 | │ │ │ │ │ │ └ <function handle_message..request at 0x7fe861a05bc0>
chatgpt-qq-chatgpt-1 | │ │ │ │ │ └ None
chatgpt-qq-chatgpt-1 | │ │ │ │ └ <function handle_message..respond at 0x7fe861a05b20>
chatgpt-qq-chatgpt-1 | │ │ │ └ '你好'
chatgpt-qq-chatgpt-1 | │ │ └ 'friend-手动打码'
chatgpt-qq-chatgpt-1 | │ └ <function MiddlewareTimeout.handle_request at 0x7fe8619ddbc0>
chatgpt-qq-chatgpt-1 | └ <middlewares.timeout.MiddlewareTimeout object at 0x7fe8625a1e10>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/app/middlewares/timeout.py", line 27, in handle_request
chatgpt-qq-chatgpt-1 | await asyncio.wait_for(coro_task, config.response.max_timeout)
chatgpt-qq-chatgpt-1 | │ │ │ │ │ └ 600.0
chatgpt-qq-chatgpt-1 | │ │ │ │ └ Response(mode='mixed', buffer_delay=15.0, default_ai='chatgpt-api', error_format='出现故障!如果这个问题持续出现,请和我说“重置会话” 来开启一段新的会话,或者发送 “...
chatgpt-qq-chatgpt-1 | │ │ │ └
chatgpt-qq-chatgpt-1 | │ │ └ <Task finished name='Task-25' coro=<handle_message..request() done, defined at /app/universal.py:107> exception=KeyEr...
chatgpt-qq-chatgpt-1 | │ └ <function wait_for at 0x7fe8a8e74040>
chatgpt-qq-chatgpt-1 | └ <module 'asyncio' from '/usr/local/lib/python3.11/asyncio/init.py'>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/usr/local/lib/python3.11/asyncio/tasks.py", line 479, in wait_for
chatgpt-qq-chatgpt-1 | return fut.result()
chatgpt-qq-chatgpt-1 | │ └ <method 'result' of '_asyncio.Task' objects>
chatgpt-qq-chatgpt-1 | └ <Task finished name='Task-25' coro=<handle_message..request() done, defined at /app/universal.py:107> exception=KeyEr...
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/app/universal.py", line 232, in request
chatgpt-qq-chatgpt-1 | await action(session_id, prompt, rendered, respond)
chatgpt-qq-chatgpt-1 | │ │ │ │ └ <function handle_message..respond at 0x7fe861a05b20>
chatgpt-qq-chatgpt-1 | │ │ │ └ MessageChain([Plain(text='你好,有什么可以帮助您的吗?')])
chatgpt-qq-chatgpt-1 | │ │ └ '你好'
chatgpt-qq-chatgpt-1 | │ └ 'friend-手动打码'
chatgpt-qq-chatgpt-1 | └ <function handle_message..wrap_respond..call at 0x7fe85a437b00>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/app/universal.py", line 62, in call
chatgpt-qq-chatgpt-1 | await m.handle_respond(session_id, message, rendered, respond, n)
chatgpt-qq-chatgpt-1 | │ │ │ │ │ │ └ <function handle_message..wrap_respond..call at 0x7fe85a437c40>
chatgpt-qq-chatgpt-1 | │ │ │ │ │ └ <function handle_message..respond at 0x7fe861a05b20>
chatgpt-qq-chatgpt-1 | │ │ │ │ └ MessageChain([Plain(text='你好,有什么可以帮助您的吗?')])
chatgpt-qq-chatgpt-1 | │ │ │ └ '你好'
chatgpt-qq-chatgpt-1 | │ │ └ 'friend-手动打码'
chatgpt-qq-chatgpt-1 | │ └ <function Middleware.handle_respond at 0x7fe8619dcd60>
chatgpt-qq-chatgpt-1 | └ <middlewares.concurrentlock.MiddlewareConcurrentLock object at 0x7fe8619db4d0>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/app/middlewares/middleware.py", line 12, in handle_respond
chatgpt-qq-chatgpt-1 | await action(session_id, prompt, rendered, respond)
chatgpt-qq-chatgpt-1 | │ │ │ │ └ <function handle_message..respond at 0x7fe861a05b20>
chatgpt-qq-chatgpt-1 | │ │ │ └ MessageChain([Plain(text='你好,有什么可以帮助您的吗?')])
chatgpt-qq-chatgpt-1 | │ │ └ '你好'
chatgpt-qq-chatgpt-1 | │ └ 'friend-手动打码'
chatgpt-qq-chatgpt-1 | └ <function handle_message..wrap_respond..call at 0x7fe85a437c40>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/app/universal.py", line 62, in call
chatgpt-qq-chatgpt-1 | await m.handle_respond(session_id, message, rendered, respond, n)
chatgpt-qq-chatgpt-1 | │ │ │ │ │ │ └ <function handle_message..wrap_respond..call at 0x7fe85a4377e0>
chatgpt-qq-chatgpt-1 | │ │ │ │ │ └ <function handle_message..respond at 0x7fe861a05b20>
chatgpt-qq-chatgpt-1 | │ │ │ │ └ MessageChain([Plain(text='你好,有什么可以帮助您的吗?')])
chatgpt-qq-chatgpt-1 | │ │ │ └ '你好'
chatgpt-qq-chatgpt-1 | │ │ └ 'friend-手动打码'
chatgpt-qq-chatgpt-1 | │ └ <function MiddlewareBaiduCloud.handle_respond at 0x7fe8619dda80>
chatgpt-qq-chatgpt-1 | └ <middlewares.baiducloud.MiddlewareBaiduCloud object at 0x7fe8619d96d0>
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | File "/app/middlewares/baiducloud.py", line 103, in handle_respond
chatgpt-qq-chatgpt-1 | conclusion = response_dict["conclusion"]
chatgpt-qq-chatgpt-1 | └ {'error_code': 18, 'error_msg': 'Open api qps request limit reached'}
chatgpt-qq-chatgpt-1 |
chatgpt-qq-chatgpt-1 | KeyError: 'conclusion'
chatgpt-qq-chatgpt-1 | 2023-06-24 04:06:43.303 | DEBUG | platforms.onebot_bot:respond:112 - [OneBot] 尝试发送消息:出现故障!如果这个问题持续出现,请和我说“重置会话” 来开启一段新的会话,或者发送 “回滚会话” 来回溯到上一条对话,你上一条说的我就当作没看见。
chatgpt-qq-chatgpt-1 | 'conclusion'
chatgpt-qq-gocqhttp-1 | [2023-06-24 12:06:43] [INFO]: 发送好友 手动打码(手动打码) 的消息: [{"type": ... (-1298588870)
chatgpt-qq-chatgpt-1 | 2023-06-24 04:07:09.967 | DEBUG | platforms.onebot_bot:respond:112 - [OneBot] 尝试发送消息:我还在思考中,请再等一下~
chatgpt-qq-gocqhttp-1 | [2023-06-24 12:07:09] [INFO]: 发送好友 手动打码(手动打码) 的消息: [{"type": ... (-979489876)
chatgpt-qq-chatgpt-1 | 2023-06-24 04:07:09.969 | DEBUG | middlewares.timeout:on_respond:40 - [Timeout] 取消计时……
chatgpt-qq-chatgpt-1 | 2023-06-24 04:07:09.970 | DEBUG | middlewares.timeout:create_timeout_task:58 - [Timeout] 等待过久,发送提示

@liu2-3zhi
Copy link
Contributor

liu2-3zhi commented Jun 24, 2023

配置如下

[onebot]
qq=手动打码
manager_qq=手动打码

此处保持默认设置,无需修改

reverse_ws_port = 8554

[openai]
[[openai.accounts]]

API 接入点

api_endpoint = "https://api.openai.com/v1"
api_key = "手动打码"

这里填写的内容由你的代理程序提供

proxy="http://172.19.0.1:8889"
#proxy="http://192.168.1.24:10811"

[system]

是否自动同意进群邀请

accept_group_invite = false

是否自动同意好友请求

accept_friend_request = true

#微信
[http]
host = "0.0.0.0"
port = 8080
debug = true

#百度云审核
[baiducloud]

是否启动百度云内容安全审核

check = true

百度云API_KEY 24位英文数字字符串

baidu_api_key = "手动打码"

百度云SECRET_KEY 32位的英文数字字符串

baidu_secret_key ="手动打码"

不合规消息自定义返回

prompt_message = "[百度云]请珍惜机器人,当前返回内容不合规"

@Haibersut
Copy link
Collaborator

Haibersut commented Jun 24, 2023

你可以把这行代码修改成我发的来暂时解决这个问题

except Exception as e:
            logger.error(f"[百度云文本审核] 其他错误: {e}")
            should_pass = True

except StopIteration as e:
logger.error(f"[百度云文本审核] StopIteration exception occurred: {e}")

@liu2-3zhi
Copy link
Contributor

liu2-3zhi commented Jun 24, 2023

采用docker部署的输入

sudo docker exec chatgpt-qq-chatgpt-1 /bin/bash -c "awk '/StopIteration exception occurred/ {print; match(\$0, /[^[:blank:]]/); print substr(\$0, 1, RSTART-1) \"should_pass = True\"; next}1' /app/middlewares/baiducloud.py > tmpfile && mv tmpfile /app/middlewares/baiducloud.py"

就可以修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants