Completion.fromMap constructor

Completion.fromMap(
  1. Map<String, dynamic> json
)

Implementation

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