function toWebSocketResponse<TOffset>(request, init): Response;Defined in: packages/ai/src/stream-to-websocket.ts:389
Cloudflare wrapper (Workers/Durable Objects): creates a WebSocketPair, accepts the server socket, delegates to toWebSocketStream, and returns the 101 upgrade Response carrying the client socket. Throws when the runtime has no WebSocketPair (Node, Deno, Bun) — upgrade the socket yourself and call toWebSocketStream directly there.
TOffset extends string = string
Request
WebSocketStreamInit<TOffset>
Response