GptResponse.fromJson constructor

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

Implementation

factory GptResponse.fromJson(Map<String, dynamic> json) {
  return GptResponse(
    id: json['id'],
    object: json['object'],
    created: json['created'],
    model: json['model'],
    usage: Usage.fromJson(json['usage']),
    choices: List<Choice>.from(json['choices'].map((x) => Choice.fromJson(x))),
  );
}