StreamAnswer.fromJson constructor

StreamAnswer.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory StreamAnswer.fromJson(Map<String, dynamic> json) {
  return StreamAnswer(
    id: json['id'] ?? '',
    object: json['object'] ?? '',
    created: json['created'] ?? 0,
    model: json['model'] ?? '',
    choices: (json['choices'] as List?)
        ?.map((choice) => StreamChoice.fromJson(choice))
        .toList() ?? [],
  );
}