mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-28 01:53:53 +08:00
update:修复init_memorybug
This commit is contained in:
@@ -215,7 +215,7 @@ class IntentProvider(IntentProviderBase):
|
||||
|
||||
# 记录识别到的function call
|
||||
logger.bind(tag=TAG).info(
|
||||
f"识别到function call: {function_name}, 参数: {function_args}"
|
||||
f"llm 识别到意图: {function_name}, 参数: {function_args}"
|
||||
)
|
||||
|
||||
# 添加到缓存
|
||||
|
||||
@@ -21,6 +21,6 @@ class MemoryProviderBase(ABC):
|
||||
"""Query memories for specific role based on similarity"""
|
||||
return "please implement query method"
|
||||
|
||||
def init_memory(self, role_id, llm, summary_memory=None):
|
||||
def init_memory(self, role_id, llm, **kwargs):
|
||||
self.role_id = role_id
|
||||
self.llm = llm
|
||||
|
||||
@@ -112,8 +112,10 @@ class MemoryProvider(MemoryProviderBase):
|
||||
self.memory_path = get_project_dir() + "data/.memory.yaml"
|
||||
self.load_memory(summary_memory)
|
||||
|
||||
def init_memory(self, role_id, llm, summary_memory=None, save_to_file=True):
|
||||
super().init_memory(role_id, llm)
|
||||
def init_memory(
|
||||
self, role_id, llm, summary_memory=None, save_to_file=True, **kwargs
|
||||
):
|
||||
super().init_memory(role_id, llm, **kwargs)
|
||||
self.save_to_file = save_to_file
|
||||
self.load_memory(summary_memory)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user