记录只采集用户最近的发言。不采集助手的发言。
This commit is contained in:
@@ -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()
|
||||
|
||||
# 准备输入参数
|
||||
|
||||
Reference in New Issue
Block a user