toJson method

  1. @override
Map<String, dynamic> toJson()
override

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,
};