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
docs: Update progressive SSE streaming to be enabled by default
- Change progressive SSE streaming from experimental to default-enabled
- Add documentation for function call argument streaming via partial_args
- Update environment variable usage to show how to disable (instead of enable)
- Add warning about trade-offs when using legacy behavior
Copy file name to clipboardExpand all lines: docs/streaming/dev-guide/part4.md
+20-6Lines changed: 20 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -223,26 +223,40 @@ sequenceDiagram
223
223
224
224
### Progressive SSE Streaming
225
225
226
-
**Progressive SSE streaming** is an experimental feature that enhances how SSE mode delivers streaming responses. When enabled, this feature improves response aggregation by:
226
+
**Progressive SSE streaming** is a feature that enhances how SSE mode delivers streaming responses. This feature improves response aggregation by:
227
227
228
228
-**Content ordering preservation**: Maintains the original order of mixed content types (text, function calls, inline data)
229
229
-**Intelligent text merging**: Only merges consecutive text parts of the same type (regular text vs thought text)
230
230
-**Progressive delivery**: Marks all intermediate chunks as `partial=True`, with a single final aggregated response at the end
231
231
-**Deferred function execution**: Skips executing function calls in partial events, only executing them in the final aggregated event to avoid duplicate executions
232
+
-**Function call argument streaming**: Supports progressive building of function call arguments through `partial_args`, enabling real-time display of function call construction
232
233
233
-
**Enabling the feature:**
234
+
**Default Behavior:**
235
+
236
+
Progressive SSE streaming is **enabled by default** in ADK. This means when you use `StreamingMode.SSE`, you automatically benefit from these improvements without any configuration.
237
+
238
+
**Disabling the feature (if needed):**
234
239
235
-
This is an experimental (WIP stage) feature disabled by default. Enable it via environment variable:
240
+
If you need to revert to the legacy SSE streaming behavior (simple text accumulation), you can disable it via environment variable:
236
241
237
242
```bash
238
-
export ADK_ENABLE_PROGRESSIVE_SSE_STREAMING=1
243
+
export ADK_ENABLE_PROGRESSIVE_SSE_STREAMING=0
239
244
```
240
245
241
-
**When to use:**
246
+
!!! warning "Legacy Behavior Trade-offs"
247
+
248
+
Disabling progressive SSE streaming reverts to simple text accumulation, which:
249
+
- May lose original content ordering when mixing text and function calls
250
+
- Does not support function call argument streaming via `partial_args`
251
+
- May produce duplicate merged text events in addition to the final aggregated event
252
+
- Is provided for backward compatibility only—new applications should use the default progressive mode
253
+
254
+
**When progressive SSE streaming helps:**
242
255
243
-
- You're using `StreamingMode.SSE` and need better handling of mixed content types (text + function calls)
256
+
- You're using `StreamingMode.SSE` and have mixed content types (text + function calls)
244
257
- Your responses include thought text (extended thinking) mixed with regular text
245
258
- You want to ensure function calls execute only once after complete response aggregation
259
+
- You need to display function call construction in real-time as arguments stream in
246
260
247
261
**Note:** This feature only affects `StreamingMode.SSE`. It does not apply to `StreamingMode.BIDI` (the focus of this guide), which uses the Live API's native bidirectional protocol.
0 commit comments