Mock calculator tool for testing.
| 36 | |
| 37 | |
| 38 | class MockCalculatorTool(Tool): |
| 39 | """Mock calculator tool for testing.""" |
| 40 | |
| 41 | @property |
| 42 | def name(self) -> str: |
| 43 | return "calculator" |
| 44 | |
| 45 | @property |
| 46 | def description(self) -> str: |
| 47 | return "Perform calculations" |
| 48 | |
| 49 | @property |
| 50 | def parameters(self) -> dict[str, Any]: |
| 51 | return { |
| 52 | "type": "object", |
| 53 | "properties": { |
| 54 | "expression": { |
| 55 | "type": "string", |
| 56 | "description": "Math expression", |
| 57 | }, |
| 58 | }, |
| 59 | "required": ["expression"], |
| 60 | } |
| 61 | |
| 62 | async def execute(self, **kwargs) -> ToolResult: |
| 63 | return ToolResult(success=True, content="42") |
| 64 | |
| 65 | |
| 66 | class MockSearchTool(Tool): |
no outgoing calls