Example search tool.
| 56 | |
| 57 | |
| 58 | class SearchTool(Tool): |
| 59 | """Example search tool.""" |
| 60 | |
| 61 | @property |
| 62 | def name(self) -> str: |
| 63 | return "search_web" |
| 64 | |
| 65 | @property |
| 66 | def description(self) -> str: |
| 67 | return "Search the web for information about a topic" |
| 68 | |
| 69 | @property |
| 70 | def parameters(self) -> dict[str, Any]: |
| 71 | return { |
| 72 | "type": "object", |
| 73 | "properties": { |
| 74 | "query": { |
| 75 | "type": "string", |
| 76 | "description": "Search query string", |
| 77 | }, |
| 78 | "max_results": { |
| 79 | "type": "integer", |
| 80 | "description": "Maximum number of results to return (1-10)", |
| 81 | }, |
| 82 | }, |
| 83 | "required": ["query"], |
| 84 | } |
| 85 | |
| 86 | async def execute(self, **kwargs) -> ToolResult: |
| 87 | """Mock execute method.""" |
| 88 | return ToolResult(success=True, content="Search results") |
| 89 | |
| 90 | |
| 91 | class CalculatorTool(Tool): |