Class LiveConnectConfig

java.lang.Object
com.google.genai.JsonSerializable
com.google.genai.types.LiveConnectConfig

public abstract class LiveConnectConfig extends JsonSerializable
Session config for the API connection.
  • Constructor Details

    • LiveConnectConfig

      public LiveConnectConfig()
  • Method Details

    • httpOptions

      public abstract Optional<HttpOptions> httpOptions()
      Used to override HTTP request options.
    • responseModalities

      public 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

      public 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

      public 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

      public 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

      public abstract Optional<Integer> maxOutputTokens()
      Maximum number of tokens that can be generated in the response.
    • mediaResolution

      public abstract Optional<MediaResolution> mediaResolution()
      If specified, the media resolution specified will be used.
    • seed

      public 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

      public abstract Optional<SpeechConfig> speechConfig()
      The speech generation configuration.
    • enableAffectiveDialog

      public abstract Optional<Boolean> enableAffectiveDialog()
      If enabled, the model will detect emotions and adapt its responses accordingly.
    • systemInstruction

      public 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

      public 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

      public abstract Optional<SessionResumptionConfig> sessionResumption()
      Configures session resumption mechanism.

      If included the server will send SessionResumptionUpdate messages.

    • inputAudioTranscription

      public abstract Optional<AudioTranscriptionConfig> inputAudioTranscription()
      The transcription of the input aligns with the input audio language.
    • outputAudioTranscription

      public abstract Optional<AudioTranscriptionConfig> outputAudioTranscription()
      The transcription of the output aligns with the language code specified for the output audio.
    • realtimeInputConfig

      public abstract Optional<RealtimeInputConfig> realtimeInputConfig()
      Configures the realtime input behavior in BidiGenerateContent.
    • contextWindowCompression

      public abstract Optional<ContextWindowCompressionConfig> contextWindowCompression()
      Configures context window compression mechanism.

      If included, server will compress context window to fit into given length.

    • proactivity

      public 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.
    • builder

      public static LiveConnectConfig.Builder builder()
      Instantiates a builder for LiveConnectConfig.
    • toBuilder

      public abstract LiveConnectConfig.Builder toBuilder()
      Creates a builder with the same values as this instance.
    • fromJson

      public static LiveConnectConfig fromJson(String jsonString)
      Deserializes a JSON string to a LiveConnectConfig object.