Replies: 1 comment
-
|
No — ADK does not stream by default. You must explicitly opt in by passing Once SSE mode is enabled, ADK emits incremental chunks as the model generates them. The distinction between streaming and non-streaming behavior is then purely about which events you choose to act on. The Two Event Types You'll See
ADK accumulates all
If You Don't Want Streaming — Skip
|
| Goal | What to do |
|---|---|
| Enable streaming at all | Pass RunConfig(streaming_mode=StreamingMode.SSE) — it is not on by default |
| Non-streaming (full answer at once) | Skip event.partial == True; act on event.partial == False |
| Streaming (text as it arrives) | Forward event.partial == True chunks to your UI |
| Fallback for no-partial models | Check saw_partial_text before acting on the final partial=False event |
The distinction between streaming and non-streaming is purely about which events you choose to act on — you always use StreamingMode.SSE.
You can have a look at some of the code examples in
https://github.dev/google/adk-python/contributing/samples/litellm_streaming/main.py
Or if you want to explore about BI-Directional live streaming you can have a look at https://github.com/google/adk-samples/blob/main/python/agents/bidi-demo/app/main.py
Hope this helps.
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I just wanted to clarify something. From what I understand, ADK appears to return responses in a streaming manner by default. If I don’t want streaming behavior, would I need to handle this in my code by checking whether the event is marked as final before displaying the response? Is my understanding correct?
Beta Was this translation helpful? Give feedback.
All reactions