Skip to content

ToolStreamEvent

Defined in: src/tools/tool.ts:58

Event yielded during tool execution to report streaming progress. Tools can yield zero or more of these events before returning the final ToolResult.

const streamEvent = new ToolStreamEvent({
data: 'Processing step 1...'
})
// Or with structured data
const streamEvent = new ToolStreamEvent({
data: { progress: 50, message: 'Halfway complete' }
})
readonly type: "toolStreamEvent";

Defined in: src/tools/tool.ts:62

Discriminator for tool stream events.

ToolStreamEventData.type

readonly optional data: unknown;

Defined in: src/tools/tool.ts:68

Caller-provided data for the progress update. Can be any type of data the tool wants to report.

ToolStreamEventData.data