toJson method
Serializes to a JSON map with a role discriminator (pi shape).
Implementation
@override
Map<String, dynamic> toJson() => {
'role': role,
'toolCallId': toolCallId,
'toolName': toolName,
'content': content.map((block) => block.toJson()).toList(),
'isError': isError,
'timestamp': timestamp.millisecondsSinceEpoch,
};