Skip to slide
Chapter 8 · Streaming and Real-Time UX
69 / 191

CHAPTER 08 · Streaming and Real-Time UX · 3 / 10

The event-timeline pattern

The single most useful streaming design is to model a turn as an ordered stream of typed events, not just a stream of text tokens. Event types might include:

  • reasoning_delta / reasoning_end: the model's thinking, if surfaced.
  • content_delta: visible answer text.
  • tool_call_start: the model has decided to call a tool (so the UI can show "Working…").
  • domain events: document_read, document_generated, document_edited, cell_updated, each carrying the data the UI needs to render a rich element (a chip, a download card, an accept/reject card, a spreadsheet cell).
  • citations: the parsed structured trailer.
  • error and done.

This event vocabulary is the contract between your orchestrator and your UI. It lets the frontend render meaningful activity, "read contract.pdf," "generated draft.docx," instead of an opaque spinner. And because the events are typed and ordered, the UI can reconstruct exactly what happened, in sequence.

← → arrow keys work too