Class LiveClientRealtimeInput
-
- All Implemented Interfaces:
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).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classLiveClientRealtimeInput.BuilderBuilder for LiveClientRealtimeInput.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description LiveClientRealtimeInput()
-
Method Summary
Modifier and Type Method Description abstract Optional<List<Blob>>mediaChunks()Inlined bytes data for media input. abstract Optional<Blob>audio()The realtime audio input stream. abstract Optional<Boolean>audioStreamEnd()Indicates that the audio stream has ended, e.g. abstract Optional<Blob>video()The realtime video input stream. abstract Optional<String>text()The realtime text input stream. abstract Optional<ActivityStart>activityStart()Marks the start of user activity. abstract Optional<ActivityEnd>activityEnd()Marks the end of user activity. static LiveClientRealtimeInput.Builderbuilder()Instantiates a builder for LiveClientRealtimeInput. abstract LiveClientRealtimeInput.BuildertoBuilder()Creates a builder with the same values as this instance. static LiveClientRealtimeInputfromJson(String jsonString)Deserializes a JSON string to a LiveClientRealtimeInput 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
-
mediaChunks
abstract Optional<List<Blob>> mediaChunks()
Inlined bytes data for media input.
-
audioStreamEnd
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.
-
activityStart
abstract Optional<ActivityStart> activityStart()
Marks the start of user activity.
-
activityEnd
abstract Optional<ActivityEnd> activityEnd()
Marks the end of user activity.
-
builder
static LiveClientRealtimeInput.Builder builder()
Instantiates a builder for LiveClientRealtimeInput.
-
toBuilder
abstract LiveClientRealtimeInput.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static LiveClientRealtimeInput fromJson(String jsonString)
Deserializes a JSON string to a LiveClientRealtimeInput object.
-
-
-
-