Open History to see the last commit
1---
2id: TanStackMessageMetadata
3title: TanStackMessageMetadata
4---
5
6Defined in: [packages/ai/src/types.ts:699](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L699)
7
8Shape of `metadata.tanstack` on a message.
9`createdAt` is an ISO-8601 string.
10
11## Properties
12
13### continues?
14
15```ts
16optional continues?: string;
17```
18
19Defined in: [packages/ai/src/types.ts:751](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L751)
20
21On an assistant wire row that exists only to keep the block order: the
22id of the assistant row before it. Our server joins the two rows into
23one message with a `blockOrder` map. See `uiMessagesToWire`.
24
25***
26
27### createdAt?
28
29```ts
30optional createdAt?: string;
31```
32
33Defined in: [packages/ai/src/types.ts:700](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L700)
34
35***
36
37### finishReason?
38
39```ts
40optional finishReason?: "length" | "stop" | "content_filter" | "tool_calls" | null;
41```
42
43Defined in: [packages/ai/src/types.ts:709](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L709)
44
45Why the model call of this assistant message ended. A `'length'` message
46stopped at the output limit, so its tool calls are not complete.
47
48***
49
50### model?
51
52```ts
53optional model?: string;
54```
55
56Defined in: [packages/ai/src/types.ts:701](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L701)
57
58***
59
60### responseId?
61
62```ts
63optional responseId?: string;
64```
65
66Defined in: [packages/ai/src/types.ts:704](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L704)
67
68***
69
70### responseItems?
71
72```ts
73optional responseItems?: object[];
74```
75
76Defined in: [packages/ai/src/types.ts:715](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L715)
77
78The provider's answer items of this assistant message, in order, for a
79same-model replay. The OpenAI Responses adapter keeps each output
80message item's `id` and `phase` (`commentary` or `final_answer`).
81
82#### id
83
84```ts
85id: string;
86```
87
88#### phase?
89
90```ts
91optional phase?: string;
92```
93
94***
95
96### run?
97
98```ts
99optional run?: object;
100```
101
102Defined in: [packages/ai/src/types.ts:723](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L723)
103
104The chat run that produced this assistant message. `withPersistence` sets
105`id`. `reconstructChat` with `includeRuns: true` adds the finished run's
106timings, in epoch ms.
107
108#### finishedAt?
109
110```ts
111optional finishedAt?: number;
112```
113
114#### id
115
116```ts
117id: string;
118```
119
120#### startedAt?
121
122```ts
123optional startedAt?: number;
124```
125
126***
127
128### runId?
129
130```ts
131optional runId?: string;
132```
133
134Defined in: [packages/ai/src/types.ts:717](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L717)
135
136Parent chat run that produced this assistant message.
137
138***
139
140### signature?
141
142```ts
143optional signature?: string;
144```
145
146Defined in: [packages/ai/src/types.ts:727](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L727)
147
148Thinking signature for a `role: 'reasoning'` fan-out message.
149
150***
151
152### source?
153
154```ts
155optional source?: MessageSource;
156```
157
158Defined in: [packages/ai/src/types.ts:702](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L702)
159
160***
161
162### stopReason?
163
164```ts
165optional stopReason?: "error" | "aborted";
166```
167
168Defined in: [packages/ai/src/types.ts:703](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L703)
169
170***
171
172### structuredOutput?
173
174```ts
175optional structuredOutput?: object;
176```
177
178Defined in: [packages/ai/src/types.ts:737](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L737)
179
180#### data?
181
182```ts
183optional data?: unknown;
184```
185
186#### errorMessage?
187
188```ts
189optional errorMessage?: string;
190```
191
192#### partial?
193
194```ts
195optional partial?: unknown;
196```
197
198#### raw?
199
200```ts
201optional raw?: string;
202```
203
204#### reasoning?
205
206```ts
207optional reasoning?: string;
208```
209
210#### status?
211
212```ts
213optional status?: "error" | "complete" | "streaming";
214```
215
216***
217
218### subagent?
219
220```ts
221optional subagent?: SubagentWireInfo;
222```
223
224Defined in: [packages/ai/src/types.ts:725](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L725)
225
226Card data on a child wire message. See `uiMessagesToWire`.
227
228***
229
230### toolCallMetadata?
231
232```ts
233optional toolCallMetadata?: Record<string, unknown>;
234```
235
236Defined in: [packages/ai/src/types.ts:729](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L729)
237
238Per-tool-call provider metadata keyed by tool call id (e.g. Gemini thoughtSignature).
239
240***
241
242### toolResult?
243
244```ts
245optional toolResult?: object;
246```
247
248Defined in: [packages/ai/src/types.ts:730](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L730)
249
250#### content?
251
252```ts
253optional content?: ContentPart<unknown, unknown, unknown, unknown, unknown>[];
254```
255
256#### createdAt?
257
258```ts
259optional createdAt?: string;
260```
261
262#### id?
263
264```ts
265optional id?: string;
266```
267
268***
269
270### toolResultOutcome?
271
272```ts
273optional toolResultOutcome?: ToolResultOutcome;
274```
275
276Defined in: [packages/ai/src/types.ts:736](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L736)
277
278Outcome of a cancelled or denied tool result; when present, the UI state is `error`.
279
280***
281
282### uiResources?
283
284```ts
285optional uiResources?: UIResourcePart[];
286```
287
288Defined in: [packages/ai/src/types.ts:745](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L745)