Open History to see the last commit
1---
2id: StructuredOutputStartEvent
3title: StructuredOutputStartEvent
4---
5
6Defined in: packages/ai/src/types.ts:1792
7
8Emitted at the start of a streaming structured-output run, before the JSON
9deltas. Tells consumers that the upcoming `TEXT_MESSAGE_CONTENT` deltas
10belong to a structured response so they can route those bytes into a
11`StructuredOutputPart` instead of building a `TextPart`. Carries the
12`messageId` the deltas will be tagged with so the routing decision can be
13made per-message rather than globally.
14
15## Extends
16
17- [`CustomEvent`](CustomEvent.md)
18
19## Properties
20
21### metadata?
22
23```ts
24optional metadata?: Record<string, any>;
25```
26
27Defined in: packages/ai/src/types.ts:1756
28
29Extra information attached to this event.
30
31#### Inherited from
32
33[`CustomEvent`](CustomEvent.md).[`metadata`](CustomEvent.md#metadata)
34
35***
36
37### name
38
39```ts
40name: "structured-output.start";
41```
42
43Defined in: packages/ai/src/types.ts:1793
44
45What this custom event is. Required: without it a consumer cannot route
46the value.
47
48#### Overrides
49
50```ts
51CustomEvent.name
52```
53
54***
55
56### type
57
58```ts
59type: "CUSTOM";
60```
61
62Defined in: packages/ai/src/types.ts:1755
63
64#### Inherited from
65
66[`CustomEvent`](CustomEvent.md).[`type`](CustomEvent.md#type)
67
68***
69
70### value
71
72```ts
73value: object;
74```
75
76Defined in: packages/ai/src/types.ts:1794
77
78The payload. Any JSON value, and required.
79
80#### messageId
81
82```ts
83messageId: string;
84```
85
86#### Overrides
87
88```ts
89CustomEvent.value
90```