toJson method
Implementation
@override
Object toJson() => {
'model': model,
'prompt': ?prompt?.toJson(),
if (temperature case final $1?) 'temperature': encodeDouble($1),
'candidateCount': ?candidateCount,
'maxOutputTokens': ?maxOutputTokens,
if (topP case final $1?) 'topP': encodeDouble($1),
'topK': ?topK,
if (safetySettings.isNotDefault)
'safetySettings': [for (final i in safetySettings) i.toJson()],
if (stopSequences.isNotDefault) 'stopSequences': stopSequences,
};