toJson method
Implementation
@override
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = {
'model': model,
'contents': contents.map((x) => x.toJson()).toList(),
};
if (safetySettings != null) {
data['safety_settings'] =
safetySettings?.map((x) => x.toJson()).toList();
}
if (generationConfig != null) {
data['generation_config'] = generationConfig?.toJson();
}
return data;
}