toJson method
Implementation
@override
Object toJson() => {
if (model.isNotDefault) 'model': model,
'contents': encodeList(contents),
if (systemInstruction != null)
'systemInstruction': systemInstruction!.toJson(),
if (cachedContent.isNotDefault) 'cachedContent': cachedContent,
if (tools.isNotDefault) 'tools': encodeList(tools),
if (toolConfig != null) 'toolConfig': toolConfig!.toJson(),
if (labels.isNotDefault) 'labels': labels,
if (safetySettings.isNotDefault)
'safetySettings': encodeList(safetySettings),
if (generationConfig != null)
'generationConfig': generationConfig!.toJson(),
};