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

memoryStream.md

36 lines1.1 KB

1---
2id: memoryStream
3title: memoryStream
4---
5​
6```ts
7function memoryStream(source, options?): UpsertableStreamDurability;
8```
9​
10Defined in: [packages/ai/src/stream-durability.ts:331](https://github.com/TanStack/ai/blob/main/packages/ai/src/stream-durability.ts#L331)
11​
12The zero-infrastructure delivery-durability backend. Its versioned cursor is
13deliberately private: callers and core only pass the returned string back.
14​
15Construct from the incoming `Request` (HTTP transports) or from an explicit
16[MemoryStreamInit](../interfaces/MemoryStreamInit.md) (server functions / direct calls that already know
17the run id).
18​
19Logs live in a process-global map, so this backend is for development, tests,
20and single-process deployments only. Completed runs are evicted after a grace
21window (see COMPLETED\_LOG\_TTL\_MS); a resume of an evicted or unknown
22run fails loudly rather than hanging.
23​
24## Parameters
25​
26### source
27​
28`Request` \| [`MemoryStreamInit`](../interfaces/MemoryStreamInit.md)
29​
30### options?
31​
32[`MemoryStreamOptions`](../interfaces/MemoryStreamOptions.md) = `{}`
33​
34## Returns
35​
36[`UpsertableStreamDurability`](../interfaces/UpsertableStreamDurability.md)