Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

decodeWsFrame.md

24 lines537 Bytes

1---
2id: decodeWsFrame
3title: decodeWsFrame
4---
5​
6```ts
7function decodeWsFrame(data): InboundFrame;
8```
9​
10Defined in: [packages/ai/src/stream-to-websocket.ts:48](https://github.com/TanStack/ai/blob/main/packages/ai/src/stream-to-websocket.ts#L48)
11​
12Decode one client→server frame. An `{ type: 'abort', runId }` object is a
13control frame; anything else is treated as a `RunAgentInput` and validated
14downstream by `chatParamsFromRequestBody`.
15​
16## Parameters
17​
18### data
19​
20`string`
21​
22## Returns
23​
24[`InboundFrame`](../type-aliases/InboundFrame.md)