mirror of
https://github.com/TanStack/ai.git
synced 2026-11-18 19:34:58 +00:00
980 B
980 B
| id | title |
|---|---|
| toWebSocketStream | toWebSocketStream |
Function: toWebSocketStream()
function toWebSocketStream<TOffset>(
socket,
request,
init): void;
Defined in: packages/ai/src/stream-to-websocket.ts:115
Run a full-duplex, conversation-scoped chat over an already-accepted server socket. Each inbound RunAgentInput frame starts one chat() turn (via onRun) whose chunks are pumped back as frames; the socket stays open across turns (pending client-tool resubmit, next user message) until the client closes it or the idle timeout fires. An abort control frame aborts only its turn.
Type Parameters
TOffset
TOffset extends string = string
Parameters
socket
request
Request
init
WebSocketStreamInit<TOffset>
Returns
void