Skip to content

StructuredOutputBoundary

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/runtime/structuredOutput.ts:393

The two halves of one structured-output call: what to send, and how to read the answer.

T

The caller’s own parsed type — unchanged by the boundary.

wireSchema: ZodType<Record<string, unknown>>

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/runtime/structuredOutput.ts:399

The schema to hand to model.withStructuredOutput(...). Identical (by reference) to the caller’s schema when it contains no optional field, so a schema that never had the problem is sent byte-for-byte as it is today.

safeParse(raw): ZodSafeParseResult<T>

Defined in: _worktrees/docs-release/gaunt-sloth/packages/core/src/runtime/structuredOutput.ts:405

Validate a model answer: normalize every null that stands for “no value” back to the key being absent, then validate with the caller’s original schema. Never throws — a malformed answer comes back as success: false, exactly as schema.safeParse would.

unknown

ZodSafeParseResult<T>