mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-19 00:37:34 +00:00
fix(agent): Fix long-term memory error (#2644)
# Description Closes #2642 Closes #2637 # How Has This Been Tested? Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration # Snapshots: Include snapshots for easier review. # Checklist: - [x] My code follows the style guidelines of this project - [x] I have already rebased the commits and make the commit message conform to the project standard. - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have made corresponding changes to the documentation - [x] Any dependent changes have been merged and published in downstream modules
This commit is contained in:
commit
e78d5370ac
@ -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