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

MemoryStreamInit.md

40 lines855 Bytes

1---
2id: MemoryStreamInit
3title: MemoryStreamInit
4---
5​
6Defined in: packages/ai/src/stream-durability.ts:308
7​
8Explicit construction for [memoryStream](../functions/memoryStream.md), for callers that don't have
9the incoming `Request` — e.g. a TanStack Start server function implementing
10a `joinRun` replay for a run id it received as call data:
11​
12```ts
13const durability = memoryStream({ runId })
14for await (const chunk of replayRunStream(durability)) yield chunk
15```
16​
17## Properties
18​
19### offset?
20​
21```ts
22optional offset?: string | null;
23```
24​
25Defined in: packages/ai/src/stream-durability.ts:315
26​
27Resume offset captured by the consumer (`resumeFrom()` returns it).
28Defaults to `null` (a producer / from-start reader).
29​
30***
31​
32### runId
33​
34```ts
35runId: string;
36```
37​
38Defined in: packages/ai/src/stream-durability.ts:310
39​
40The run this durability adapter attaches to.