MCPcopy Create free account
hub / github.com/AQ-MedAI/MedMemoryBench / attach_source

Method attach_source

methods/letta/client/client.py:3214–3227  ·  view source on GitHub ↗

Attach a source to an agent Args: agent_id (str): ID of the agent source_id (str): ID of the source source_name (str): Name of the source

(self, agent_id: str, source_id: Optional[str] = None, source_name: Optional[str] = None)

Source from the content-addressed store, hash-verified

3212 return self.server.source_manager.get_source_by_name(source_name=source_name, actor=self.user).id
3213
3214 def attach_source(self, agent_id: str, source_id: Optional[str] = None, source_name: Optional[str] = None) -> AgentState:
3215 """
3216 Attach a source to an agent
3217
3218 Args:
3219 agent_id (str): ID of the agent
3220 source_id (str): ID of the source
3221 source_name (str): Name of the source
3222 """
3223 if source_name:
3224 source = self.server.source_manager.get_source_by_id(source_id=source_id, actor=self.user)
3225 source_id = source.id
3226
3227 return self.server.agent_manager.attach_source(source_id=source_id, agent_id=agent_id, actor=self.user)
3228
3229 def detach_source(self, agent_id: str, source_id: Optional[str] = None, source_name: Optional[str] = None) -> AgentState:
3230 """

Callers

nothing calls this directly

Calls 2

get_source_by_idMethod · 0.80
attach_sourceMethod · 0.45

Tested by

no test coverage detected