ChatResponse.fromJson constructor
Implementation
factory ChatResponse.fromJson(Map<String, dynamic> json) {
return ChatResponse(
id: json['id'] ?? '',
model: json['model'] ?? '',
usage: Usage.fromJson(json['usage'] ?? {}),
choices: (json['choices'] as List?)
?.map((choice) => Choice.fromJson(choice))
.toList() ?? [],
);
}