Skip to main content
Streaming shows output token-by-token instead of waiting for the complete response. Users see progress immediately, which matters for longer outputs or interactive applications.

Stream in one line

Set stream=True so users see progress as the agent works.

Streaming with Tools

Streaming works with tool-calling workflows. You can stream while the agent calls local tools, MCPs, or both.

Compare: non-streaming vs streaming (same scenario)

The scenario below is the same in both snippets. The only difference is whether you set stream=True and iterate over the stream.
In Python, non-streaming refers to stream=False, not “sync”. If you use AsyncDedalus, you’ll still write async code and use asyncio.run(...). If you prefer fully synchronous code, use the Dedalus client (example below).

Python

Python (sync client)

TypeScript

How the user experience differs

  • Progressive rendering: you can display text as it arrives (“typing”), instead of waiting for a complete response.
  • Visible work: in tool/MCP workflows, you can show status updates (e.g., “Searching Ticketmaster…”) while the agent is calling tools.
  • Interruptibility: you can stop early (client-side) if the user already has what they need, instead of paying for a full completion.

When to Stream

Stream when:
  • Building chat interfaces where perceived latency matters
  • Generating long-form content (articles, code, analysis)
  • Running in terminals or logs where progress feedback helps
Don’t stream when:
  • You need to parse the complete response before displaying
  • Using structured outputs with .parse()
  • Response time is already fast enough

Next steps

Handoffs

Use fast/strong models by phase

Images & Vision

Add multimodality when your text workflow is solid

Use Cases

More streaming agent examples
Last modified on June 30, 2026