toMap method
Serializes the run into a persistence-friendly map.
Implementation
Map<String, dynamic> toMap() => {
'id': id,
'agentName': agentName,
'userId': userId,
'tenantId': tenantId,
'threadId': threadId,
'goal': goal.toMap(),
'status': status.name,
'state': state,
'events': events.map((event) => event.toMap()).toList(),
'output': output,
};