toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final json = <String, dynamic>{};
    json[r'id'] = this.id;
    json[r'conversation_id'] = this.conversationId;
    json[r'role'] = this.role;
  if (this.content != null) {
    json[r'content'] = this.content;
  } else {
    json[r'content'] = null;
  }
    json[r'metadata'] = this.metadata;
  if (this.createdAt != null) {
    json[r'created_at'] = this.createdAt!.toUtc().toIso8601String();
  } else {
    json[r'created_at'] = null;
  }
  return json;
}