You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix: updated adk version to 1.10.0
fix: updated adk version to 1.10.0, and confirmed the demos work properly.
* fix: add session resumption
fix: add session resumption
* fix: adding session resumption to the docs.
fix: adding session resumption to the docs.
## 3\. Interact with Your Streaming app { #interact-with-your-streaming-app}
128
+
## 3\. Interact with Your Streaming app {#3.-interact-with-your-streaming-app}
129
129
130
130
1\.**Navigate to the Correct Directory:**
131
131
@@ -180,7 +180,7 @@ These console logs are important in case you develop your own streaming applicat
180
180
-**When `ws://` doesn't work:** If you see any errors on the Chrome DevTools with regard to `ws://` connection, try replacing `ws://` with `wss://` on `app/static/js/app.js` at line 28. This may happen when you are running the sample on a cloud environment and using a proxy connection to connect from your browser.
181
181
-**When `gemini-2.0-flash-exp` model doesn't work:** If you see any errors on the app server console with regard to `gemini-2.0-flash-exp` model availability, try replacing it with `gemini-2.0-flash-live-001` on `app/google_search_agent/agent.py` at line 6.
182
182
183
-
## 4. Server code overview { #server-code-overview}
183
+
## 4. Server code overview {#4.-server-side-code-overview}
184
184
185
185
This server app enables real-time, streaming interaction with ADK agent via WebSockets. Clients send text/audio to the ADK agent and receive streamed text/audio responses.
@@ -276,6 +282,49 @@ This function initializes an ADK agent live session.
276
282
277
283
**Returns:**`(live_events, live_request_queue)`.
278
284
285
+
### Session Resumption Configuration
286
+
287
+
ADK supports live session resumption to improve reliability during streaming conversations. This feature enables automatic reconnection when live connections are interrupted due to network issues.
-**Automatic Handle Caching** - The system automatically caches session resumption handles during live conversations
309
+
-**Transparent Reconnection** - When connections are interrupted, the system attempts to resume using cached handles
310
+
-**Context Preservation** - Conversation context and state are maintained across reconnections
311
+
-**Network Resilience** - Provides better user experience during unstable network conditions
312
+
313
+
#### Implementation Notes
314
+
315
+
- Session resumption handles are managed internally by the ADK framework
316
+
- No additional client-side code changes are required
317
+
- The feature is particularly beneficial for long-running streaming conversations
318
+
- Connection interruptions become less disruptive to the user experience
319
+
320
+
#### Troubleshooting
321
+
322
+
If you encounter errors with session resumption:
323
+
324
+
1.**Check model compatibility** - Ensure you're using a model that supports session resumption
325
+
2.**API limitations** - Some session resumption features may not be available in all API versions
326
+
3.**Remove session resumption** - If issues persist, you can disable session resumption by removing the `session_resumption` parameter from `RunConfig`
The JavaScript `app.js` (in `app/static/js`) manages client-side interaction with the ADK Streaming WebSocket backend. It handles sending text/audio and receiving/displaying streamed responses.
## 2\. Set up the platform { #set-up-the-platform}
72
+
## 2\. Set up the platform {#2.-set-up-the-platform}
73
73
74
74
To run the sample app, choose a platform from either Google AI Studio or Google Cloud Vertex AI:
75
75
@@ -105,7 +105,7 @@ To run the sample app, choose a platform from either Google AI Studio or Google
105
105
```
106
106
107
107
108
-
## 3\. Interact with Your Streaming app { #interact-with-your-streaming-app}
108
+
## 3\. Interact with Your Streaming app {#3.-interact-with-your-streaming-app}
109
109
110
110
1\.**Navigate to the Correct Directory:**
111
111
@@ -158,7 +158,7 @@ These console logs are important in case you develop your own streaming applicat
158
158
-**When your browser can't connect to the server via SSH proxy:** SSH proxy used in various cloud services may not work with SSE. Please try without SSH proxy, such as using a local laptop, or try the [WebSocket](custom-streaming-ws.md) version.
159
159
-**When `gemini-2.0-flash-exp` model doesn't work:** If you see any errors on the app server console with regard to `gemini-2.0-flash-exp` model availability, try replacing it with `gemini-2.0-flash-live-001` on `app/google_search_agent/agent.py` at line 6.
160
160
161
-
## 4. Agent definition { #agent-definition }
161
+
## 4. Agent definition
162
162
163
163
The agent definition code `agent.py` in the `google_search_agent` folder is where the agent's logic is written:
164
164
@@ -184,7 +184,7 @@ Notice how easily you integrated [grounding with Google Search](https://ai.googl
184
184
185
185
The server and client architecture enables real-time, bidirectional communication between web clients and AI agents with proper session isolation and resource management.
186
186
187
-
## 5. Server side code overview { #server-side-code-overview}
187
+
## 5. Server side code overview {#5.-server-side-code-overview}
188
188
189
189
The FastAPI server provides real-time communication between web clients and the AI agent.
190
190
@@ -210,6 +210,11 @@ The FastAPI server provides real-time communication between web clients and the
-**Cleanup Logic** - Handles connection termination by closing the request queue and removing from active sessions, with error handling for stream interruptions.
384
395
396
+
### Session Resumption Configuration
397
+
398
+
ADK supports live session resumption to improve reliability during streaming conversations. This feature enables automatic reconnection when live connections are interrupted due to network issues.
-**Automatic Handle Caching** - The system automatically caches session resumption handles during live conversations
420
+
-**Transparent Reconnection** - When connections are interrupted, the system attempts to resume using cached handles
421
+
-**Context Preservation** - Conversation context and state are maintained across reconnections
422
+
-**Network Resilience** - Provides better user experience during unstable network conditions
423
+
424
+
#### Implementation Notes
425
+
426
+
- Session resumption handles are managed internally by the ADK framework
427
+
- No additional client-side code changes are required
428
+
- The feature is particularly beneficial for long-running streaming conversations
429
+
- Connection interruptions become less disruptive to the user experience
430
+
431
+
#### Troubleshooting
432
+
433
+
If you encounter errors with session resumption:
434
+
435
+
1.**Check model compatibility** - Ensure you're using a model that supports session resumption
436
+
2.**API limitations** - Some session resumption features may not be available in all API versions
437
+
3.**Remove session resumption** - If issues persist, you can disable session resumption by removing the `session_resumption` parameter from `RunConfig`
0 commit comments