From 462c57545288d2b5d0d44d10b6ee9b7988968e01 Mon Sep 17 00:00:00 2001 From: Gaofeng Date: Sat, 6 Dec 2025 02:40:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3:=20"Unrecognized=20request?= =?UTF-8?q?=20arguments=20supplied:=20is=5Fuser=5Fmodel,=20variables"?= =?UTF-8?q?=EF=BC=8C=E5=8D=B3=E5=BE=80=20payload=20=E4=B8=AD=E5=A1=9E?= =?UTF-8?q?=E5=85=A5=20API=20=E9=A2=84=E6=96=99=E5=A4=96=E7=9A=84=E5=8F=82?= =?UTF-8?q?=E6=95=B0=EF=BC=8C=E5=AF=BC=E8=87=B4=20openAI=20API=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/open_webui/routers/openai.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/backend/open_webui/routers/openai.py b/backend/open_webui/routers/openai.py index 1f1f527ea7..381065bfad 100644 --- a/backend/open_webui/routers/openai.py +++ b/backend/open_webui/routers/openai.py @@ -1007,6 +1007,22 @@ async def generate_chat_completion( except Exception as e: log.debug(f"chatting_completion 钩子执行失败: {e}") + + # 移除上游不识别的内部参数 + for key in [ + "is_user_model", + "variables", + "model_item", + "background_tasks", + "chat_id", + "id", + "message_id", + "session_id", + "filter_ids", + "tool_servers", + ]: + payload.pop(key, None) + payload = json.dumps(payload) # 序列化为 JSON 字符串 # === 11. 初始化请求状态变量 ===