From c848bda3003086228f1e088351fa8de269f93937 Mon Sep 17 00:00:00 2001 From: ymq Date: Sun, 30 Aug 2026 15:07:35 +0800 Subject: [PATCH] =?UTF-8?q?fix(generic):=20agent=5Fchat=5Fgeneric=20?= =?UTF-8?q?=E9=80=8F=E4=BC=A0=E5=89=8D=E7=AB=AF=E6=A8=A1=E5=9E=8B=E9=80=89?= =?UTF-8?q?=E6=8B=A9=20model=5Fid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/api/agent_chat_generic.dspy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wwwroot/api/agent_chat_generic.dspy b/wwwroot/api/agent_chat_generic.dspy index 74dd82b..943b6bf 100644 --- a/wwwroot/api/agent_chat_generic.dspy +++ b/wwwroot/api/agent_chat_generic.dspy @@ -26,8 +26,12 @@ if action == 'send_message': from pipeline_service.gateway import get_gateway gateway = get_gateway() + # 前端模型下拉选中的模型必须透传——之前忽略导致用户选了模型仍走默认值, + # 默认模型名与 llm 表不匹配时直接"无可用模型"卡死。 + model_id = (params_kw or {}).get('model_id', '') or '' + async def agent_stream(): - async for chunk in gateway.run_message("web", uid, prompt, generic=True): + async for chunk in gateway.run_message("web", uid, prompt, generic=True, model_id=model_id): data = json.loads(chunk) t = data.get('type', '') if t == 'tool_call':