Skip to main content

Overview

Streaming returns tokens as they are generated rather than waiting for the full response. This gives users a faster perceived experience — important for long outputs like document summaries or policy analysis.

Basic streaming

Get the full text after streaming

StreamChunk fields

Each chunk yielded by the iterator has:

With a system prompt

Collecting chunks manually