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

StructuredOutputCompleteEvent.md

107 lines1.9 KB

1---
2id: StructuredOutputCompleteEvent
3title: StructuredOutputCompleteEvent
4---
5​
6# Interface: StructuredOutputCompleteEvent\<T\>
7​
8Defined in: [packages/ai/src/types.ts:1360](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L1360)
9​
10Final event of a streaming structured-output run. Carries the validated
11`object` (typed as `T` after the orchestrator runs Standard Schema parsing),
12the `raw` JSON text that produced it, and — for thinking/reasoning models —
13the accumulated reasoning text. Adapters emit this with `T = unknown`; the
14chat orchestrator narrows to the schema's inferred type after validation.
15​
16`reasoning` is `undefined` when the model produced none (most non-thinking
17models) and when the underlying adapter doesn't expose reasoning streams.
18​
19`name` is a string literal so consumers can narrow directly:
20​
21```ts
22if (chunk.type === 'CUSTOM' && chunk.name === 'structured-output.complete') {
23 chunk.value.object // typed as T
25```
26​
27## Extends
28​
29- [`CustomEvent`](CustomEvent.md)
30​
31## Type Parameters
32​
33### T
34​
35`T` = `unknown`
36​
37## Indexable
38​
39```ts
40[k: string]: unknown
41```
42​
43## Properties
44​
45### model?
46​
47```ts
48optional model: string;
49```
50​
51Defined in: [packages/ai/src/types.ts:1339](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L1339)
52​
53Model identifier for multi-model support
54​
55#### Inherited from
56​
57[`CustomEvent`](CustomEvent.md).[`model`](CustomEvent.md#model)
58​
59***
60​
61### name
62​
63```ts
64name: "structured-output.complete";
65```
66​
67Defined in: [packages/ai/src/types.ts:1363](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L1363)
68​
69#### Overrides
70​
71```ts
72CustomEvent.name
73```
74​
75***
76​
77### value
78​
79```ts
80value: object;
81```
82​
83Defined in: [packages/ai/src/types.ts:1364](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L1364)
84​
85#### object
86​
87```ts
88object: T;
89```
90​
91#### raw
92​
93```ts
94raw: string;
95```
96​
97#### reasoning?
98​
99```ts
100optional reasoning: string;
101```
102​
103#### Overrides
104​
105```ts
106CustomEvent.value
107```