mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-07-24 12:45:45 +00:00
fix(agent): Fix long-term memory error
This commit is contained in:
parent
3d7d52250f
commit
a059ef1412
@ -69,7 +69,7 @@ class HybridMemory(Memory, Generic[T]):
|
||||
@classmethod
|
||||
def from_chroma(
|
||||
cls,
|
||||
vstore_name: Optional[str] = "_chroma_agent_memory_",
|
||||
vstore_name: Optional[str] = "agent_memory_long_term",
|
||||
vstore_path: Optional[str] = None,
|
||||
embeddings: Optional[Embeddings] = None,
|
||||
executor: Optional[Executor] = None,
|
||||
|
@ -102,6 +102,7 @@ class ToolPack(ResourcePack):
|
||||
args: Optional[Dict[str, Any]] = None,
|
||||
function: Optional[Callable] = None,
|
||||
parse_execute_args_func: Optional[PARSE_EXECUTE_ARGS_FUNCTION] = None,
|
||||
overwrite: bool = False,
|
||||
) -> None:
|
||||
"""Add a command to the commands.
|
||||
|
||||
@ -118,6 +119,8 @@ class ToolPack(ResourcePack):
|
||||
the command is executed. Defaults to None.
|
||||
parse_execute_args (callable, optional): A callable function to parse the
|
||||
execute arguments. Defaults to None.
|
||||
overwrite (bool, optional): Whether to overwrite the command if it already
|
||||
exists. Defaults to False.
|
||||
"""
|
||||
if args is not None:
|
||||
tool_args = {}
|
||||
@ -151,7 +154,7 @@ class ToolPack(ResourcePack):
|
||||
description=command_label,
|
||||
parse_execute_args_func=parse_execute_args_func,
|
||||
)
|
||||
self.append(ft)
|
||||
self.append(ft, overwrite=overwrite)
|
||||
|
||||
def _get_execution_tool(
|
||||
self,
|
||||
@ -347,6 +350,7 @@ class MCPToolPack(ToolPack):
|
||||
ssl_verify: Optional[Dict[str, Union[ssl.SSLContext, str, bool]]] = None,
|
||||
default_ssl_verify: Union[ssl.SSLContext, str, bool] = True,
|
||||
default_ssl_cafile: Optional[str] = None,
|
||||
overwrite_same_tool: bool = True,
|
||||
**kwargs,
|
||||
):
|
||||
"""Create an Auto-GPT plugin tool pack."""
|
||||
@ -363,6 +367,7 @@ class MCPToolPack(ToolPack):
|
||||
self._default_ssl_verify = default_ssl_verify
|
||||
self._ssl_verify_map = ssl_verify or {}
|
||||
self.server_ssl_verify_map = {}
|
||||
self._overwrite_same_tool = overwrite_same_tool
|
||||
|
||||
def switch_mcp_input_schema(self, input_schema: dict):
|
||||
args = {}
|
||||
@ -450,5 +455,6 @@ class MCPToolPack(ToolPack):
|
||||
args,
|
||||
call_mcp_tool,
|
||||
parse_execute_args_func=json_parse_execute_args_func,
|
||||
overwrite=self._overwrite_same_tool,
|
||||
)
|
||||
self._loaded = True
|
||||
|
@ -142,7 +142,7 @@ class MultiAgents(BaseComponent, ABC):
|
||||
).create()
|
||||
|
||||
storage_manager = StorageManager.get_instance(self.system_app)
|
||||
index_name = "_agent_memory_"
|
||||
index_name = "agent_memory_long_term"
|
||||
vector_store = storage_manager.create_vector_store(index_name=index_name)
|
||||
if not vector_store.vector_name_exists():
|
||||
vector_store.create_collection(collection_name=index_name)
|
||||
|
Loading…
Reference in New Issue
Block a user