fix: Fixed NameError: name 'attach' is not defined (#1255)

This commit is contained in:
Taddeus
2024-04-16 07:35:33 +03:00
committed by GitHub
parent e1063e3129
commit 163fddabac

View File

@@ -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