From 5364f821a2e4e0a59b7795e846665b5d5f8a86e7 Mon Sep 17 00:00:00 2001 From: "jinli.yl" Date: Thu, 27 Jun 2024 11:46:51 +0800 Subject: [PATCH] [dev] add default path to tool functions --- config/config.yaml | 1 + memory_scope/memory/operation/read_memory.py | 4 ++-- memory_scope/utils/tool_functions.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index 4dcae9d8..696c39cb 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -18,6 +18,7 @@ memory_service: class: memory.operation.read_memory workflow: dummy description: "read session messages of the user" + contextual_msg_count: 0 read_memory: class: memory.operation.read_memory workflow: dummy diff --git a/memory_scope/memory/operation/read_memory.py b/memory_scope/memory/operation/read_memory.py index 89956137..d647acd3 100644 --- a/memory_scope/memory/operation/read_memory.py +++ b/memory_scope/memory/operation/read_memory.py @@ -13,8 +13,8 @@ class ReadMemory(BaseWorkflow, BaseOperation): name: str, description: str, chat_messages: List[Message], - his_msg_count: int = 0, - contextual_msg_count: int = 0, + his_msg_count: int = 0, # supplement to the current query + contextual_msg_count: int = 0, # for the current context dialogue **kwargs): super().__init__(name=name, **kwargs) BaseOperation.__init__(self, name=name, description=description) diff --git a/memory_scope/utils/tool_functions.py b/memory_scope/utils/tool_functions.py index 5de34148..a0e847c2 100644 --- a/memory_scope/utils/tool_functions.py +++ b/memory_scope/utils/tool_functions.py @@ -10,7 +10,7 @@ def under_line_to_hump(underline_str): return sub[0:1].upper() + sub[1:] -def init_instance_by_config(config: dict, default_class_path: str = "", suffix_name: str = "", **kwargs): +def init_instance_by_config(config: dict, default_class_path: str = "memory_scope", suffix_name: str = "", **kwargs): class_name = config.pop("class") if not class_name: raise RuntimeError("empty class_name!")