Represents a tool that can be called by the LLM.
| 124 | |
| 125 | @dataclass |
| 126 | class Tool: |
| 127 | """Represents a tool that can be called by the LLM.""" |
| 128 | name: str |
| 129 | description: str |
| 130 | parameters: dict[str, Any] |
| 131 | |
| 132 | def to_dict(self) -> dict: |
| 133 | """Convert to dictionary representation.""" |
| 134 | return { |
| 135 | 'name': self.name, |
| 136 | 'description': self.description, |
| 137 | 'parameters': self.parameters |
| 138 | } |
| 139 | |
| 140 | |
| 141 | @dataclass |