mirror of
https://github.com/TanStack/ai.git
synced 2026-11-16 19:38:41 +00:00
666 B
666 B
| id | title |
|---|---|
| encodeWsFrame | encodeWsFrame |
Function: encodeWsFrame()
function encodeWsFrame(chunk, id): string;
Defined in: packages/ai/src/stream-to-websocket.ts:35
Encode one server→client frame. Durable frames carry the opaque offset in an
{ id, chunk } envelope (identical to the NDJSON wire); non-durable frames
are the bare chunk. Unambiguous because a bare chunk always has a top-level
type and the envelope never does.
Parameters
chunk
id
string | undefined
Returns
string