AIResponse.fromJson constructor

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

Implementation

AIResponse.fromJson(Map<String, dynamic> json) {
  id = json['id'];
  object = json['object'];
  created = json['created'];
  model = json['model'];
  if (json['choices'] != null) {
    choices = <Choices>[];
    json['choices'].forEach((v) {
      choices!.add(Choices.fromJson(v));
    });
  }
  usage = json['usage'] != null ? Usage.fromJson(json['usage']) : null;
}