Firebase.AI.LiveGenerationConfig

A struct defining model parameters to be used when generating live session content.

Summary

Warning: This API is in Public Preview, which means that the feature is not subject to any SLA or deprecation policy and could change in backwards-incompatible ways.

Constructors and Destructors

LiveGenerationConfig(SpeechConfig? speechConfig, IEnumerable< ResponseModality > responseModalities, float? temperature, float? topP, float? topK, int? maxOutputTokens, float? presencePenalty, float? frequencyPenalty, AudioTranscriptionConfig? inputAudioTranscription, AudioTranscriptionConfig? outputAudioTranscription, ContextWindowCompressionConfig? contextWindowCompression, RealtimeInputConfig? realtimeInputConfig)
Creates a new LiveGenerationConfig value.

Public functions

LiveGenerationConfig

 Firebase::AI::LiveGenerationConfig::LiveGenerationConfig(
  SpeechConfig? speechConfig,
  IEnumerable< ResponseModality > responseModalities,
  float? temperature,
  float? topP,
  float? topK,
  int? maxOutputTokens,
  float? presencePenalty,
  float? frequencyPenalty,
  AudioTranscriptionConfig? inputAudioTranscription,
  AudioTranscriptionConfig? outputAudioTranscription,
  ContextWindowCompressionConfig? contextWindowCompression,
  RealtimeInputConfig? realtimeInputConfig
)

Creates a new LiveGenerationConfig value.

See the Configure model parameters guide and the Cloud documentation for more details.

Details
Parameters
speechConfig
The speech configuration to use if generating audio output.

Details
Parameters
responseModalities
A list of response types to receive from the model. Note: Currently only supports being provided one type, despite being a list.

Controls the randomness of the language model's output. Higher values (for example, 1.0) make the text more random and creative, while lower values (for example, 0.1) make it more focused and deterministic.

Details
Parameters
temperature
Deprecated: Not supported in Gemini 3.x and later models. The model will ignore this parameter if it's included in a request. Omit this parameter and let the model manage sampling automatically.

Note: A temperature of 0 means that the highest probability tokens are always selected. In this case, responses for a given prompt are mostly deterministic, but a small amount of variation is still possible.

Important: The range of supported temperature values depends on the model; see the Cloud documentation for more details.

Controls diversity of generated text. Higher values (e.g., 0.9) produce more diverse text, while lower values (e.g., 0.5) make the output more focused.

Details
Parameters
topP
Deprecated: Not supported in Gemini 3.x and later models. The model will ignore this parameter if it's included in a request. Omit this parameter and let the model manage sampling automatically.

The supported range is 0.0 to 1.0.

Important: The default topP value depends on the model; see the Cloud documentation for more details.

Limits the number of highest probability words the model considers when generating text. For example, a topK of 40 means only the 40 most likely words are considered for the next token. A higher value increases diversity, while a lower value makes the output more deterministic.

Details
Parameters
topK
Deprecated: Not supported in Gemini 3.x and later models. The model will ignore this parameter if it's included in a request. Omit this parameter and let the model manage sampling automatically.

The supported range is 1 to 40.

Important: Support for topK and the default value depends on the model; see the Cloud documentation for more details.

Details
Parameters
maxOutputTokens
Maximum number of tokens that can be generated in the response. See the configure model parameters documentation for more details.

Controls the likelihood of repeating the same words or phrases already generated in the text. Higher values increase the penalty of repetition, resulting in more diverse output.

Details
Parameters
presencePenalty
Deprecated: Not supported in Gemini 3.x and later models. Requests that include this parameter will fail with a 400 error. Omit this parameter.

Note: While both presencePenalty and frequencyPenalty discourage repetition, presencePenalty applies the same penalty regardless of how many times the word/phrase has already appeared, whereas frequencyPenalty increases the penalty for each repetition of a word/phrase.

Important: The range of supported presencePenalty values depends on the model; see the Cloud documentation for more details.

Controls the likelihood of repeating words or phrases, with the penalty increasing for each repetition. Higher values increase the penalty of repetition, resulting in more diverse output.

Details
Parameters
frequencyPenalty
Deprecated: Not supported in Gemini 3.x and later models. Requests that include this parameter will fail with a 400 error. Omit this parameter.

Note: While both frequencyPenalty and presencePenalty discourage repetition, frequencyPenalty increases the penalty for each repetition of a word/phrase, whereas presencePenalty applies the same penalty regardless of how many times the word/phrase has already appeared.

Important: The range of supported frequencyPenalty values depends on the model; see the Cloud documentation for more details.

Details
Parameters
stopSequences
A set of up to 5 Strings that will stop output generation. If specified, the API will stop at the first appearance of a stop sequence. The stop sequence will not be included as part of the response. See the Cloud documentation for more details.
realtimeInputConfig
Configures model input behavior in the Live API (e.g. voice activity detection).