2.2 KiB
| id | title |
|---|---|
| StructuredOutputPart | StructuredOutputPart |
Interface: StructuredOutputPart<TData>
Defined in: packages/ai/src/types.ts:480
StructuredOutputPart — a typed structured response attached to the assistant
message that produced it. Generic over the schema-inferred data type so
consumers can thread useChat({ outputSchema })'s schema all the way down
to messages[i].parts[j].data. Defaults to unknown so untyped consumers
(e.g. internal codepaths that don't know about TSchema) keep working.
Type Parameters
TData
TData = unknown
Properties
data?
optional data?: TData;
Defined in: packages/ai/src/types.ts:486
Validated final object — only set when status === 'complete'.
errorMessage?
optional errorMessage?: string;
Defined in: packages/ai/src/types.ts:492
Populated when status === 'error'.
partial?
optional partial?: DeepPartial<TData>;
Defined in: packages/ai/src/types.ts:484
Progressive parse of raw via parsePartialJSON — populated while streaming and after complete.
raw
raw: string;
Defined in: packages/ai/src/types.ts:488
Accumulating JSON buffer. Source of truth for wire round-trip.
reasoning?
optional reasoning?: string;
Defined in: packages/ai/src/types.ts:490
Optional chain-of-thought surfaced by reasoning models alongside the structured output.
status
status: "error" | "complete" | "streaming";
Defined in: packages/ai/src/types.ts:482
type
type: "structured-output";
Defined in: packages/ai/src/types.ts:481