mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-22 23:23:55 +08:00
feat:新增仅上报聊天记录(mem_report_only)记忆供应器
This commit is contained in:
@@ -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 ""
|
||||
Reference in New Issue
Block a user