Class LiveServerSessionResumptionUpdate
Update of the session resumption state. Only sent if session_resumption was set in the
connection config.
public record LiveServerSessionResumptionUpdate : IEquatable<LiveServerSessionResumptionUpdate>
- Inheritance
-
LiveServerSessionResumptionUpdate
- Implements
- Inherited Members
Properties
LastConsumedClientMessageIndex
Index of last message sent by client that is included in state represented by this
SessionResumptionToken. Only sent when SessionResumptionConfig.transparent is set.
Presence of this index allows users to transparently reconnect and avoid issue of losing
some part of realtime audio input/video. If client wishes to temporarily disconnect (for
example as result of receiving GoAway) they can do it without losing state by buffering
messages sent since last SessionResumptionTokenUpdate. This field will enable them to
limit buffering (avoid keeping all requests in RAM). Note: This should not be used for when
resuming a session at some time later -- in those cases partial audio and video frames are
likely not needed.
[JsonPropertyName("lastConsumedClientMessageIndex")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonConverter(typeof(StringToNullableLongConverter))]
public long? LastConsumedClientMessageIndex { get; set; }
Property Value
- long?
NewHandle
New handle that represents state that can be resumed. Empty if resumable=false.
[JsonPropertyName("newHandle")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? NewHandle { get; set; }
Property Value
Resumable
True if session can be resumed at this point. It might be not possible to resume session at some points. In that case we send update empty new_handle and resumable=false. Example of such case could be model executing function calls or just generating. Resuming session (using previous session token) in such state will result in some data loss.
[JsonPropertyName("resumable")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? Resumable { get; set; }
Property Value
- bool?
Methods
FromJson(string, JsonSerializerOptions?)
Deserializes a JSON string to a LiveServerSessionResumptionUpdate object.
public static LiveServerSessionResumptionUpdate? FromJson(string jsonString, JsonSerializerOptions? options = null)
Parameters
jsonStringstringThe JSON string to deserialize.
optionsJsonSerializerOptionsOptional JsonSerializerOptions.
Returns
- LiveServerSessionResumptionUpdate
The deserialized LiveServerSessionResumptionUpdate object, or null if deserialization fails.