From 163fddabac61b2be304a43d769232ea1b94265d7 Mon Sep 17 00:00:00 2001 From: Taddeus <8607097+taddeusb90@users.noreply.github.com> Date: Tue, 16 Apr 2024 07:35:33 +0300 Subject: [PATCH] fix: Fixed NameError: name 'attach' is not defined (#1255) --- memgpt/autogen/memgpt_agent.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/memgpt/autogen/memgpt_agent.py b/memgpt/autogen/memgpt_agent.py index e36483a4..5440de33 100644 --- a/memgpt/autogen/memgpt_agent.py +++ b/memgpt/autogen/memgpt_agent.py @@ -73,7 +73,9 @@ class MemGPTConversableAgent(ConversableAgent): def attach(self, data_source: str): # attach new data - attach(agent_name=self.agent.agent_state.name, data_source=data_source) + config = MemGPTConfig.load() + source_connector = StorageConnector.get_storage_connector(TableType.PASSAGES, config, user_id=self.agent.agent_state.user_id) + self.agent.attach_source(data_source, source_connector, ms=self.ms) def load_and_attach(self, name: str, type: str, force=False, **kwargs): # check if data source already exists