0
Fork 0
mirror of https://github.com/TanStack/ai.git synced 2026-11-16 19:38:41 +00:00
ai/docs/reference/interfaces/StructuredOutputPart.md
github-actions[bot] 1999af2267
docs: regenerate API documentation (#1260)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-08-28 11:42:19 +02:00

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