LiveGenerationConfig
@available(watchOS, unavailable)
public struct LiveGenerationConfig : SendableConfiguration options for live content generation.
-
init(temperature:topP:topK:candidateCount:maxOutputTokens:presencePenalty:frequencyPenalty:responseModalities:speech:inputAudioTranscription:outputAudioTranscription:contextWindowCompression:realtimeInputConfig:)
Creates a new
LiveGenerationConfigvalue.See the Configure model parameters guide for more details.
Declaration
Swift
@available(*, deprecated, message: "candidateCount, temperature, topP, topK, presencePenalty, and frequencyPenalty are unsupported in Gemini 3.x and later models.") public init(temperature: Float? = nil, topP: Float? = nil, topK: Int? = nil, candidateCount: Int? = nil, maxOutputTokens: Int? = nil, presencePenalty: Float? = nil, frequencyPenalty: Float? = nil, responseModalities: [ResponseModality]? = nil, speech: SpeechConfig? = nil, inputAudioTranscription: AudioTranscriptionConfig? = nil, outputAudioTranscription: AudioTranscriptionConfig? = nil, contextWindowCompression: ContextWindowCompressionConfig? = nil, realtimeInputConfig: RealtimeInputConfig? = nil)Parameters
maxOutputTokensMaximum number of tokens that can be generated in the response. See configure model parameters.
responseModalitiesThe data types (modalities) that may be returned in model responses.
speechControls the voice of the model, when streaming
audioviaResponseModality.inputAudioTranscriptionConfigures (and enables) input transcriptions when streaming to the model.
outputAudioTranscriptionConfigures (and enables) output transcriptions when streaming to the model.
contextWindowCompressionEnables context window compression to manage the model's context window.
realtimeInputConfigConfigures model input behavior when generating content via the realtime supported methods
-
init(maxOutputTokens:responseModalities:speech:inputAudioTranscription:outputAudioTranscription:contextWindowCompression:realtimeInputConfig:)
Creates a new
LiveGenerationConfigvalue.See the Configure model parameters guide for more details.
Declaration
Swift
public init(maxOutputTokens: Int? = nil, responseModalities: [ResponseModality]? = nil, speech: SpeechConfig? = nil, inputAudioTranscription: AudioTranscriptionConfig? = nil, outputAudioTranscription: AudioTranscriptionConfig? = nil, contextWindowCompression: ContextWindowCompressionConfig? = nil, realtimeInputConfig: RealtimeInputConfig? = nil)Parameters
maxOutputTokensMaximum number of tokens that can be generated in the response. See configure model parameters.
responseModalitiesThe data types (modalities) that may be returned in model responses. See configure model parameters.
speechControls the voice of the model, when streaming
audioviaResponseModality.inputAudioTranscriptionConfigures (and enables) input transcriptions when streaming to the model.
outputAudioTranscriptionConfigures (and enables) output transcriptions when streaming to the model.
contextWindowCompressionEnables context window compression to manage the model's context window.
realtimeInputConfigConfigures model input behavior when generating content via the realtime supported methods