Class LiveConnectConfig.Builder
- Enclosing class:
- LiveConnectConfig
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract LiveConnectConfigbuild()Clears the value of contextWindowCompression field.Clears the value of enableAffectiveDialog field.Clears the value of httpOptions field.Clears the value of inputAudioTranscription field.Clears the value of maxOutputTokens field.Clears the value of mediaResolution field.Clears the value of outputAudioTranscription field.Clears the value of proactivity field.Clears the value of realtimeInputConfig field.Clears the value of responseModalities field.Clears the value of seed field.Clears the value of sessionResumption field.Clears the value of speechConfig field.Clears the value of systemInstruction field.Clears the value of temperature field.Clears the value of thinkingConfig field.Clears the value of tools field.Clears the value of topK field.Clears the value of topP field.abstract LiveConnectConfig.BuildercontextWindowCompression(ContextWindowCompressionConfig contextWindowCompression) Setter for contextWindowCompression.contextWindowCompression(ContextWindowCompressionConfig.Builder contextWindowCompressionBuilder) Setter for contextWindowCompression builder.abstract LiveConnectConfig.BuilderenableAffectiveDialog(boolean enableAffectiveDialog) Setter for enableAffectiveDialog.abstract LiveConnectConfig.BuilderhttpOptions(HttpOptions httpOptions) Setter for httpOptions.httpOptions(HttpOptions.Builder httpOptionsBuilder) Setter for httpOptions builder.abstract LiveConnectConfig.BuilderinputAudioTranscription(AudioTranscriptionConfig inputAudioTranscription) Setter for inputAudioTranscription.inputAudioTranscription(AudioTranscriptionConfig.Builder inputAudioTranscriptionBuilder) Setter for inputAudioTranscription builder.abstract LiveConnectConfig.BuildermaxOutputTokens(Integer maxOutputTokens) Setter for maxOutputTokens.abstract LiveConnectConfig.BuildermediaResolution(MediaResolution mediaResolution) Setter for mediaResolution.mediaResolution(MediaResolution.Known knownType) Setter for mediaResolution given a known enum.mediaResolution(String mediaResolution) Setter for mediaResolution given a string.abstract LiveConnectConfig.BuilderoutputAudioTranscription(AudioTranscriptionConfig outputAudioTranscription) Setter for outputAudioTranscription.outputAudioTranscription(AudioTranscriptionConfig.Builder outputAudioTranscriptionBuilder) Setter for outputAudioTranscription builder.abstract LiveConnectConfig.Builderproactivity(ProactivityConfig proactivity) Setter for proactivity.proactivity(ProactivityConfig.Builder proactivityBuilder) Setter for proactivity builder.abstract LiveConnectConfig.BuilderrealtimeInputConfig(RealtimeInputConfig realtimeInputConfig) Setter for realtimeInputConfig.realtimeInputConfig(RealtimeInputConfig.Builder realtimeInputConfigBuilder) Setter for realtimeInputConfig builder.responseModalities(Modality... responseModalities) Setter for responseModalities.responseModalities(Modality.Known... knownTypes) Setter for responseModalities given a varargs of known enums.responseModalities(String... responseModalities) Setter for responseModalities given a varargs of strings.abstract LiveConnectConfig.BuilderresponseModalities(List<Modality> responseModalities) Setter for responseModalities.responseModalitiesFromKnown(List<Modality.Known> knownTypes) Setter for responseModalities given a list of known enums.responseModalitiesFromString(List<String> responseModalities) Setter for responseModalities given a list of strings.abstract LiveConnectConfig.BuilderSetter for seed.abstract LiveConnectConfig.BuildersessionResumption(SessionResumptionConfig sessionResumption) Setter for sessionResumption.sessionResumption(SessionResumptionConfig.Builder sessionResumptionBuilder) Setter for sessionResumption builder.abstract LiveConnectConfig.BuilderspeechConfig(SpeechConfig speechConfig) Setter for speechConfig.speechConfig(SpeechConfig.Builder speechConfigBuilder) Setter for speechConfig builder.abstract LiveConnectConfig.BuildersystemInstruction(Content systemInstruction) Setter for systemInstruction.systemInstruction(Content.Builder systemInstructionBuilder) Setter for systemInstruction builder.abstract LiveConnectConfig.Buildertemperature(Float temperature) Setter for temperature.abstract LiveConnectConfig.BuilderthinkingConfig(ThinkingConfig thinkingConfig) Setter for thinkingConfig.thinkingConfig(ThinkingConfig.Builder thinkingConfigBuilder) Setter for thinkingConfig builder.Setter for tools.tools(Tool.Builder... toolsBuilders) Setter for tools builder.abstract LiveConnectConfig.BuilderSetter for tools.abstract LiveConnectConfig.BuilderSetter for topK.abstract LiveConnectConfig.BuilderSetter for topP.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
httpOptions
Setter for httpOptions.httpOptions: Used to override HTTP request options.
-
httpOptions
@CanIgnoreReturnValue public LiveConnectConfig.Builder httpOptions(HttpOptions.Builder httpOptionsBuilder) Setter for httpOptions builder.httpOptions: Used to override HTTP request options.
-
clearHttpOptions
Clears the value of httpOptions field. -
responseModalities
Setter for responseModalities.responseModalities: The requested modalities of the response. Represents the set of modalities that the model can return. Defaults to AUDIO if not specified.
-
responseModalities
@CanIgnoreReturnValue public LiveConnectConfig.Builder responseModalities(Modality... responseModalities) Setter for responseModalities.responseModalities: The requested modalities of the response. Represents the set of modalities that the model can return. Defaults to AUDIO if not specified.
-
clearResponseModalities
Clears the value of responseModalities field. -
responseModalities
@CanIgnoreReturnValue public LiveConnectConfig.Builder responseModalities(String... responseModalities) Setter for responseModalities given a varargs of strings.responseModalities: The requested modalities of the response. Represents the set of modalities that the model can return. Defaults to AUDIO if not specified.
-
responseModalities
@CanIgnoreReturnValue public LiveConnectConfig.Builder responseModalities(Modality.Known... knownTypes) Setter for responseModalities given a varargs of known enums.responseModalities: The requested modalities of the response. Represents the set of modalities that the model can return. Defaults to AUDIO if not specified.
-
responseModalitiesFromKnown
@CanIgnoreReturnValue public LiveConnectConfig.Builder responseModalitiesFromKnown(List<Modality.Known> knownTypes) Setter for responseModalities given a list of known enums.responseModalities: The requested modalities of the response. Represents the set of modalities that the model can return. Defaults to AUDIO if not specified.
-
responseModalitiesFromString
@CanIgnoreReturnValue public LiveConnectConfig.Builder responseModalitiesFromString(List<String> responseModalities) Setter for responseModalities given a list of strings.responseModalities: The requested modalities of the response. Represents the set of modalities that the model can return. Defaults to AUDIO if not specified.
-
temperature
Setter for temperature.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.
-
clearTemperature
Clears the value of temperature field. -
topP
Setter for topP.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.
-
clearTopP
Clears the value of topP field. -
topK
Setter for topK.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.
-
clearTopK
Clears the value of topK field. -
maxOutputTokens
Setter for maxOutputTokens.maxOutputTokens: Maximum number of tokens that can be generated in the response.
-
clearMaxOutputTokens
Clears the value of maxOutputTokens field. -
mediaResolution
Setter for mediaResolution.mediaResolution: If specified, the media resolution specified will be used.
-
clearMediaResolution
Clears the value of mediaResolution field. -
mediaResolution
@CanIgnoreReturnValue public LiveConnectConfig.Builder mediaResolution(MediaResolution.Known knownType) Setter for mediaResolution given a known enum.mediaResolution: If specified, the media resolution specified will be used.
-
mediaResolution
Setter for mediaResolution given a string.mediaResolution: If specified, the media resolution specified will be used.
-
seed
Setter for seed.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.
-
clearSeed
Clears the value of seed field. -
speechConfig
Setter for speechConfig.speechConfig: The speech generation configuration.
-
speechConfig
@CanIgnoreReturnValue public LiveConnectConfig.Builder speechConfig(SpeechConfig.Builder speechConfigBuilder) Setter for speechConfig builder.speechConfig: The speech generation configuration.
-
clearSpeechConfig
Clears the value of speechConfig field. -
thinkingConfig
Setter for thinkingConfig.thinkingConfig: Config for thinking features. An error will be returned if this field is set for models that don't support thinking.
-
thinkingConfig
@CanIgnoreReturnValue public LiveConnectConfig.Builder thinkingConfig(ThinkingConfig.Builder thinkingConfigBuilder) Setter for thinkingConfig builder.thinkingConfig: Config for thinking features. An error will be returned if this field is set for models that don't support thinking.
-
clearThinkingConfig
Clears the value of thinkingConfig field. -
enableAffectiveDialog
Setter for enableAffectiveDialog.enableAffectiveDialog: If enabled, the model will detect emotions and adapt its responses accordingly.
-
clearEnableAffectiveDialog
Clears the value of enableAffectiveDialog field. -
systemInstruction
Setter for systemInstruction.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.
-
systemInstruction
@CanIgnoreReturnValue public LiveConnectConfig.Builder systemInstruction(Content.Builder systemInstructionBuilder) Setter for systemInstruction builder.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.
-
clearSystemInstruction
Clears the value of systemInstruction field. -
tools
Setter for tools.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.
-
tools
Setter for tools.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.
-
tools
Setter for tools builder.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.
-
clearTools
Clears the value of tools field. -
sessionResumption
public abstract LiveConnectConfig.Builder sessionResumption(SessionResumptionConfig sessionResumption) Setter for sessionResumption.sessionResumption: Configures session resumption mechanism.
If included the server will send SessionResumptionUpdate messages.
-
sessionResumption
@CanIgnoreReturnValue public LiveConnectConfig.Builder sessionResumption(SessionResumptionConfig.Builder sessionResumptionBuilder) Setter for sessionResumption builder.sessionResumption: Configures session resumption mechanism.
If included the server will send SessionResumptionUpdate messages.
-
clearSessionResumption
Clears the value of sessionResumption field. -
inputAudioTranscription
public abstract LiveConnectConfig.Builder inputAudioTranscription(AudioTranscriptionConfig inputAudioTranscription) Setter for inputAudioTranscription.inputAudioTranscription: The transcription of the input aligns with the input audio language.
-
inputAudioTranscription
@CanIgnoreReturnValue public LiveConnectConfig.Builder inputAudioTranscription(AudioTranscriptionConfig.Builder inputAudioTranscriptionBuilder) Setter for inputAudioTranscription builder.inputAudioTranscription: The transcription of the input aligns with the input audio language.
-
clearInputAudioTranscription
Clears the value of inputAudioTranscription field. -
outputAudioTranscription
public abstract LiveConnectConfig.Builder outputAudioTranscription(AudioTranscriptionConfig outputAudioTranscription) Setter for outputAudioTranscription.outputAudioTranscription: The transcription of the output aligns with the language code specified for the output audio.
-
outputAudioTranscription
@CanIgnoreReturnValue public LiveConnectConfig.Builder outputAudioTranscription(AudioTranscriptionConfig.Builder outputAudioTranscriptionBuilder) Setter for outputAudioTranscription builder.outputAudioTranscription: The transcription of the output aligns with the language code specified for the output audio.
-
clearOutputAudioTranscription
Clears the value of outputAudioTranscription field. -
realtimeInputConfig
public abstract LiveConnectConfig.Builder realtimeInputConfig(RealtimeInputConfig realtimeInputConfig) Setter for realtimeInputConfig.realtimeInputConfig: Configures the realtime input behavior in BidiGenerateContent.
-
realtimeInputConfig
@CanIgnoreReturnValue public LiveConnectConfig.Builder realtimeInputConfig(RealtimeInputConfig.Builder realtimeInputConfigBuilder) Setter for realtimeInputConfig builder.realtimeInputConfig: Configures the realtime input behavior in BidiGenerateContent.
-
clearRealtimeInputConfig
Clears the value of realtimeInputConfig field. -
contextWindowCompression
public abstract LiveConnectConfig.Builder contextWindowCompression(ContextWindowCompressionConfig contextWindowCompression) Setter for contextWindowCompression.contextWindowCompression: Configures context window compression mechanism.
If included, server will compress context window to fit into given length.
-
contextWindowCompression
@CanIgnoreReturnValue public LiveConnectConfig.Builder contextWindowCompression(ContextWindowCompressionConfig.Builder contextWindowCompressionBuilder) Setter for contextWindowCompression builder.contextWindowCompression: Configures context window compression mechanism.
If included, server will compress context window to fit into given length.
-
clearContextWindowCompression
Clears the value of contextWindowCompression field. -
proactivity
Setter for proactivity.proactivity: Configures the proactivity of the model. This allows the model to respond proactively to the input and to ignore irrelevant input.
-
proactivity
@CanIgnoreReturnValue public LiveConnectConfig.Builder proactivity(ProactivityConfig.Builder proactivityBuilder) Setter for proactivity builder.proactivity: Configures the proactivity of the model. This allows the model to respond proactively to the input and to ignore irrelevant input.
-
clearProactivity
Clears the value of proactivity field. -
build
-