toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() => {
      if (candidateCount case final candidateCount?)
        'candidateCount': candidateCount,
      if (stopSequences.isNotEmpty) 'stopSequences': stopSequences,
      if (maxOutputTokens case final maxOutputTokens?)
        'maxOutputTokens': maxOutputTokens,
      if (temperature case final temperature?) 'temperature': temperature,
      if (topP case final topP?) 'topP': topP,
      if (topK case final topK?) 'topK': topK,
      if (responseMimeType case final responseMimeType?)
        'responseMimeType': responseMimeType,
      if (responseSchema case final responseSchema?)
        'responseSchema': responseSchema,
    };