Convert to dictionary representation.
(self)
| 177 | ) |
| 178 | |
| 179 | def to_dict(self) -> dict: |
| 180 | """Convert to dictionary representation.""" |
| 181 | return { |
| 182 | 'content': self.content, |
| 183 | 'tool_calls': [tc.to_dict() for tc in self.tool_calls], |
| 184 | 'stop_reason': self.stop_reason.value, |
| 185 | 'model': self.model, |
| 186 | 'usage': self.usage.to_dict() |
| 187 | } |
| 188 | |
| 189 | |
| 190 | @dataclass |