Class LiveClientRealtimeInput

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

public abstract class LiveClientRealtimeInput extends JsonSerializable
User input that is sent in real time.

This is different from `LiveClientContent` in a few ways:

- Can be sent continuously without interruption to model generation. - If there is a need to mix data interleaved across the `LiveClientContent` and the `LiveClientRealtimeInput`, server attempts to optimize for best response, but there are no guarantees. - End of turn is not explicitly specified, but is rather derived from user activity (for example, end of speech). - Even before the end of turn, the data is processed incrementally to optimize for a fast start of the response from the model. - Is always assumed to be the user's input (cannot be used to populate conversation history).

  • Constructor Details

    • LiveClientRealtimeInput

      public LiveClientRealtimeInput()
  • Method Details

    • mediaChunks

      public abstract Optional<List<Blob>> mediaChunks()
      Inlined bytes data for media input.
    • audio

      public abstract Optional<Blob> audio()
      The realtime audio input stream.
    • audioStreamEnd

      public abstract Optional<Boolean> audioStreamEnd()
      Indicates that the audio stream has ended, e.g. because the microphone was turned off.

      This should only be sent when automatic activity detection is enabled (which is the default).

      The client can reopen the stream by sending an audio message.

    • video

      public abstract Optional<Blob> video()
      The realtime video input stream.
    • text

      public abstract Optional<String> text()
      The realtime text input stream.
    • activityStart

      public abstract Optional<ActivityStart> activityStart()
      Marks the start of user activity.
    • activityEnd

      public abstract Optional<ActivityEnd> activityEnd()
      Marks the end of user activity.
    • builder

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

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

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