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

PersistedArtifactRef.md

169 lines2.9 KB

1---
2id: PersistedArtifactRef
3title: PersistedArtifactRef
4---
5​
6Defined in: [packages/ai/src/types.ts:2096](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L2096)
7​
8## Properties
9​
10### artifactId
11​
12```ts
13artifactId: string;
14```
15​
16Defined in: [packages/ai/src/types.ts:2098](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L2098)
17​
18***
19​
20### createdAt
21​
22```ts
23createdAt: string;
24```
25​
26Defined in: [packages/ai/src/types.ts:2104](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L2104)
27​
28***
29​
30### mimeType
31​
32```ts
33mimeType: string;
34```
35​
36Defined in: [packages/ai/src/types.ts:2102](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L2102)
37​
38***
39​
40### name
41​
42```ts
43name: string;
44```
45​
46Defined in: [packages/ai/src/types.ts:2101](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L2101)
47​
48***
49​
50### role
51​
52```ts
53role: PersistedArtifactRole;
54```
55​
56Defined in: [packages/ai/src/types.ts:2097](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L2097)
57​
58***
59​
60### runId
61​
62```ts
63runId: string;
64```
65​
66Defined in: [packages/ai/src/types.ts:2100](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L2100)
67​
68***
69​
70### size
71​
72```ts
73size: number;
74```
75​
76Defined in: [packages/ai/src/types.ts:2103](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L2103)
77​
78***
79​
80### source
81​
82```ts
83source: object;
84```
85​
86Defined in: [packages/ai/src/types.ts:2120](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L2120)
87​
88#### activity
89​
90```ts
91activity: PersistedArtifactActivity;
92```
93​
94#### expiresAt?
95​
96```ts
97optional expiresAt?: string;
98```
99​
100#### jobId?
101​
102```ts
103optional jobId?: string;
104```
105​
106#### mediaType?
107​
108```ts
109optional mediaType?: "json" | "image" | "audio" | "video" | "document";
110```
111​
112#### model
113​
114```ts
115model: string;
116```
117​
118#### path
119​
120```ts
121path: string;
122```
123​
124#### provider
125​
126```ts
127provider: string;
128```
129​
130***
131​
132### sourceUrl?
133​
134```ts
135optional sourceUrl?: string;
136```
137​
138Defined in: [packages/ai/src/types.ts:2111](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L2111)
139​
140Where these bytes were fetched FROM — the provider's original result URL,
141or a caller-supplied prompt URL when `allowInputUrl` opted that in. Usually
142expiring, and provenance only: serve from [PersistedArtifactRef.url](#url)
143instead.
144​
145***
146​
147### threadId
148​
149```ts
150threadId: string;
151```
152​
153Defined in: [packages/ai/src/types.ts:2099](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L2099)
154​
155***
156​
157### url?
158​
159```ts
160optional url?: string;
161```
162​
163Defined in: [packages/ai/src/types.ts:2119](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L2119)
164​
165Durable app-origin URL that serves this artifact's persisted bytes (your
166`GET` route around `retrieveArtifact` / `retrieveBlob`). Stamped by
167`withGenerationPersistence`'s `artifactUrl` option, so clients render and
168restore durable media from your own origin rather than the provider's
169expiring link.