Class LiveClientRealtimeInput
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).
public record LiveClientRealtimeInput : IEquatable<LiveClientRealtimeInput>
- Inheritance
-
LiveClientRealtimeInput
- Implements
- Inherited Members
Properties
ActivityEnd
Marks the end of user activity.
[JsonPropertyName("activityEnd")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ActivityEnd? ActivityEnd { get; set; }
Property Value
ActivityStart
Marks the start of user activity.
[JsonPropertyName("activityStart")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ActivityStart? ActivityStart { get; set; }
Property Value
Audio
The realtime audio input stream.
[JsonPropertyName("audio")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Blob? Audio { get; set; }
Property Value
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.
[JsonPropertyName("audioStreamEnd")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? AudioStreamEnd { get; set; }
Property Value
- bool?
MediaChunks
Inlined bytes data for media input.
[JsonPropertyName("mediaChunks")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<Blob>? MediaChunks { get; set; }
Property Value
Text
The realtime text input stream.
[JsonPropertyName("text")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Text { get; set; }
Property Value
Video
The realtime video input stream.
[JsonPropertyName("video")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Blob? Video { get; set; }
Property Value
Methods
FromJson(string, JsonSerializerOptions?)
Deserializes a JSON string to a LiveClientRealtimeInput object.
public static LiveClientRealtimeInput? FromJson(string jsonString, JsonSerializerOptions? options = null)
Parameters
jsonStringstringThe JSON string to deserialize.
optionsJsonSerializerOptionsOptional JsonSerializerOptions.
Returns
- LiveClientRealtimeInput
The deserialized LiveClientRealtimeInput object, or null if deserialization fails.