toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = id;
  data['object'] = object;
  data['created'] = created;
  data['model'] = model;
  if (choices != null) {
    data['choices'] = choices!.map((v) => v.toJson()).toList();
  }
  if (usage != null) {
    data['usage'] = usage!.toJson();
  }
  return data;
}