This example is available on GitHub: examples/01_standalone_sdk/24_responses_streaming.py
- Subscribe to streaming deltas from the model
- Log streamed chunks to a JSONL file
- Optionally render streaming visually or print deltas to stdout
examples/01_standalone_sdk/24_responses_streaming.py
Running the Example
How It Works
- Pass a token callback to Conversation to receive streaming chunks as they arrive:
-
Each chunk contains a delta:
text_deltafor content tokens orarguments_deltafor tool-call arguments. The example logs a serialized record per chunk to./logs/stream/*.jsonl. - For a visual live view, use the built-in streaming visualizer:
Next Steps
- Reasoning (Responses API) – Access model reasoning traces
- LLM Routing – Route requests to different models
- Image Input – Send images to multimodal models

