GenerateContentRequest.fromJson constructor

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

Implementation

factory GenerateContentRequest.fromJson(Map<String, dynamic> json) {
  return GenerateContentRequest(
    model: json['model'],
    contents: List<InternalContent>.from(
        json['contents'].map((x) => InternalContent.fromJson(x))),
    safetySettings: json['safety_settings'] != null
        ? List<InternalSafetySetting>.from(
        json['safety_settings'].map((x) => InternalSafetySetting.fromJson(x)))
        : null,
    generationConfig: json['generation_config'] != null
        ? InternalGenerationConfig.fromJson(json['generation_config'])
        : null,
  );
}