Package com.google.genai.types
Class LiveConnectConfig
java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.LiveConnectConfig
Session config for the API connection.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Builder for LiveConnectConfig. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic LiveConnectConfig.Builder
builder()
Instantiates a builder for LiveConnectConfig.abstract Optional<ContextWindowCompressionConfig>
Configures context window compression mechanism.If enabled, the model will detect emotions and adapt its responses accordingly.static LiveConnectConfig
Deserializes a JSON string to a LiveConnectConfig object.abstract Optional<HttpOptions>
Used to override HTTP request options.abstract Optional<AudioTranscriptionConfig>
The transcription of the input aligns with the input audio language.Maximum number of tokens that can be generated in the response.abstract Optional<MediaResolution>
If specified, the media resolution specified will be used.abstract Optional<AudioTranscriptionConfig>
The transcription of the output aligns with the language code specified for the output audio.abstract Optional<ProactivityConfig>
Configures the proactivity of the model.abstract Optional<RealtimeInputConfig>
Configures the realtime input behavior in BidiGenerateContent.The requested modalities of the response.seed()
When ``seed`` is fixed to a specific number, the model makes a best effort to provide the same response for repeated requests.abstract Optional<SessionResumptionConfig>
Configures session resumption mechanism.abstract Optional<SpeechConfig>
The speech generation configuration.The user provided system instructions for the model.Value that controls the degree of randomness in token selection.abstract LiveConnectConfig.Builder
Creates a builder with the same values as this instance.tools()
A list of `Tools` the model may use to generate the next response.topK()
For each token selection step, the ``top_k`` tokens with the highest probabilities are sampled.topP()
Tokens are selected from the most to least probable until the sum of their probabilities equals this value.Methods inherited from class com.google.genai.JsonSerializable
stringToJsonNode, toJson
-
Constructor Details
-
LiveConnectConfig
public LiveConnectConfig()
-
-
Method Details
-
httpOptions
Used to override HTTP request options. -
responseModalities
The requested modalities of the response. Represents the set of modalities that the model can return. Defaults to AUDIO if not specified. -
temperature
Value that controls the degree of randomness in token selection. Lower temperatures are good for prompts that require a less open-ended or creative response, while higher temperatures can lead to more diverse or creative results. -
topP
Tokens are selected from the most to least probable until the sum of their probabilities equals this value. Use a lower value for less random responses and a higher value for more random responses. -
topK
For each token selection step, the ``top_k`` tokens with the highest probabilities are sampled. Then tokens are further filtered based on ``top_p`` with the final token selected using temperature sampling. Use a lower number for less random responses and a higher number for more random responses. -
maxOutputTokens
Maximum number of tokens that can be generated in the response. -
mediaResolution
If specified, the media resolution specified will be used. -
seed
When ``seed`` is fixed to a specific number, the model makes a best effort to provide the same response for repeated requests. By default, a random number is used. -
speechConfig
The speech generation configuration. -
enableAffectiveDialog
If enabled, the model will detect emotions and adapt its responses accordingly. -
systemInstruction
The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph. -
tools
A list of `Tools` the model may use to generate the next response.A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.
-
sessionResumption
Configures session resumption mechanism.If included the server will send SessionResumptionUpdate messages.
-
inputAudioTranscription
The transcription of the input aligns with the input audio language. -
outputAudioTranscription
The transcription of the output aligns with the language code specified for the output audio. -
realtimeInputConfig
Configures the realtime input behavior in BidiGenerateContent. -
contextWindowCompression
Configures context window compression mechanism.If included, server will compress context window to fit into given length.
-
proactivity
Configures the proactivity of the model. This allows the model to respond proactively to the input and to ignore irrelevant input. -
builder
Instantiates a builder for LiveConnectConfig. -
toBuilder
Creates a builder with the same values as this instance. -
fromJson
Deserializes a JSON string to a LiveConnectConfig object.
-