@@ -29,6 +29,7 @@ export declare class LiveSession
2929
3030| Property | Modifiers | Type | Description |
3131| --- | --- | --- | --- |
32+ | [connectionPromise ](./ai .livesession .md #livesessionconnectionpromise ) | | Promise < ;void > ; | <b ><i >(Public Preview )</i ></b > Allows external code to await the opening of the WebSocket connection . |
3233| [inConversation ](./ai .livesession .md #livesessioninconversation ) | | boolean | <b ><i >(Public Preview )</i ></b > Indicates whether this Live session is being controlled by an <code >AudioConversationController </code >. |
3334| [isClosed ](./ai .livesession .md #livesessionisclosed ) | | boolean | <b ><i >(Public Preview )</i ></b > Indicates whether this Live session is closed . |
3435
@@ -38,6 +39,7 @@ export declare class LiveSession
3839| --- | --- | --- |
3940| [close ()](./ai .livesession .md #livesessionclose ) | | <b ><i >(Public Preview )</i ></b > Closes this session . All methods on this session will throw an error once this resolves . |
4041| [receive ()](./ai .livesession .md #livesessionreceive ) | | <b ><i >(Public Preview )</i ></b > Yields messages received from the server . This can only be used by one consumer at a time . |
42+ | [resumeSession (sessionResumption )](./ai .livesession .md #livesessionresumesession ) | | <b ><i >(Public Preview )</i ></b > Resumes an existing live session with the server .<!-- -->This closes the current WebSocket connection and establishes a new one using the same configuration (URI , headers , model , system instruction , tools , etc .) as the original session . |
4143| [send (request , turnComplete )](./ai .livesession .md #livesessionsend ) | | <b ><i >(Public Preview )</i ></b > Sends content to the server . |
4244| [sendAudioRealtime (blob )](./ai .livesession .md #livesessionsendaudiorealtime ) | | <b ><i >(Public Preview )</i ></b > Sends audio data to the server in realtime . |
4345| [sendFunctionResponses (functionResponses )](./ai .livesession .md #livesessionsendfunctionresponses ) | | <b ><i >(Public Preview )</i ></b > Sends function responses to the server . |
@@ -46,6 +48,19 @@ export declare class LiveSession
4648| [sendTextRealtime (text )](./ai .livesession .md #livesessionsendtextrealtime ) | | <b ><i >(Public Preview )</i ></b > Sends text to the server in realtime . |
4749| [sendVideoRealtime (blob )](./ai .livesession .md #livesessionsendvideorealtime ) | | <b ><i >(Public Preview )</i ></b > Sends video data to the server in realtime . |
4850
51+ ## LiveSession .connectionPromise
52+
53+ > This API is provided as a preview for developers and may change based on feedback that we receive . Do not use this API in a production environment .
54+ >
55+
56+ Allows external code to await the opening of the WebSocket connection .
57+
58+ <b >Signature :</b >
59+
60+ ```typescript
61+ connectionPromise : Promise <void >;
62+ ```
63+
4964## LiveSession .inConversation
5065
5166> This API is provided as a preview for developers and may change based on feedback that we receive . Do not use this API in a production environment .
@@ -98,18 +113,47 @@ Yields messages received from the server. This can only be used by one consumer
98113<b >Signature :</b >
99114
100115```typescript
101- receive (): AsyncGenerator <LiveServerContent | LiveServerToolCall | LiveServerToolCallCancellation | LiveServerGoingAwayNotice >;
116+ receive (): AsyncGenerator <LiveServerContent | LiveServerToolCall | LiveServerToolCallCancellation | LiveServerGoingAwayNotice | LiveSessionResumptionUpdate >;
102117```
103118<b >Returns :</b >
104119
105- AsyncGenerator < ;[LiveServerContent ](./ai .liveservercontent .md #liveservercontent_interface ) \| [LiveServerToolCall ](./ai .liveservertoolcall .md #liveservertoolcall_interface ) \| [LiveServerToolCallCancellation ](./ai .liveservertoolcallcancellation .md #liveservertoolcallcancellation_interface ) \| [LiveServerGoingAwayNotice ](./ai .liveservergoingawaynotice .md #liveservergoingawaynotice_interface )<!-- -->> ;
120+ AsyncGenerator < ;[LiveServerContent ](./ai .liveservercontent .md #liveservercontent_interface ) \| [LiveServerToolCall ](./ai .liveservertoolcall .md #liveservertoolcall_interface ) \| [LiveServerToolCallCancellation ](./ai .liveservertoolcallcancellation .md #liveservertoolcallcancellation_interface ) \| [LiveServerGoingAwayNotice ](./ai .liveservergoingawaynotice .md #liveservergoingawaynotice_interface ) \| [ LiveSessionResumptionUpdate ](./ ai . livesessionresumptionupdate . md # livesessionresumptionupdate_interface ) <!-- -->> ;
106121
107122An `AsyncGenerator ` that yields server messages as they arrive .
108123
109124#### Exceptions
110125
111126If the session is already closed , or if we receive a response that we don 't support .
112127
128+ ## LiveSession .resumeSession ()
129+
130+ > This API is provided as a preview for developers and may change based on feedback that we receive . Do not use this API in a production environment .
131+ >
132+
133+ Resumes an existing live session with the server .
134+
135+ This closes the current WebSocket connection and establishes a new one using the same configuration (URI , headers , model , system instruction , tools , etc .) as the original session .
136+
137+ <b >Signature :</b >
138+
139+ ```typescript
140+ resumeSession (sessionResumption ?: SessionResumptionConfig ): Promise <void >;
141+ ```
142+
143+ #### Parameters
144+
145+ | Parameter | Type | Description |
146+ | --- | --- | --- |
147+ | sessionResumption | [SessionResumptionConfig ](./ai .sessionresumptionconfig .md #sessionresumptionconfig_interface ) | The configuration for session resumption , such as the handle to the previous session state to restore . |
148+
149+ <b >Returns :</b >
150+
151+ Promise < ;void > ;
152+
153+ #### Exceptions
154+
155+ If the session resumption configuration is unsupported .
156+
113157## LiveSession .send ()
114158
115159> This API is provided as a preview for developers and may change based on feedback that we receive . Do not use this API in a production environment .
0 commit comments