feat:新增仅上报聊天记录(mem_report_only)记忆供应器

This commit is contained in:
rainv123
2026-03-23 16:17:38 +08:00
parent 6eecf5d0cb
commit 2a49f0804c
7 changed files with 58 additions and 11 deletions
+2 -2
View File
@@ -751,8 +751,8 @@ class ConnectionHandler:
memory_type = self.config["Memory"][self.config["selected_module"]["Memory"]][
"type"
]
# 如果使用 nomen,直接返回
if memory_type == "nomem":
# 如果使用 nomen 或 mem_report_only,直接返回
if memory_type == "nomem" or memory_type == "mem_report_only":
return
# 使用 mem_local_short 模式
elif memory_type == "mem_local_short":
@@ -0,0 +1,20 @@
"""
仅上报聊天记录,不进行记忆总结
"""
from ..base import MemoryProviderBase, logger
TAG = __name__
class MemoryProvider(MemoryProviderBase):
def __init__(self, config, summary_memory=None):
super().__init__(config)
async def save_memory(self, msgs, session_id=None):
logger.bind(tag=TAG).debug("mem_report_only mode: No memory saving or summarization is performed.")
return None
async def query_memory(self, query: str) -> str:
logger.bind(tag=TAG).debug("mem_report_only mode: No memory query is performed.")
return ""