[Bug]求助!!在飞书使用Gpt-4o-mini等系列模型只能私聊,在群聊里机器人就回复Error code: 400
发生了什么
我为了沙箱可以调用,切换GPT4系列模型,在私聊机器人的时候全部都可以正常回复和调用。 只要在群里@机器人聊天就会出现以下日志:
本人用雨云和宝塔部署,其余大模型基本都正常聊天。
Gpt-4o-mini私聊全部正常。包括函数调用也可用。一旦群聊就出错。请麻烦看下具体是哪里出了问题。
本人API是V-API网站购买的全平台调用的API,模型都可用。
我现在怀疑的是私聊和群聊是两个不同的返回路线,求解答!!!!
如何复现?
1
AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器
v3.5.9 雨云宝塔部署 提供商OPENAI 飞书适配器
操作系统
Linux
报错日志
[16:00:54] [Core] [INFO] [core.core_lifecycle:168]: AstrBot 启动完成。
[16:01:25] [Core] [INFO] [core.event_bus:50]: [lark] ou_d155f/ou_d155f8ec61cd33b0c0dddf29f741259c: 你好
[16:01:31] [Core] [INFO] [respond.stage:190]: AstrBot -> ou_d155f/ou_d155f8ec61cd33b0c0dddf29f741259c: 你好呀!又见面了!有什么我可以帮助你的吗?
[16:01:34] [Core] [INFO] [core.event_bus:50]: [lark] ou_d155f/ou_d155f8ec61cd33b0c0dddf29f741259c: [At:ou_dd0702899a242d437db877e77e6a8598] 你好
[16:01:37] [Core] [INFO] [respond.stage:190]: AstrBot -> ou_d155f/ou_d155f8ec61cd33b0c0dddf29f741259c: 嗨!你好!需要我帮你解决什么问题吗?随时欢迎提问!
[16:01:46] [Core] [INFO] [core.event_bus:50]: [lark] ou_d155f/ou_d155f8ec61cd33b0c0dddf29f741259c: [At:ou_dd0702899a242d437db877e77e6a8598] 你好
[16:02:43] [Core] [ERRO] [method.llm_request:257]: Traceback (most recent call last):
File "/opt/AstrBot/astrbot/core/pipeline/process_stage/method/llm_request.py", line 196, in requesting
final_llm_response = await provider.text_chat(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/AstrBot/astrbot/core/provider/sources/openai_source.py", line 389, in text_chat
) = await self._handle_api_error(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/AstrBot/astrbot/core/provider/sources/openai_source.py", line 338, in _handle_api_error
raise e
File "/opt/AstrBot/astrbot/core/provider/sources/openai_source.py", line 372, in text_chat
llm_response = await self._query(payloads, func_tool)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/AstrBot/astrbot/core/provider/sources/openai_source.py", line 108, in _query
completion = await self.client.chat.completions.create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/AstrBot/venv/lib/python3.11/site-packages/openai/resources/chat/completions/completions.py", line 2028, in create
return await self._post(
^^^^^^^^^^^^^^^^^
File "/opt/AstrBot/venv/lib/python3.11/site-packages/openai/_base_client.py", line 1742, in post
return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/AstrBot/venv/lib/python3.11/site-packages/openai/_base_client.py", line 1549, in request
raise self._make_status_error_from_response(err.response) from None
openai.BadRequestError: Error code: 400 - {'error': {'message': 'bad response status code 400 (request id: 2025051216020676582670490991596)', 'type': 'upstream_error', 'param': '400', 'code': 'bad_response_status_code'}}
[16:02:45] [Core] [INFO] [respond.stage:190]: AstrBot -> ou_d155f/ou_d155f8ec61cd33b0c0dddf29f741259c: AstrBot 请求失败。 错误类型: BadRequestError 错误信息: Error code: 400 - {'error': {'message': 'bad response status code 400 (request id: 2025051216020676582670490991596)', 'type': 'upstream_error', 'param': '400', 'code': 'bad_response_status_code'}}
你愿意提交 PR 吗?
- [ ] 是的,我愿意提交 PR!
Code of Conduct
- [x] 我已阅读并同意遵守该项目的 行为准则。
尝试在群聊里 /reset 一下重置会话