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':