0
Fork 0
mirror of https://github.com/TanStack/ai.git synced 2026-11-18 19:34:58 +00:00
ai/docs/reference/interfaces/StructuredOutputCompleteEvent.md
github-actions[bot] f4f32bdcc2
docs: regenerate API documentation (#1195)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-08-22 08:16:20 +00:00

2.1 KiB

id title
StructuredOutputCompleteEvent StructuredOutputCompleteEvent

Interface: StructuredOutputCompleteEvent<T>

Defined in: packages/ai/src/types.ts:1371

Final event of a streaming structured-output run. Carries the validated object (typed as T after the orchestrator runs Standard Schema parsing), the raw JSON text that produced it, and — for thinking/reasoning models — the accumulated reasoning text. Adapters emit this with T = unknown; the chat orchestrator narrows to the schema's inferred type after validation.

reasoning is undefined when the model produced none (most non-thinking models) and when the underlying adapter doesn't expose reasoning streams.

name is a string literal so consumers can narrow directly:

if (chunk.type === 'CUSTOM' && chunk.name === 'structured-output.complete') {
  chunk.value.object // typed as T
}

Extends

Type Parameters

T

T = unknown

Properties

metadata?

optional metadata?: Record<string, any>;

Defined in: packages/ai/src/types.ts:1350

Inherited from

CustomEvent.metadata


name

name: "structured-output.complete";

Defined in: packages/ai/src/types.ts:1374

Overrides

CustomEvent.name

type

type: "CUSTOM";

Defined in: packages/ai/src/types.ts:1349

Inherited from

CustomEvent.type


value

value: object;

Defined in: packages/ai/src/types.ts:1375

object

object: T;

raw

raw: string;

reasoning?

optional reasoning?: string;

Overrides

CustomEvent.value