From 195551261ffac59eb57d5ee8b95a985caca7d0ca Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 18 Aug 2026 12:42:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20agent=5Fchat.dspy=20reply=20=E9=87=8C=20?= =?UTF-8?q?widget=20JSON=20=E9=A1=B6=E5=B1=82=E9=80=8F=E4=BC=A0=EF=BC=88/t?= =?UTF-8?q?ask=20=E5=BC=B9=E7=AA=97=E6=B8=B2=E6=9F=93=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/api/agent_chat.dspy | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wwwroot/api/agent_chat.dspy b/wwwroot/api/agent_chat.dspy index 213aaf9..1333e06 100644 --- a/wwwroot/api/agent_chat.dspy +++ b/wwwroot/api/agent_chat.dspy @@ -97,7 +97,12 @@ if action == 'send_message': result = data.get('result', '') yield json.dumps({"content": result + "\n\n"}, ensure_ascii=False) + '\n' elif t == 'reply': - yield json.dumps({"content": data.get('message', '')}, ensure_ascii=False) + '\n' + msg = data.get('message', '') + if isinstance(msg, dict) and msg.get('widgettype'): + # widget JSON:顶层透传,前端 AgentOut 检测 widgettype 渲染(如 /task 的 PopupWindow) + yield json.dumps(msg, ensure_ascii=False) + '\n' + else: + yield json.dumps({"content": msg}, ensure_ascii=False) + '\n' elif t == 'ask_user': yield json.dumps({"content": "❓ " + data.get('message', '')}, ensure_ascii=False) + '\n' elif t == 'confirm':