Streaming
The Client SDK provides real-time access to streaming content through the message parts array. Each part has its own status, enabling responsive UIs that update as the agent generates responses.
Streaming State
tsx
Building a Streaming UI
tsx
Rendering Streaming Parts
Parts update in real-time during streaming. Use the part's status to show appropriate UI:
tsx
Tool Call States
Tool calls progress through multiple states:
tsx
Status Indicator
tsx
Handling Completion
tsx
See Error Handling for comprehensive error handling patterns.
text
When stop() is called:
- The HTTP request is aborted (requires
signalin transport) - Any partial text/reasoning is finalized with
donestatus - In-progress tool calls are marked as
cancelled - The
onStopcallback is invoked - Status changes to
idle
Partial content is preserved in the message, so users don't lose what was already generated.
Named Thread Content
Content from named threads (like "summary") streams separately and is identified by the thread property:
tsx