toJson method

Map<String, dynamic> toJson()

Converts the RichMessage instance to a JSON-compatible map.

Implementation

Map<String, dynamic> toJson() => {
  'id': id,
  'key': key,
  'from': from,
  'versions': versions?.map((e) => e.toJson()).toList(),
  'tools': tools?.map((e) => e.toJson()).toList(),
  'sources': sources?.map((e) => e.toJson()).toList(),
  'reasoning': reasoning?.toJson(),
  'chainOfThought': chainOfThought?.toJson(),
  'plan': plan?.toJson(),
  'contextData': contextData?.toJson(),
  'confirmation': confirmation?.toJson(),
  'checkpoints': checkpoints?.map((e) => e.toJson()).toList(),
  'suggestions': suggestions,
  'tasks': tasks?.map((e) => e.toJson()).toList(),
  'messageQueue': messageQueue?.map((e) => e.toJson()).toList(),
  'conversationId': conversationId,
  'session_id': sessionId,
  'createdAt': createdAt?.toIso8601String(),
  'updatedAt': updatedAt?.toIso8601String(),
};