Skip to content

TurnHandle

readonly events: AsyncIterable<StreamPart>;

readonly runId: Promise<string>;

Resolves as soon as the run is opened — before the turn body finishes — so a caller minting kind: 'flow' can persist the id it must resume with even if the turn later throws.

cancel(reason?): void;
Parameter Type

reason?

string

void


toResponseStream(format?): ReadableStream;
Parameter Type

format?

"sse" | "ndjson"

ReadableStream


toUIMessageStreamResponse(opts?): Response;
Parameter Type

opts?

{ sessionId?: string; }

opts.sessionId?

string

Response