From 3723434bd6fd634244a912099432019381a8c024 Mon Sep 17 00:00:00 2001 From: liuwei Date: Thu, 5 Feb 2026 10:34:28 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=8F=AA=E9=87=87=E9=9B=86?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=9C=80=E8=BF=91=E7=9A=84=E5=8F=91=E8=A8=80?= =?UTF-8?q?=E3=80=82=E4=B8=8D=E9=87=87=E9=9B=86=E5=8A=A9=E6=89=8B=E7=9A=84?= =?UTF-8?q?=E5=8F=91=E8=A8=80=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/dify/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/dify/main.py b/plugins/dify/main.py index 8248274..b3d7502 100644 --- a/plugins/dify/main.py +++ b/plugins/dify/main.py @@ -264,7 +264,8 @@ class DifyPlugin(MessagePluginInterface): # 将历史记录转换为字符串格式 for msg in self.conversations[session_id]: role = "用户" if msg["role"] == "user" else "助手" - history_text += f"{role}: {msg['content']}\n" + if role == "用户": + history_text += f"{role}: {msg['content']}\n" history_text = history_text.strip() # 准备输入参数