Variable: StreamEventType
@providerprotocol/ai / @providerprotocol/ai / StreamEventType
Variable: StreamEventType
Section titled “Variable: StreamEventType”
constStreamEventType:object
Defined in: src/types/stream.ts:28
Stream event type constants.
Use these constants instead of raw strings for type-safe event handling:
Type Declaration
Section titled “Type Declaration”AudioDelta
Section titled “AudioDelta”
readonlyAudioDelta:"audio_delta"='audio_delta'
Incremental audio data
ContentBlockStart
Section titled “ContentBlockStart”
readonlyContentBlockStart:"content_block_start"='content_block_start'
Beginning of a content block
ContentBlockStop
Section titled “ContentBlockStop”
readonlyContentBlockStop:"content_block_stop"='content_block_stop'
End of a content block
ImageDelta
Section titled “ImageDelta”
readonlyImageDelta:"image_delta"='image_delta'
Incremental image data
MessageStart
Section titled “MessageStart”
readonlyMessageStart:"message_start"='message_start'
Beginning of a message
MessageStop
Section titled “MessageStop”
readonlyMessageStop:"message_stop"='message_stop'
End of a message
ObjectDelta
Section titled “ObjectDelta”
readonlyObjectDelta:"object_delta"='object_delta'
Incremental structured object data (for structured output responses)
ReasoningDelta
Section titled “ReasoningDelta”
readonlyReasoningDelta:"reasoning_delta"='reasoning_delta'
Incremental reasoning/thinking output
StreamRetry
Section titled “StreamRetry”
readonlyStreamRetry:"stream_retry"='stream_retry'
Stream is being retried after an error
TextDelta
Section titled “TextDelta”
readonlyTextDelta:"text_delta"='text_delta'
Incremental text output
ToolCallDelta
Section titled “ToolCallDelta”
readonlyToolCallDelta:"tool_call_delta"='tool_call_delta'
Incremental tool call data (arguments being streamed)
ToolExecutionEnd
Section titled “ToolExecutionEnd”
readonlyToolExecutionEnd:"tool_execution_end"='tool_execution_end'
Tool execution has completed
ToolExecutionStart
Section titled “ToolExecutionStart”
readonlyToolExecutionStart:"tool_execution_start"='tool_execution_start'
Tool execution has started (may be emitted after completion in some implementations)
VideoDelta
Section titled “VideoDelta”
readonlyVideoDelta:"video_delta"='video_delta'
Incremental video data
Example
Section titled “Example”import { StreamEventType } from 'upp';
for await (const event of stream) { if (event.type === StreamEventType.TextDelta) { process.stdout.write(event.delta.text ?? ''); }}