Unified representation of a tool call request.
| 167 | |
| 168 | @dataclass |
| 169 | class ToolCallPayload: |
| 170 | """Unified representation of a tool call request.""" |
| 171 | |
| 172 | id: str |
| 173 | function_name: str |
| 174 | arguments: str |
| 175 | type: str = "function" |
| 176 | metadata: Dict[str, Any] = field(default_factory=dict) |
| 177 | |
| 178 | def to_openai_dict(self) -> Dict[str, Any]: |
| 179 | """Convert to OpenAI-compatible schema.""" |
| 180 | return { |
| 181 | "id": self.id, |
| 182 | "type": self.type, |
| 183 | "function": { |
| 184 | "name": self.function_name, |
| 185 | "arguments": self.arguments, |
| 186 | }, |
| 187 | } |
| 188 | |
| 189 | |
| 190 | @dataclass |
no outgoing calls
no test coverage detected