groqResponseFromJson static method

GroqResponse groqResponseFromJson(
  1. Map<String, dynamic> json
)

Parses the response information from the json

Implementation

static GroqResponse groqResponseFromJson(Map<String, dynamic> json) {
  return GroqResponse(
    id: json['id'] as String,
    choices: (json['choices'] as List)
        .map(
          (item) =>
              GroqParser.groqChoiceFromJson(item as Map<String, dynamic>),
        )
        .toList(),
    createdAt: DateTime.fromMillisecondsSinceEpoch(json['created'] as int,
        isUtc: true),
  );
}