Tanstack AI Core Structured Outputs

Type-safe JSON schema responses from LLMs using outputSchema on chat() and useChat(). Supports Zod, ArkType, and Valibot schemas. The adapter handles provider-specific strategies transparently — never configure structured output at the provider level. Pass stream:true alongside outputSchema for incremental JSON deltas + a completed typed object via the `structured-output.complete` event. Each successfully completed structured-output run adds a typed `StructuredOutputPart` to message history. partial/final derive from the most recent structured-output part after the latest user message. convertSchemaToJsonSchema() for manual schema conversion.

lukasa1993 Updated 1 repo stars

File contents

lukasa1993/tanstack-skills-extracted commit 5bda07c350

Frequently asked questions

npx get-skill add lukasa1993/tanstack-ai-core-structured-outputs