Class LiveServerSessionResumptionUpdate
-
- All Implemented Interfaces:
public abstract class LiveServerSessionResumptionUpdate extends JsonSerializable
Update of the session resumption state.
Only sent if `session_resumption` was set in the connection config.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classLiveServerSessionResumptionUpdate.BuilderBuilder for LiveServerSessionResumptionUpdate.
-
Field Summary
Fields Modifier and Type Field Description public final static StringMAX_READ_LENGTH_PROPERTY
-
Constructor Summary
Constructors Constructor Description LiveServerSessionResumptionUpdate()
-
Method Summary
Modifier and Type Method Description abstract Optional<String>newHandle()New handle that represents state that can be resumed. abstract Optional<Boolean>resumable()True if session can be resumed at this point. abstract Optional<Long>lastConsumedClientMessageIndex()Index of last message sent by client that is included in state represented by this SessionResumptionToken. static LiveServerSessionResumptionUpdate.Builderbuilder()Instantiates a builder for LiveServerSessionResumptionUpdate. abstract LiveServerSessionResumptionUpdate.BuildertoBuilder()Creates a builder with the same values as this instance. static LiveServerSessionResumptionUpdatefromJson(String jsonString)Deserializes a JSON string to a LiveServerSessionResumptionUpdate 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
-
newHandle
abstract Optional<String> newHandle()
New handle that represents state that can be resumed. Empty if `resumable`=false.
-
resumable
abstract Optional<Boolean> 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.
-
lastConsumedClientMessageIndex
abstract Optional<Long> 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 `SessionResmumptionTokenUpdate`. 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 arelikely not needed.
-
builder
static LiveServerSessionResumptionUpdate.Builder builder()
Instantiates a builder for LiveServerSessionResumptionUpdate.
-
toBuilder
abstract LiveServerSessionResumptionUpdate.Builder toBuilder()
Creates a builder with the same values as this instance.
-
fromJson
static LiveServerSessionResumptionUpdate fromJson(String jsonString)
Deserializes a JSON string to a LiveServerSessionResumptionUpdate object.
-
-
-
-