| Name | Type | Description |
|---|---|---|
options* | ThreadStreamOptions |
Open a protocol stream over the thread-centric v2 protocol.
Returns a ThreadStream with lazy getters
(.messages, .values, .toolCalls, .subgraphs, .subagents,
.output) and thread.run.start({ input, ... }) for starting runs.
Mirrors the in-process graph.streamEvents(..., { version: "v3" }) API.
The thread is bound to options.assistantId for its lifetime.
The wire transport defaults to SSE; pass transport: "websocket"
in options (or configure streamProtocol: "v2-websocket" on the
client) to use a WebSocket instead.
const thread = client.threads.stream({ assistantId: "my-agent" });const thread = client.threads.stream(threadId, { assistantId: "my-agent" });const thread = client.threads.stream({
assistantId: "my-agent",
transport: "websocket",
});