update:修复init_memorybug

This commit is contained in:
hrz
2025-05-15 16:13:32 +08:00
parent a2c2eab6b3
commit 86b5eb1818
4 changed files with 13 additions and 9 deletions
@@ -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)