Triggered before each streaming delta chunk is processed and rendered in the chat. This event is fired only during streaming responses when the agent sends partial content incrementally. Use this event to inspect, modify, or suppress streaming content before it appears in the chat UI.Documentation Index
Fetch the complete documentation index at: https://developer.watson-orchestrate.ibm.com/llms.txt
Use this file to discover all available pages before exploring further.
This event is only triggered when you use streaming responses. Non-streaming responses do not fire this event.
Event properties
Always
'pre:stream:delta'.Unique identifier for the message being streamed.
Unique identifier for the conversation thread.
Unique identifier for the current run.
The streaming delta chunk containing partial response content.
Role of the message sender, for example,
'assistant'.Array of content items in the delta chunk. Contains only the incremental content for the current chunk, not the complete message. To suppress delta rendering, set this to an empty array (
[]). The complete message is still rendered with pre:receive and receive events.Unique identifier for the content item.
Type of the response item, for example,
'text'.Text content of the delta item.
Examples
The following example modifies an streaming content:Considerations
Event behavior
- Multiple handlers can be registered and will run in registration order.
- The
delta.contentarray contains only the incremental content for the current chunk, not the complete message. - The
messageobject (when available) accumulates all previous deltas and represents the message state so far.
Use cases
- Content filtering: Remove or redact sensitive information in real-time as it streams.
- Text transformation: Apply formatting or transformations to streaming content.
- Suppress streaming: Disable character-by-character streaming and show only the final message.
- Translation workflows: Suppress deltas and translate the complete message in
pre:receive. - Progress tracking: Monitor streaming progress and display custom loading indicators.
- Analytics: Track streaming performance metrics like chunk size and frequency.
Do you need practical examples?
Learn how to apply the features available for embedded chat into your implementation with guidance and examples.

