From d0ff88084864fb27f5f690cb31e4f75fce98b482 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sat, 5 Sep 2026 11:07:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(agent):=20=E5=AE=8C=E6=AF=95=E8=A1=8C?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E6=94=B9=E5=B9=B3=E9=93=BAcolor(bricks?= =?UTF-8?q?=E5=B5=8C=E5=A5=97style=E6=97=A0=E6=95=88=E9=93=81=E5=BE=8B)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/api/agent_chat.dspy | 4 ++-- wwwroot/api/agent_chat_generic.dspy | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wwwroot/api/agent_chat.dspy b/wwwroot/api/agent_chat.dspy index 360026e..9a07adf 100644 --- a/wwwroot/api/agent_chat.dspy +++ b/wwwroot/api/agent_chat.dspy @@ -60,7 +60,7 @@ if action == 'send_message': if any(kw == _pl or (kw in _pl and not _is_project_mgmt) for kw in stop_keywords): async def _stop_stream(): yield json.dumps({"content": "已停止当前任务。"}, ensure_ascii=False) + '\n' - yield json.dumps({"widgettype": "Text", "options": {"otext": "## 完毕 ##", "text": "## 完毕 ##", "i18n": True, "halign": "left", "css": "agent-done", "style": {"color": "#94a3b8"}}}, ensure_ascii=False) + '\n' + yield json.dumps({"widgettype": "Text", "options": {"otext": "## 完毕 ##", "text": "## 完毕 ##", "i18n": True, "halign": "left", "css": "agent-done", "color": "#94a3b8", "marginBottom": "6px"}}, ensure_ascii=False) + '\n' return await stream_response(request, _stop_stream, 'text/plain; charset=utf-8') uid = await get_user() @@ -137,7 +137,7 @@ if action == 'send_message': yield json.dumps({"content": chunk}, ensure_ascii=False) + '\n' # 应答输出结束后追加一行「## 完毕 ##」:Text 控件 otext+i18n,前端按当前语言翻译 # (词条见 pipeline-app/i18n/*/i18n.json;msg.txt 以 # 开头的键会被当注释,故只放 i18n.json) - yield json.dumps({"widgettype": "Text", "options": {"otext": "## 完毕 ##", "text": "## 完毕 ##", "i18n": True, "halign": "left", "css": "agent-done", "style": {"color": "#94a3b8"}}}, ensure_ascii=False) + '\n' + yield json.dumps({"widgettype": "Text", "options": {"otext": "## 完毕 ##", "text": "## 完毕 ##", "i18n": True, "halign": "left", "css": "agent-done", "color": "#94a3b8", "marginBottom": "6px"}}, ensure_ascii=False) + '\n' return await stream_response(request, agent_stream, 'text/plain; charset=utf-8') diff --git a/wwwroot/api/agent_chat_generic.dspy b/wwwroot/api/agent_chat_generic.dspy index 030a3f3..e2f67b3 100644 --- a/wwwroot/api/agent_chat_generic.dspy +++ b/wwwroot/api/agent_chat_generic.dspy @@ -21,7 +21,7 @@ if action == 'send_message': if prompt.strip().lower() in stop_kw: async def _stop(): yield json.dumps({"content": "已停止。"}, ensure_ascii=False) + '\n' - yield json.dumps({"widgettype": "Text", "options": {"otext": "## 完毕 ##", "text": "## 完毕 ##", "i18n": True, "halign": "left", "css": "agent-done", "style": {"color": "#94a3b8"}}}, ensure_ascii=False) + '\n' + yield json.dumps({"widgettype": "Text", "options": {"otext": "## 完毕 ##", "text": "## 完毕 ##", "i18n": True, "halign": "left", "css": "agent-done", "color": "#94a3b8", "marginBottom": "6px"}}, ensure_ascii=False) + '\n' return await stream_response(request, _stop, 'text/plain; charset=utf-8') from pipeline_service.gateway import get_gateway @@ -88,7 +88,7 @@ if action == 'send_message': yield json.dumps({"content": chunk}, ensure_ascii=False) + '\n' # 应答输出结束后追加一行「## 完毕 ##」:Text 控件 otext+i18n,前端按当前语言翻译 # (词条见 pipeline-app/i18n/*/i18n.json;msg.txt 以 # 开头的键会被当注释,故只放 i18n.json) - yield json.dumps({"widgettype": "Text", "options": {"otext": "## 完毕 ##", "text": "## 完毕 ##", "i18n": True, "halign": "left", "css": "agent-done", "style": {"color": "#94a3b8"}}}, ensure_ascii=False) + '\n' + yield json.dumps({"widgettype": "Text", "options": {"otext": "## 完毕 ##", "text": "## 完毕 ##", "i18n": True, "halign": "left", "css": "agent-done", "color": "#94a3b8", "marginBottom": "6px"}}, ensure_ascii=False) + '\n' return await stream_response(request, agent_stream, 'text/plain; charset=utf-8')