toJson method

  1. @override
Object toJson()
override

Implementation

@override
Object toJson() => {
  'model': model,
  if (prompt != null) 'prompt': prompt!.toJson(),
  if (temperature != null) 'temperature': encodeDouble(temperature),
  if (candidateCount != null) 'candidateCount': candidateCount,
  if (maxOutputTokens != null) 'maxOutputTokens': maxOutputTokens,
  if (topP != null) 'topP': encodeDouble(topP),
  if (topK != null) 'topK': topK,
  if (safetySettings.isNotDefault)
    'safetySettings': encodeList(safetySettings),
  if (stopSequences.isNotDefault) 'stopSequences': stopSequences,
};