07 Streaming#

Script: example/07_streaming.py.

Streaming sends normalized RathLLMStreamDelta objects to on_event while the loop still appends one durable assistant chunk after the model round completes.

python example/07_streaming.py

Delta field

Meaning

content_delta

Incremental assistant text.

finish_reason

Terminal reason for the model round.

usage

Provider-reported token usage when available.

OpenAI-compatible and Anthropic built-in clients both support streaming in v1.2.

← Runnable Examples