From 513a5c17a21ba63bf1187e03a1f0576f51734ad8 Mon Sep 17 00:00:00 2001 From: tt-P607 <68868379+tt-P607@users.noreply.github.com> Date: Sat, 13 Sep 2025 21:40:46 +0800 Subject: [PATCH] =?UTF-8?q?refactor(chat):=20=E7=AE=80=E5=8C=96=E8=AE=B0?= =?UTF-8?q?=E5=BF=86=E6=BF=80=E6=B4=BB=E6=96=B9=E6=B3=95=E7=9A=84=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新 `activate_memory_with_chat_history` 的调用方式,使用 `target_message` 对象来替代独立的 `target_user` 和 `chat_id` 参数。 此举将相关上下文封装到单个对象中,使得接口更加清晰,提高了代码的可维护性。 --- src/chat/utils/prompt.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/chat/utils/prompt.py b/src/chat/utils/prompt.py index 76c476407..dd4fee364 100644 --- a/src/chat/utils/prompt.py +++ b/src/chat/utils/prompt.py @@ -583,9 +583,8 @@ class Prompt: # 激活长期记忆 memory_activator = MemoryActivator() running_memories = await memory_activator.activate_memory_with_chat_history( - chat_history=chat_history, - target_user=self.parameters.sender, - chat_id=self.parameters.chat_id + target_message=self.parameters.target, + chat_history_prompt=chat_history ) # 获取即时记忆