GenerationConfig

data class GenerationConfig(val temperature: Double? = null, val topP: Double? = null, val topK: Float? = null, val candidateCount: Int? = null, val maxOutputTokens: Int? = null, val stopSequences: List<String>? = null, val responseMimeType: String? = null, val responseSchema: Schema? = null, val responseModalities: List<Modality>? = null, val seed: Int? = null, val presencePenalty: Double? = null, val frequencyPenalty: Double? = null, val responseLogprobs: Boolean? = null, val logprobs: Int? = null, val enableEnhancedCivicAnswers: Boolean? = null, val speechConfig: SpeechConfig? = null, val thinkingConfig: ThinkingConfig? = null, val mediaResolution: MediaResolution? = null)(source)

Configuration options for text generation.

Constructors

Link copied to clipboard
constructor(temperature: Double? = null, topP: Double? = null, topK: Float? = null, candidateCount: Int? = null, maxOutputTokens: Int? = null, stopSequences: List<String>? = null, responseMimeType: String? = null, responseSchema: Schema? = null, responseModalities: List<Modality>? = null, seed: Int? = null, presencePenalty: Double? = null, frequencyPenalty: Double? = null, responseLogprobs: Boolean? = null, logprobs: Int? = null, enableEnhancedCivicAnswers: Boolean? = null, speechConfig: SpeechConfig? = null, thinkingConfig: ThinkingConfig? = null, mediaResolution: MediaResolution? = null)

Properties

Link copied to clipboard

The number of candidates to generate.

Link copied to clipboard

Whether to enable enhanced civic answers.

Link copied to clipboard

Penalty for token frequency.

Link copied to clipboard

Number of log probabilities to include.

Link copied to clipboard

The maximum number of tokens to generate.

Link copied to clipboard

Resolution for media generation.

Link copied to clipboard

Penalty for token presence.

Link copied to clipboard

Whether to include log probabilities in the response.

Link copied to clipboard

The MIME type of the response.

Link copied to clipboard

The modalities for the response.

Link copied to clipboard

The schema for the response.

Link copied to clipboard
val seed: Int?

A seed to use for random sampling.

Link copied to clipboard

Configuration for speech generation.

Link copied to clipboard

Sequences where the model will stop generating further tokens.

Link copied to clipboard

Controls the randomness of the output.

Link copied to clipboard

Configuration for thinking.

Link copied to clipboard
val topK: Float?

Controls diversity via top-k sampling.

Link copied to clipboard
val topP: Double?

Controls diversity via nucleus sampling.