toJson method
Serializes this result to the multipart tool.v2 shape
({output, content?, metadata?} or {interrupt}). Used at the reflection
boundary so the Dev UI can render tool results.
Implementation
@override
Map<String, dynamic> toJson() {
return {
'output': output,
if (parts != null) 'content': parts!.map((p) => p.toJson()).toList(),
if (metadata != null) 'metadata': metadata,
};
}