GenerateContentResponse.fromJson constructor

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

Implementation

factory GenerateContentResponse.fromJson(Map<String, dynamic> json) {

  return GenerateContentResponse(
    candidates: json['candidates'] != null
        ? List<InternalCandidate>.from(
        json['candidates'].map((x) => InternalCandidate.fromJson(x)))
        : null,
    promptFeedback: json['promptFeedback'] != null
        ? InternalPromptFeedback.fromJson(json['promptFeedback'])
        : null,
  );
}