Add tool to an existing agent Args: agent_id (str): ID of the agent tool_id (str): A tool id Returns: agent_state (AgentState): State of the updated agent
(self, agent_id: str, tool_id: str)
| 705 | return [Tool(**tool) for tool in response.json()] |
| 706 | |
| 707 | def attach_tool(self, agent_id: str, tool_id: str) -> AgentState: |
| 708 | """ |
| 709 | Add tool to an existing agent |
| 710 | |
| 711 | Args: |
| 712 | agent_id (str): ID of the agent |
| 713 | tool_id (str): A tool id |
| 714 | |
| 715 | Returns: |
| 716 | agent_state (AgentState): State of the updated agent |
| 717 | """ |
| 718 | response = requests.patch(f"{self.base_url}/{self.api_prefix}/agents/{agent_id}/tools/attach/{tool_id}", headers=self.headers) |
| 719 | if response.status_code != 200: |
| 720 | raise ValueError(f"Failed to update agent: {response.text}") |
| 721 | return AgentState(**response.json()) |
| 722 | |
| 723 | def detach_tool(self, agent_id: str, tool_id: str) -> AgentState: |
| 724 | """ |
no test coverage detected