ChatCompletion.fromMap constructor

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

Implementation

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