Class LiveConnectConfig
-
- All Implemented Interfaces:
public abstract class LiveConnectConfig extends JsonSerializable
Session config for the API connection.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classLiveConnectConfig.BuilderBuilder for LiveConnectConfig.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description LiveConnectConfig()
-
Method Summary
Modifier and Type Method Description abstract Optional<HttpOptions>httpOptions()Used to override HTTP request options. abstract Optional<List<Modality>>responseModalities()The requested modalities of the response. abstract Optional<Float>temperature()Value that controls the degree of randomness in token selection. abstract Optional<Float>topP()Tokens are selected from the most to least probable until the sum of their probabilities equals this value. abstract Optional<Float>topK()For each token selection step, the ``top_k`` tokens with the highest probabilities are sampled. abstract Optional<Integer>maxOutputTokens()Maximum number of tokens that can be generated in the response. abstract Optional<MediaResolution>mediaResolution()If specified, the media resolution specified will be used. abstract Optional<Integer>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<SpeechConfig>speechConfig()The speech generation configuration. abstract Optional<ThinkingConfig>thinkingConfig()Config for thinking features. abstract Optional<Boolean>enableAffectiveDialog()If enabled, the model will detect emotions and adapt its responses accordingly. abstract Optional<Content>systemInstruction()The user provided system instructions for the model. abstract Optional<List<Tool>>tools()A list of `Tools` the model may use to generate the next response. abstract Optional<SessionResumptionConfig>sessionResumption()Configures session resumption mechanism. abstract Optional<AudioTranscriptionConfig>inputAudioTranscription()The transcription of the input aligns with the input audio language. abstract Optional<AudioTranscriptionConfig>outputAudioTranscription()The transcription of the output aligns with the language code specified for the output audio. abstract Optional<RealtimeInputConfig>realtimeInputConfig()Configures the realtime input behavior in BidiGenerateContent. abstract Optional<ContextWindowCompressionConfig>contextWindowCompression()Configures context window compression mechanism. abstract Optional<ProactivityConfig>proactivity()Configures the proactivity of the model. abstract Optional<Boolean>explicitVadSignal()Configures the explicit VAD signal. abstract Optional<AvatarConfig>avatarConfig()Configures the avatar model behavior. abstract Optional<List<SafetySetting>>safetySettings()Safety settings in the request to block unsafe content in the response. static LiveConnectConfig.Builderbuilder()Instantiates a builder for LiveConnectConfig. abstract LiveConnectConfig.BuildertoBuilder()Creates a builder with the same values as this instance. static LiveConnectConfigfromJson(String jsonString)Deserializes a JSON string to a LiveConnectConfig object. -
Methods inherited from class com.google.genai.JsonSerializable
fromJsonNode, fromJsonString, objectMapper, setMaxReadLength, stringToJsonNode, toJson, toJsonNode, toJsonString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
httpOptions
abstract Optional<HttpOptions> httpOptions()
Used to override HTTP request options.
-
responseModalities
abstract Optional<List<Modality>> responseModalities()
The requested modalities of the response. Represents the set of modalities that the model can return. Defaults to AUDIO if not specified.
-
temperature
abstract Optional<Float> 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
abstract Optional<Float> 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
abstract Optional<Float> 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
abstract Optional<Integer> maxOutputTokens()
Maximum number of tokens that can be generated in the response.
-
mediaResolution
abstract Optional<MediaResolution> mediaResolution()
If specified, the media resolution specified will be used.
-
seed
abstract Optional<Integer> 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
abstract Optional<SpeechConfig> speechConfig()
The speech generation configuration.
-
thinkingConfig
abstract Optional<ThinkingConfig> thinkingConfig()
Config for thinking features. An error will be returned if this field is set for models that don't support thinking.
-
enableAffectiveDialog
abstract Optional<Boolean> enableAffectiveDialog()
If enabled, the model will detect emotions and adapt its responses accordingly.
-
systemInstruction
abstract Optional<Content> 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
abstract Optional<List<Tool>> 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
abstract Optional<SessionResumptionConfig> sessionResumption()
Configures session resumption mechanism.
If included the server will send SessionResumptionUpdate messages.
-
inputAudioTranscription
abstract Optional<AudioTranscriptionConfig> inputAudioTranscription()
The transcription of the input aligns with the input audio language.
-
outputAudioTranscription
abstract Optional<AudioTranscriptionConfig> outputAudioTranscription()
The transcription of the output aligns with the language code specified for the output audio.
-
realtimeInputConfig
abstract Optional<RealtimeInputConfig> realtimeInputConfig()
Configures the realtime input behavior in BidiGenerateContent.
-
contextWindowCompression
abstract Optional<ContextWindowCompressionConfig> contextWindowCompression()
Configures context window compression mechanism.
If included, server will compress context window to fit into given length.
-
proactivity
abstract Optional<ProactivityConfig> proactivity()
Configures the proactivity of the model. This allows the model to respond proactively to the input and to ignore irrelevant input.
-
explicitVadSignal
abstract Optional<Boolean> explicitVadSignal()
Configures the explicit VAD signal. If enabled, the client will send vad_signal to indicate the start and end of speech. This allows the server to process the audio more efficiently.
-
avatarConfig
abstract Optional<AvatarConfig> avatarConfig()
Configures the avatar model behavior.
-
safetySettings
abstract Optional<List<SafetySetting>> safetySettings()
Safety settings in the request to block unsafe content in the response.
-
builder
static LiveConnectConfig.Builder builder()
Instantiates a builder for LiveConnectConfig.
-
toBuilder
abstract LiveConnectConfig.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static LiveConnectConfig fromJson(String jsonString)
Deserializes a JSON string to a LiveConnectConfig object.
-
-
-
-