Skip to content

Interface: EventDelta

@providerprotocol/ai


@providerprotocol/ai / @providerprotocol/ai / EventDelta

Defined in: src/types/stream.ts:93

Event delta data payload.

Contains the type-specific data for a streaming event. Different fields are populated depending on the event type:

Event TypeFields
text_deltatext
reasoning_deltatext
object_deltatext
image_deltadata
audio_deltadata
video_deltadata
tool_call_deltatoolCallId, toolName, argumentsJson
tool_execution_starttoolCallId, toolName, timestamp
tool_execution_endtoolCallId, toolName, result, isError, timestamp
stream_retryattempt, maxAttempts, error, timestamp
message_start(none)
message_stop(none)
content_block_start(none)
content_block_stop(none)

Custom event types (via middleware) may extend EventDelta with additional fields. See @providerprotocol/ai/middleware/flow!FlowStageDelta for an example.

optional argumentsJson: string

Defined in: src/types/stream.ts:107

Incremental JSON arguments string (tool_call_delta)


optional attempt: number

Defined in: src/types/stream.ts:119

Current retry attempt number (stream_retry, 1-indexed)


optional data: Uint8Array<ArrayBufferLike>

Defined in: src/types/stream.ts:98

Incremental binary data (image_delta, audio_delta, video_delta)


optional error: object

Defined in: src/types/stream.ts:125

Error that triggered the retry (stream_retry) - serialized for JSON transport

optional code: string

message: string


optional isError: boolean

Defined in: src/types/stream.ts:113

Whether tool execution resulted in an error (tool_execution_end)


optional maxAttempts: number

Defined in: src/types/stream.ts:122

Maximum number of retry attempts configured (stream_retry)


optional result: unknown

Defined in: src/types/stream.ts:110

Tool execution result (tool_execution_end)


optional text: string

Defined in: src/types/stream.ts:95

Incremental text content (text_delta, reasoning_delta, object_delta)


optional timestamp: number

Defined in: src/types/stream.ts:116

Timestamp in milliseconds (tool_execution_start/end, stream_retry)


optional toolCallId: string

Defined in: src/types/stream.ts:101

Tool call identifier (tool_call_delta, tool_execution_start/end)


optional toolName: string

Defined in: src/types/stream.ts:104

Tool name (tool_call_delta, tool_execution_start/end)