From b7bcb0b8e6d20b76f15e0ab15e39196f5ab2b7cb Mon Sep 17 00:00:00 2001 From: Windpicker-owo <3431391539@qq.com> Date: Tue, 30 Sep 2025 09:14:44 +0800 Subject: [PATCH] =?UTF-8?q?feat(chat):=20=E4=BC=98=E5=8C=96=E8=AE=B0?= =?UTF-8?q?=E5=BF=86=E6=A3=80=E7=B4=A2=E9=80=BB=E8=BE=91=EF=BC=8C=E5=BC=82?= =?UTF-8?q?=E6=AD=A5=E8=B0=83=E7=94=A8=E5=A2=9E=E5=BC=BA=E8=AE=B0=E5=BF=86?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/chat/replyer/default_generator.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/chat/replyer/default_generator.py b/src/chat/replyer/default_generator.py index b88ffb4ed..3a853169d 100644 --- a/src/chat/replyer/default_generator.py +++ b/src/chat/replyer/default_generator.py @@ -488,6 +488,13 @@ class DefaultReplyer: try: # 使用新的增强记忆系统 from src.chat.memory_system.enhanced_memory_integration import recall_memories, remember_message + + # 检索相关记忆 + enhanced_memories = await recall_memories( + query=target, + user_id=str(self.chat_stream.stream_id), + chat_id=self.chat_stream.stream_id + ) # 异步存储聊天历史(非阻塞) asyncio.create_task( @@ -497,12 +504,6 @@ class DefaultReplyer: chat_id=self.chat_stream.stream_id ) ) - # 检索相关记忆 - enhanced_memories = await recall_memories( - query=target, - user_id=str(self.chat_stream.stream_id), - chat_id=self.chat_stream.stream_id - ) # 转换格式以兼容现有代码 running_memories = []