From 5421cf4b09c9a7e92947c6481d2cf3b84ad739d0 Mon Sep 17 00:00:00 2001 From: UnCLAS-Prommer Date: Thu, 21 Aug 2025 23:19:29 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A9=E6=BF=80=E6=B4=BB=E6=9C=89=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/chat/memory_system/Hippocampus.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/chat/memory_system/Hippocampus.py b/src/chat/memory_system/Hippocampus.py index 04ceccb2..f60edece 100644 --- a/src/chat/memory_system/Hippocampus.py +++ b/src/chat/memory_system/Hippocampus.py @@ -411,7 +411,7 @@ class Hippocampus: 如果为False,使用LLM提取关键词,速度较慢但更准确。 """ if not text: - return [] + return [], [] # 使用LLM提取关键词 - 根据详细文本长度分布优化topic_num计算 text_length = len(text) @@ -1435,13 +1435,11 @@ class HippocampusManager: if not self._initialized: raise RuntimeError("HippocampusManager 尚未初始化,请先调用 initialize 方法") try: - response, keywords, keywords_lite = await self._hippocampus.get_activate_from_text( - text, max_depth, fast_retrieval - ) + return await self._hippocampus.get_activate_from_text(text, max_depth, fast_retrieval) except Exception as e: logger.error(f"文本产生激活值失败: {e}") logger.error(traceback.format_exc()) - return 0.0, [], [] + return 0.0, [], [] def get_memory_from_keyword(self, keyword: str, max_depth: int = 2) -> list: """从关键词获取相关记忆的公共接口"""