Create a tool instance. Args: instance_id: The instance id of the tool. Returns: The instance id of the tool. tool_creation_response: The response of the tool when creating the instance.
(self, instance_id: Optional[str] = None, **kwargs)
| 44 | return self.tool_schema |
| 45 | |
| 46 | async def create(self, instance_id: Optional[str] = None, **kwargs) -> tuple[str, ToolResponse]: |
| 47 | """Create a tool instance. |
| 48 | |
| 49 | Args: |
| 50 | instance_id: The instance id of the tool. |
| 51 | |
| 52 | Returns: |
| 53 | The instance id of the tool. |
| 54 | tool_creation_response: The response of the tool when creating the instance. |
| 55 | """ |
| 56 | if instance_id is None: |
| 57 | return str(uuid4()), ToolResponse() |
| 58 | else: |
| 59 | return instance_id, ToolResponse() |
| 60 | |
| 61 | @rollout_trace_op |
| 62 | async def execute(self, instance_id: str, parameters: dict[str, Any], **kwargs) -> tuple[ToolResponse, float, dict]: |