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)
| 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 | """ |
nothing calls this directly
no test coverage detected