Streaming is a core feature of ADK that enables real-time feedback during workflow generation and execution. This creates responsive AI applications where users see progress as it happens.
# For a web applicationasync def handle_request(task: str, websocket): adk = get_provider("adk") async for event in adk.compose( task=task, mode="act", stream=True, stream_format="vercel" ): # Send to frontend via WebSocket await websocket.send_json(event) # Update UI based on event type if event.get("type") == "step_complete": await update_progress_bar(event["step"])
async for event in adk.compose( task="...", stream=True, stream_filter={ "include_tool_calls": False, # Skip tool events "include_thoughts": True, # Include AI reasoning "include_metrics": True # Include performance data }): process_filtered_event(event)