[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-tanstack-ai-corestructured-outputs":3,"mdc--wj20t-key":52,"related-org-tanstack-ai-corestructured-outputs":10338,"related-repo-tanstack-ai-corestructured-outputs":10482},{"slug":4,"name":5,"fn":6,"description":7,"org":8,"tags":12,"stars":24,"repoUrl":25,"updatedAt":26,"license":27,"forks":28,"topics":29,"repo":47,"sourceUrl":50,"mdContent":51},"ai-corestructured-outputs","ai-core\u002Fstructured-outputs","generate type-safe structured JSON 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 terminal validated object via the `structured-output.complete` event. Every assistant turn in useChat carries its own typed `StructuredOutputPart` on `messages[i].parts`, so multi-turn structured chats preserve history automatically — partial\u002Ffinal derive from the latest assistant turn's part. convertSchemaToJsonSchema() for manual schema conversion.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},"tanstack","TanStack","https:\u002F\u002Fpexgzepcugksgbtrxkhf.supabase.co\u002Fstorage\u002Fv1\u002Fobject\u002Fpublic\u002Forg-logos\u002Ftanstack.png",[13,17,20,23],{"name":14,"slug":15,"type":16},"TypeScript","typescript","tag",{"name":18,"slug":19,"type":16},"JSON","json",{"name":21,"slug":22,"type":16},"AI SDK","ai-sdk",{"name":10,"slug":9,"type":16},2884,"https:\u002F\u002Fgithub.com\u002FTanStack\u002Fai","2026-07-16T06:04:17.136221",null,269,[30,31,22,32,33,34,35,36,37,38,39,40,41,42,43,9,44,15,45,46],"ai","ai-agents","anthropic","chatbot","function-calling","gemini","generative-ai","llm","multimodal","openai","react","solidjs","streaming","svelte","tool-calling","typescript-sdk","vue",{"repoUrl":25,"stars":24,"forks":28,"topics":48,"description":49},[30,31,22,32,33,34,35,36,37,38,39,40,41,42,43,9,44,15,45,46],"🤖 Type-safe, provider-agnostic TypeScript AI SDK for streaming chat, tool calling, agents, and multimodal apps across OpenAI, Anthropic, Gemini, React, Vue, Svelte, and Solid.","https:\u002F\u002Fgithub.com\u002FTanStack\u002Fai\u002Ftree\u002FHEAD\u002Fpackages\u002Fai\u002Fskills\u002Fai-core\u002Fstructured-outputs","---\nname: ai-core\u002Fstructured-outputs\ndescription: >\n  Type-safe JSON schema responses from LLMs using outputSchema on chat()\n  and useChat(). Supports Zod, ArkType, and Valibot schemas. The adapter\n  handles provider-specific strategies transparently — never configure\n  structured output at the provider level. Pass stream:true alongside\n  outputSchema for incremental JSON deltas + a terminal validated object\n  via the `structured-output.complete` event. Every assistant turn in\n  useChat carries its own typed `StructuredOutputPart` on\n  `messages[i].parts`, so multi-turn structured chats preserve history\n  automatically — partial\u002Ffinal derive from the latest assistant turn's\n  part. convertSchemaToJsonSchema() for manual schema conversion.\ntype: sub-skill\nlibrary: tanstack-ai\nlibrary_version: '0.10.0'\nsources:\n  - 'TanStack\u002Fai:docs\u002Fstructured-outputs\u002Foverview.md'\n  - 'TanStack\u002Fai:docs\u002Fstructured-outputs\u002Fone-shot.md'\n  - 'TanStack\u002Fai:docs\u002Fstructured-outputs\u002Fstreaming.md'\n  - 'TanStack\u002Fai:docs\u002Fstructured-outputs\u002Fmulti-turn.md'\n  - 'TanStack\u002Fai:docs\u002Fstructured-outputs\u002Fwith-tools.md'\n---\n\n# Structured Outputs\n\n> **Dependency note:** This skill builds on ai-core. Read it first for critical rules. The `useChat` patterns below build on ai-core\u002Fchat-experience — read that for the base hook surface, then come back here for the structured-output specifics.\n\n## Setup\n\n```typescript\nimport { chat } from '@tanstack\u002Fai'\nimport { openaiText } from '@tanstack\u002Fai-openai'\nimport { z } from 'zod'\n\nconst person = await chat({\n  adapter: openaiText('gpt-5.2'),\n  messages: [{ role: 'user', content: 'John Doe, 30' }],\n  outputSchema: z.object({\n    name: z.string(),\n    age: z.number(),\n  }),\n})\n\nperson.name \u002F\u002F string — fully typed, no cast\nperson.age \u002F\u002F number\n```\n\nWhen `outputSchema` is provided, `chat()` returns `Promise\u003CInferSchemaType\u003CTSchema>>` instead of `AsyncIterable\u003CStreamChunk>`. The result is fully typed.\n\nAdding `stream: true` switches the return to `StructuredOutputStream\u003CInferSchemaType\u003CTSchema>>` — incremental JSON deltas plus a terminal validated object. See **Pattern 3** below for direct iteration, **Pattern 4** for the `useChat` shape on the client, and **Pattern 5** for multi-turn structured chats.\n\n## Decision: which pattern fits\n\n| Building this                                                                                  | Use                                                              |\n| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |\n| One prompt in → one typed object out (script, server endpoint, CLI)                            | Pattern 1 (basic) or 2 (nested)                                  |\n| A UI that fills in field by field as the model streams (progressive form, live card)           | Pattern 4 — `useChat({ outputSchema })`                          |\n| Direct iteration of the stream in Node or tests                                                | Pattern 3 — async iterable                                       |\n| Users iterate on a structured object across multiple turns (recipe builder, ticket refinement) | Pattern 5 — multi-turn structured chat                           |\n| Tools that gather info, then return a typed object                                             | Combine any of the above with `tools` — see ai-core\u002Ftool-calling |\n\n## Core Patterns\n\n### Pattern 1: Basic structured output with Zod\n\n```typescript\nimport { chat } from '@tanstack\u002Fai'\nimport { openaiText } from '@tanstack\u002Fai-openai'\nimport { z } from 'zod'\n\nconst PersonSchema = z.object({\n  name: z.string().meta({ description: \"The person's full name\" }),\n  age: z.number().meta({ description: \"The person's age in years\" }),\n  email: z.string().email().meta({ description: 'Email address' }),\n})\n\n\u002F\u002F chat() returns Promise\u003C{ name: string; age: number; email: string }>\nconst person = await chat({\n  adapter: openaiText('gpt-5.2'),\n  messages: [\n    {\n      role: 'user',\n      content:\n        'Extract the person info: John Doe is 30 years old, email john@example.com',\n    },\n  ],\n  outputSchema: PersonSchema,\n})\n\nconsole.log(person.name) \u002F\u002F \"John Doe\"\nconsole.log(person.age) \u002F\u002F 30\nconsole.log(person.email) \u002F\u002F \"john@example.com\"\n```\n\n### Pattern 2: Complex nested schemas\n\n```typescript\nimport { chat } from '@tanstack\u002Fai'\nimport { anthropicText } from '@tanstack\u002Fai-anthropic'\nimport { z } from 'zod'\n\nconst CompanySchema = z.object({\n  name: z.string(),\n  founded: z.number().meta({ description: 'Year the company was founded' }),\n  headquarters: z.object({\n    city: z.string(),\n    country: z.string(),\n    address: z.string().optional(),\n  }),\n  employees: z.array(\n    z.object({\n      name: z.string(),\n      role: z.string(),\n      department: z.string(),\n    }),\n  ),\n  financials: z\n    .object({\n      revenue: z\n        .number()\n        .meta({ description: 'Annual revenue in millions USD' }),\n      profitable: z.boolean(),\n    })\n    .optional(),\n})\n\nconst company = await chat({\n  adapter: anthropicText('claude-sonnet-4-5'),\n  messages: [\n    {\n      role: 'user',\n      content: 'Extract company info from this article: ...',\n    },\n  ],\n  outputSchema: CompanySchema,\n})\n\n\u002F\u002F Full type safety on nested properties\nconsole.log(company.headquarters.city)\nconsole.log(company.employees[0].role)\nconsole.log(company.financials?.revenue)\n```\n\n### Pattern 3: Direct stream iteration\n\nPass `stream: true` alongside `outputSchema` to get an async iterable of standard streaming chunks plus a terminal validated object. Use this when you're a single process end-to-end — Node script, CLI, test, or a server endpoint that responds with one JSON blob. For the in-browser progressive-UI case, jump to Pattern 4 instead.\n\n```typescript\nimport { chat } from '@tanstack\u002Fai'\nimport { openaiText } from '@tanstack\u002Fai-openai'\nimport { z } from 'zod'\n\nconst PersonSchema = z.object({\n  name: z.string(),\n  age: z.number(),\n  email: z.string().email(),\n})\n\nconst stream = chat({\n  adapter: openaiText('gpt-5.2'),\n  messages: [\n    { role: 'user', content: 'Extract: John Doe is 30, john@example.com' },\n  ],\n  outputSchema: PersonSchema,\n  stream: true,\n})\n\nfor await (const chunk of stream) {\n  if (chunk.type === 'CUSTOM' && chunk.name === 'structured-output.complete') {\n    \u002F\u002F Terminal event. `chunk.value.object` is fully validated and typed\n    \u002F\u002F against the schema you passed in — no helper or cast required.\n    chunk.value.object.name \u002F\u002F string\n    chunk.value.object.age \u002F\u002F number\n    chunk.value.reasoning \u002F\u002F string | undefined (thinking models only)\n  }\n}\n```\n\nThe terminal event is a `CUSTOM` chunk: `{ type: 'CUSTOM', name: 'structured-output.complete', value: { object: T, raw: string, reasoning?: string } }`. The return type of `chat({ outputSchema, stream: true })` carries `T` through, so a plain discriminated narrow (`chunk.type === 'CUSTOM' && chunk.name === 'structured-output.complete'`) is enough — no type guard helper.\n\n**Adapter coverage for streaming:**\n\n| Adapter                                                         | `outputSchema` + `stream: true`                                                                                                                       |\n| --------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `@tanstack\u002Fai-openai` (Responses + Chat Completions)            | **Native combined mode (#605)** — schema wired into the regular `chatStream` call alongside `tools`; engine harvests JSON, no finalization round-trip |\n| `@tanstack\u002Fai-anthropic` (Claude 4.5+ only)                     | **Native combined mode (#605)** — `output_config.format` + `tools` in one beta Messages call. Older Claude models fall back                           |\n| `@tanstack\u002Fai-gemini` (Gemini 3.x only)                         | **Native combined mode (#605)** — `responseSchema` + `tools` in one `generateContentStream`. Gemini 2.x falls back                                    |\n| `@tanstack\u002Fai-grok` (Grok 4 family only)                        | **Native combined mode (#605)** — `response_format: json_schema` + `tools`. Grok 2 \u002F 3 fall back                                                      |\n| `@tanstack\u002Fai-openrouter`                                       | Native single-request stream (legacy `structuredOutputStream` path; per-call combined-mode lookup is a follow-up)                                     |\n| `@tanstack\u002Fai-groq`                                             | Legacy `structuredOutputStream` only (no tools — Groq's API rejects schema + tools + stream)                                                          |\n| All other adapters (ollama, older Claude, Gemini 2.x, Grok 2\u002F3) | Fallback: runs non-streaming `structuredOutput`, emits one `structured-output.complete` event                                                         |\n\n**Native combined mode vs fallback** is signaled by the adapter's\noptional `supportsCombinedToolsAndSchema(modelOptions)` method. When\nit returns `true`, the engine wires the JSON Schema into the regular\n`chatStream` call and harvests the final-turn text — middleware sees\nthe run through `beforeModel` \u002F `modelStream` as usual, and the\n`'structuredOutput'` middleware phase does **not** fire. When it\nreturns `false` (or is omitted), the engine takes the legacy\nfinalization path: agent loop, then a separate `structuredOutput` \u002F\n`structuredOutputStream` call with `'structuredOutput'` phase tagging.\n\nConsumer code is identical across providers — always read the final object off `structured-output.complete`.\n\n### Pattern 4: useChat with outputSchema (progressive UI)\n\nPass `outputSchema` to `useChat` and you get a `partial` field that fills in as JSON streams in, plus a `final` field that snaps to the validated object on the terminal event. No `onChunk` ceremony, no manual JSON accumulation, no `parsePartialJSON` calls.\n\n**Server** (same as Pattern 3, just behind an SSE endpoint):\n\n```typescript\n\u002F\u002F app\u002Fapi\u002Fextract-person\u002Froute.ts (or your framework's equivalent)\nimport { chat, toServerSentEventsResponse } from '@tanstack\u002Fai'\nimport { openaiText } from '@tanstack\u002Fai-openai'\nimport { z } from 'zod'\n\nconst PersonSchema = z.object({\n  name: z.string(),\n  age: z.number(),\n  email: z.string().email(),\n})\n\nexport async function POST(request: Request) {\n  const { messages } = await request.json()\n  const stream = chat({\n    adapter: openaiText('gpt-5.2'),\n    messages,\n    outputSchema: PersonSchema,\n    stream: true,\n  })\n  return toServerSentEventsResponse(stream)\n}\n```\n\n**Client:**\n\n```tsx\nimport { useChat, fetchServerSentEvents } from '@tanstack\u002Fai-react'\nimport { z } from 'zod'\n\nconst PersonSchema = z.object({\n  name: z.string(),\n  age: z.number(),\n  email: z.string().email(),\n})\n\nfunction PersonExtractor() {\n  const { sendMessage, isLoading, partial, final } = useChat({\n    connection: fetchServerSentEvents('\u002Fapi\u002Fextract-person'),\n    outputSchema: PersonSchema,\n  })\n\n  return (\n    \u003Cdiv>\n      \u003Cbutton\n        disabled={isLoading}\n        onClick={() => sendMessage('Extract: John Doe, 30, john@example.com')}\n      >\n        Extract\n      \u003C\u002Fbutton>\n      {\u002F* `partial` fills in field by field while streaming. *\u002F}\n      \u003Cp>Name: {partial.name ?? '…'}\u003C\u002Fp>\n      \u003Cp>Age: {partial.age ?? '…'}\u003C\u002Fp>\n      \u003Cp>Email: {partial.email ?? '…'}\u003C\u002Fp>\n      {final && \u003Cpre>Validated: {JSON.stringify(final, null, 2)}\u003C\u002Fpre>}\n    \u003C\u002Fdiv>\n  )\n}\n```\n\n- `partial` is `DeepPartial\u003Cz.infer\u003Ctypeof PersonSchema>>` — every property optional, every nested array element optional. Updated from `TEXT_MESSAGE_CONTENT` deltas.\n- `final` is `z.infer\u003Ctypeof PersonSchema> | null` — populated when `structured-output.complete` arrives.\n- `outputSchema` is for client-side type inference only. **Validation runs on the server** against the schema you pass to `chat({ outputSchema })` there.\n- Same shape works for non-streaming adapters: the fallback path emits one whole-JSON `TEXT_MESSAGE_CONTENT` then the terminal event, so `partial` populates and `final` snaps in the same render tick — same consumer code as the native-streaming providers, just without an intermediate field-by-field reveal.\n\n### Pattern 5: Multi-turn structured chat\n\nEvery assistant turn produced by `useChat({ outputSchema })` carries its own typed `StructuredOutputPart` on `messages[i].parts`. Old turns stay renderable; new turns produce new parts; history is preserved without manual state plumbing. This is what makes the recipe-builder shape (\"now make it vegan\") work.\n\n```tsx\nimport { useChat, fetchServerSentEvents } from '@tanstack\u002Fai-react'\nimport type { StructuredOutputPart } from '@tanstack\u002Fai-client'\nimport { z } from 'zod'\n\nconst RecipeSchema = z.object({\n  title: z.string(),\n  cuisine: z.string(),\n  servings: z.number(),\n  ingredients: z.array(z.object({ item: z.string(), amount: z.string() })),\n  steps: z.array(z.string()),\n})\ntype Recipe = z.infer\u003Ctypeof RecipeSchema>\ntype RecipePart = StructuredOutputPart\u003CRecipe>\n\nfunction RecipeBuilder() {\n  const { messages, sendMessage } = useChat({\n    outputSchema: RecipeSchema,\n    connection: fetchServerSentEvents('\u002Fapi\u002Frecipes'),\n  })\n\n  return (\n    \u003Cdiv>\n      {messages.map((m) => {\n        if (m.role === 'user') {\n          const text = m.parts\n            .filter((p) => p.type === 'text')\n            .map((p) => p.content)\n            .join('')\n          return \u003CUserBubble key={m.id} text={text} \u002F>\n        }\n        if (m.role === 'assistant') {\n          \u002F\u002F `data` is `Recipe` because the schema generic flows from\n          \u002F\u002F `useChat({ outputSchema })` through `messages` to the part.\n          const part = m.parts.find(\n            (p): p is RecipePart => p.type === 'structured-output',\n          )\n          if (!part) return null\n          return \u003CRecipeCard key={m.id} part={part} \u002F>\n        }\n        return null\n      })}\n      \u003Cbutton onClick={() => sendMessage('pasta for two')}>Cook\u003C\u002Fbutton>\n      \u003Cbutton onClick={() => sendMessage('now make it vegan')}>Modify\u003C\u002Fbutton>\n    \u003C\u002Fdiv>\n  )\n}\n\nfunction RecipeCard({ part }: { part: RecipePart }) {\n  \u002F\u002F `data` lands on complete, `partial` fills in while streaming.\n  \u002F\u002F Both are typed against the schema. No casts.\n  const recipe = part.data ?? part.partial ?? ({} as Partial\u003CRecipe>)\n  return \u003Ch3>{recipe.title ?? 'Plating up…'}\u003C\u002Fh3>\n}\n```\n\nKey behaviors:\n\n- **Per-turn parts.** Each `sendMessage()` produces a new assistant message with its own `StructuredOutputPart`. The previous turn's part is untouched — `messages.map(...)` renders the whole history.\n- **Typed by schema.** `messages[i].parts.find(p => p.type === 'structured-output').data` is typed as `Recipe` (no cast, no `unknown`). Works because `useChat\u003CTSchema>` threads `InferSchemaType\u003CTSchema>` down through `UIMessage\u003CTTools, TData>` → `MessagePart\u003CTTools, TData>` → `StructuredOutputPart\u003CTData>`. **In `@tanstack\u002Fai` core** the message types are single-generic (`UIMessage\u003CTData>`); the tools generic lives in `@tanstack\u002Fai-client` and the framework hook packages — import from your framework package or `ai-client`, not from `@tanstack\u002Fai`.\n- **`partial` \u002F `final` are derived.** The hook-level `partial` and `final` are NOT singleton state — they're derived from the latest assistant message's part (the one after the most recent user message). Between `sendMessage()` and the first chunk, `partial` reads `{}` and `final` reads `null` because no new assistant turn exists yet.\n- **Round-trip preserves history.** When the client sends turn N+1, each prior assistant turn's `structured-output` part is serialized back as `{ role: 'assistant', content: \u003Cpart.raw> }` so the model sees its own prior structured response. Streaming \u002F errored parts are dropped from the round-trip.\n\n## Common Mistakes\n\n### HIGH: Filtering `TextPart`s out of `useChat` renderers when using `outputSchema`\n\nEarlier versions of the library routed structured-output JSON deltas through `TextPart`, so renderers had to filter them out:\n\n```tsx\n\u002F\u002F OBSOLETE — this guard was needed only because JSON used to land in a TextPart\nconst last = messages.at(-1)\nlast?.parts.map((part) => {\n  if (part.type === 'text') return null \u002F\u002F ❌ hides the structured JSON\n  \u002F\u002F ...\n})\n```\n\nThat hack is **gone**. With `outputSchema` set, `TEXT_MESSAGE_CONTENT` deltas now route into a dedicated `StructuredOutputPart` (with `raw`, `partial`, `data`, `status`, optional `errorMessage`). Render the structured part directly; let real `TextPart`s through.\n\n```tsx\n\u002F\u002F CORRECT — find the structured-output part directly; let actual TextParts render\nlast?.parts.map((part, i) => {\n  if (part.type === 'thinking')\n    return \u003CReasoningView key={i} text={part.content} \u002F>\n  if (part.type === 'tool-call') return \u003CToolCallView key={i} part={part} \u002F>\n  if (part.type === 'structured-output')\n    return \u003CRecipeCard key={i} part={part} \u002F>\n  if (part.type === 'text') return \u003Cp key={i}>{part.content}\u003C\u002Fp> \u002F\u002F ← real text, not JSON\n  return null\n})\n```\n\nIf you still have an `if (part.type === 'text') return null` line in a structured-output renderer specifically for \"hiding the JSON,\" delete it.\n\nSource: PR #577 — structured-output became a typed UIMessage part.\n\n### HIGH: Treating `partial` \u002F `final` as sticky state across turns\n\n`partial` and `final` are **derived from the latest assistant message's `structured-output` part**, not a sticky hook-level slot. In a multi-turn chat:\n\n- Between `sendMessage()` and the first chunk, `partial` reads `{}` and `final` reads `null` (no assistant message after the latest user yet).\n- Once the latest turn completes, `partial === final`. Earlier turns' data is NOT in `partial` \u002F `final` — it lives on the prior assistant messages' parts.\n\nTo render history, walk `messages` directly (see Pattern 5). Use `partial` \u002F `final` for a sticky summary of the **most recent** turn only.\n\n```tsx\n\u002F\u002F WRONG — `final` only reflects the latest turn; earlier recipes vanish from this view\n{final && \u003CRecipeCard recipe={final} \u002F>}\n\n\u002F\u002F CORRECT for history — walk messages, render every assistant's structured-output part\n{messages.map((m) =>\n  m.role === 'assistant'\n    ? m.parts.find((p) => p.type === 'structured-output')\n      ? \u003CRecipeCard key={m.id} part={...} \u002F>\n      : null\n    : null\n)}\n```\n\nSource: PR #577 — partial\u002Ffinal derive from the latest assistant turn's part.\n\n### HIGH: Parsing streaming JSON deltas yourself\n\nWhen iterating `chat({ outputSchema, stream: true })` directly (Pattern 3), the `TEXT_MESSAGE_CONTENT` chunks contain _partial_ JSON fragments — they are not valid JSON until the stream completes. Always read the validated object from the terminal `structured-output.complete` event. Validation runs once, on the complete payload.\n\n```typescript\n\u002F\u002F WRONG -- partial JSON, throws SyntaxError mid-stream, no schema validation\nfor await (const chunk of stream) {\n  if (chunk.type === 'TEXT_MESSAGE_CONTENT') {\n    const obj = JSON.parse(chunk.delta) \u002F\u002F ❌ partial, invalid\n  }\n}\n\n\u002F\u002F CORRECT -- trust the terminal event\nfor await (const chunk of stream) {\n  if (chunk.type === 'CUSTOM' && chunk.name === 'structured-output.complete') {\n    const result = chunk.value.object \u002F\u002F ✅ typed and validated\n  }\n}\n```\n\nIf you need progressive parsed state in a non-React environment, use a partial-JSON parser on the accumulated raw string at render time — but do NOT treat the result as schema-validated; only the terminal event is. In `useChat`, this is already done for you (`partial` field on Pattern 4).\n\nSource: maintainer interview\n\n### HIGH: Trying to implement provider-specific structured output strategies\n\nThe adapter already handles provider differences (OpenAI uses `response_format`, Anthropic uses tool-based extraction, Gemini uses `responseSchema`). Never configure this yourself.\n\n```typescript\n\u002F\u002F WRONG -- do not set provider-specific response format\nchat({\n  adapter,\n  messages,\n  modelOptions: {\n    responseFormat: { type: 'json_schema', json_schema: mySchema },\n  },\n})\n\n\u002F\u002F CORRECT -- just pass outputSchema, the adapter handles the rest\nchat({\n  adapter,\n  messages,\n  outputSchema: z.object({ name: z.string(), age: z.number() }),\n})\n```\n\nThere is no scenario where you need to know the provider's strategy. Just pass `outputSchema` to `chat()`.\n\nSource: maintainer interview\n\n### HIGH: Passing raw objects instead of using the project's schema library\n\nAgents often generate raw JSON Schema objects or plain TypeScript types instead\nof using the schema validation library already in the project (Zod, ArkType,\nValibot). Always check what the project uses and match it.\n\n```typescript\n\u002F\u002F WRONG -- raw object, no runtime validation, no type inference\nchat({\n  adapter,\n  messages,\n  outputSchema: {\n    type: 'object',\n    properties: {\n      name: { type: 'string' },\n      age: { type: 'number' },\n    },\n    required: ['name', 'age'],\n    additionalProperties: false,\n  },\n})\n\n\u002F\u002F CORRECT -- use the project's schema library (e.g. Zod)\nimport { z } from 'zod'\n\nchat({\n  adapter,\n  messages,\n  outputSchema: z.object({\n    name: z.string(),\n    age: z.number(),\n  }),\n})\n```\n\nUsing the project's schema library gives you runtime validation, TypeScript\ntype inference on the result, and correct JSON Schema conversion automatically.\nCheck `package.json` for `zod`, `arktype`, or `valibot` and use whichever is\nalready installed.\n\nSource: maintainer interview\n\n## Middleware coverage\n\nThe final structured-output adapter call runs through the same middleware\npipeline as the agent loop. `onChunk` observes chunks attributed to\n`ctx.phase === 'structuredOutput'`; `onUsage` fires for the final call's\ntokens; `onFinish` fires once at the end of the whole `chat()` invocation,\nafter the structured-output result is available.\n\nFor schema-aware middleware (e.g., transforming the JSON Schema before the\nprovider call, stripping system prompts), use the dedicated\n`onStructuredOutputConfig` hook. See [middleware skill](..\u002Fmiddleware\u002FSKILL.md).\n\n## Cross-References\n\n- See also: **ai-core\u002Fchat-experience\u002FSKILL.md** — Base `useChat` surface; the structured-output additions documented here layer on top.\n- See also: **ai-core\u002Fadapter-configuration\u002FSKILL.md** — Adapter handles structured-output strategy transparently.\n- See also: **ai-core\u002Ftool-calling\u002FSKILL.md** — Combine `tools` with `outputSchema` for an agent loop that runs tools first and returns a typed object. Tool-approval and client-tool flows compose with structured runs without extra wiring; see [docs\u002Fstructured-outputs\u002Fwith-tools.md](https:\u002F\u002Fgithub.com\u002FTanStack\u002Fai\u002Fblob\u002Fmain\u002Fdocs\u002Fstructured-outputs\u002Fwith-tools.md).\n- See also: **ai-core\u002Fmiddleware\u002FSKILL.md** — `onStructuredOutputConfig` hook and the `structuredOutput` phase for observing\u002Ftransforming the final structured-output call.\n",{"data":53,"body":63},{"name":5,"description":7,"type":54,"library":55,"library_version":56,"sources":57},"sub-skill","tanstack-ai","0.10.0",[58,59,60,61,62],"TanStack\u002Fai:docs\u002Fstructured-outputs\u002Foverview.md","TanStack\u002Fai:docs\u002Fstructured-outputs\u002Fone-shot.md","TanStack\u002Fai:docs\u002Fstructured-outputs\u002Fstreaming.md","TanStack\u002Fai:docs\u002Fstructured-outputs\u002Fmulti-turn.md","TanStack\u002Fai:docs\u002Fstructured-outputs\u002Fwith-tools.md",{"type":64,"children":65},"root",[66,75,100,107,614,651,700,706,813,819,826,1582,1588,2743,2749,2768,3520,3564,3572,3835,3928,3939,3945,3995,4005,4561,4569,5464,5570,5576,5604,7339,7344,7589,7595,7621,7633,7819,7895,8370,8383,8388,8407,8436,8501,8533,8839,8844,8850,8883,9235,9254,9259,9265,9285,9593,9610,9614,9620,9625,10126,10161,10165,10171,10214,10235,10241,10332],{"type":67,"tag":68,"props":69,"children":71},"element","h1",{"id":70},"structured-outputs",[72],{"type":73,"value":74},"text","Structured Outputs",{"type":67,"tag":76,"props":77,"children":78},"blockquote",{},[79],{"type":67,"tag":80,"props":81,"children":82},"p",{},[83,89,91,98],{"type":67,"tag":84,"props":85,"children":86},"strong",{},[87],{"type":73,"value":88},"Dependency note:",{"type":73,"value":90}," This skill builds on ai-core. Read it first for critical rules. The ",{"type":67,"tag":92,"props":93,"children":95},"code",{"className":94},[],[96],{"type":73,"value":97},"useChat",{"type":73,"value":99}," patterns below build on ai-core\u002Fchat-experience — read that for the base hook surface, then come back here for the structured-output specifics.",{"type":67,"tag":101,"props":102,"children":104},"h2",{"id":103},"setup",[105],{"type":73,"value":106},"Setup",{"type":67,"tag":108,"props":109,"children":113},"pre",{"className":110,"code":111,"language":15,"meta":112,"style":112},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { chat } from '@tanstack\u002Fai'\nimport { openaiText } from '@tanstack\u002Fai-openai'\nimport { z } from 'zod'\n\nconst person = await chat({\n  adapter: openaiText('gpt-5.2'),\n  messages: [{ role: 'user', content: 'John Doe, 30' }],\n  outputSchema: z.object({\n    name: z.string(),\n    age: z.number(),\n  }),\n})\n\nperson.name \u002F\u002F string — fully typed, no cast\nperson.age \u002F\u002F number\n","",[114],{"type":67,"tag":92,"props":115,"children":116},{"__ignoreMap":112},[117,167,205,243,253,293,340,425,460,495,529,546,560,568,592],{"type":67,"tag":118,"props":119,"children":122},"span",{"class":120,"line":121},"line",1,[123,129,135,141,146,151,156,162],{"type":67,"tag":118,"props":124,"children":126},{"style":125},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[127],{"type":73,"value":128},"import",{"type":67,"tag":118,"props":130,"children":132},{"style":131},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[133],{"type":73,"value":134}," {",{"type":67,"tag":118,"props":136,"children":138},{"style":137},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[139],{"type":73,"value":140}," chat",{"type":67,"tag":118,"props":142,"children":143},{"style":131},[144],{"type":73,"value":145}," }",{"type":67,"tag":118,"props":147,"children":148},{"style":125},[149],{"type":73,"value":150}," from",{"type":67,"tag":118,"props":152,"children":153},{"style":131},[154],{"type":73,"value":155}," '",{"type":67,"tag":118,"props":157,"children":159},{"style":158},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[160],{"type":73,"value":161},"@tanstack\u002Fai",{"type":67,"tag":118,"props":163,"children":164},{"style":131},[165],{"type":73,"value":166},"'\n",{"type":67,"tag":118,"props":168,"children":170},{"class":120,"line":169},2,[171,175,179,184,188,192,196,201],{"type":67,"tag":118,"props":172,"children":173},{"style":125},[174],{"type":73,"value":128},{"type":67,"tag":118,"props":176,"children":177},{"style":131},[178],{"type":73,"value":134},{"type":67,"tag":118,"props":180,"children":181},{"style":137},[182],{"type":73,"value":183}," openaiText",{"type":67,"tag":118,"props":185,"children":186},{"style":131},[187],{"type":73,"value":145},{"type":67,"tag":118,"props":189,"children":190},{"style":125},[191],{"type":73,"value":150},{"type":67,"tag":118,"props":193,"children":194},{"style":131},[195],{"type":73,"value":155},{"type":67,"tag":118,"props":197,"children":198},{"style":158},[199],{"type":73,"value":200},"@tanstack\u002Fai-openai",{"type":67,"tag":118,"props":202,"children":203},{"style":131},[204],{"type":73,"value":166},{"type":67,"tag":118,"props":206,"children":208},{"class":120,"line":207},3,[209,213,217,222,226,230,234,239],{"type":67,"tag":118,"props":210,"children":211},{"style":125},[212],{"type":73,"value":128},{"type":67,"tag":118,"props":214,"children":215},{"style":131},[216],{"type":73,"value":134},{"type":67,"tag":118,"props":218,"children":219},{"style":137},[220],{"type":73,"value":221}," z",{"type":67,"tag":118,"props":223,"children":224},{"style":131},[225],{"type":73,"value":145},{"type":67,"tag":118,"props":227,"children":228},{"style":125},[229],{"type":73,"value":150},{"type":67,"tag":118,"props":231,"children":232},{"style":131},[233],{"type":73,"value":155},{"type":67,"tag":118,"props":235,"children":236},{"style":158},[237],{"type":73,"value":238},"zod",{"type":67,"tag":118,"props":240,"children":241},{"style":131},[242],{"type":73,"value":166},{"type":67,"tag":118,"props":244,"children":246},{"class":120,"line":245},4,[247],{"type":67,"tag":118,"props":248,"children":250},{"emptyLinePlaceholder":249},true,[251],{"type":73,"value":252},"\n",{"type":67,"tag":118,"props":254,"children":256},{"class":120,"line":255},5,[257,263,268,273,278,283,288],{"type":67,"tag":118,"props":258,"children":260},{"style":259},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[261],{"type":73,"value":262},"const",{"type":67,"tag":118,"props":264,"children":265},{"style":137},[266],{"type":73,"value":267}," person ",{"type":67,"tag":118,"props":269,"children":270},{"style":131},[271],{"type":73,"value":272},"=",{"type":67,"tag":118,"props":274,"children":275},{"style":125},[276],{"type":73,"value":277}," await",{"type":67,"tag":118,"props":279,"children":281},{"style":280},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[282],{"type":73,"value":140},{"type":67,"tag":118,"props":284,"children":285},{"style":137},[286],{"type":73,"value":287},"(",{"type":67,"tag":118,"props":289,"children":290},{"style":131},[291],{"type":73,"value":292},"{\n",{"type":67,"tag":118,"props":294,"children":296},{"class":120,"line":295},6,[297,303,308,312,316,321,326,330,335],{"type":67,"tag":118,"props":298,"children":300},{"style":299},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[301],{"type":73,"value":302},"  adapter",{"type":67,"tag":118,"props":304,"children":305},{"style":131},[306],{"type":73,"value":307},":",{"type":67,"tag":118,"props":309,"children":310},{"style":280},[311],{"type":73,"value":183},{"type":67,"tag":118,"props":313,"children":314},{"style":137},[315],{"type":73,"value":287},{"type":67,"tag":118,"props":317,"children":318},{"style":131},[319],{"type":73,"value":320},"'",{"type":67,"tag":118,"props":322,"children":323},{"style":158},[324],{"type":73,"value":325},"gpt-5.2",{"type":67,"tag":118,"props":327,"children":328},{"style":131},[329],{"type":73,"value":320},{"type":67,"tag":118,"props":331,"children":332},{"style":137},[333],{"type":73,"value":334},")",{"type":67,"tag":118,"props":336,"children":337},{"style":131},[338],{"type":73,"value":339},",\n",{"type":67,"tag":118,"props":341,"children":343},{"class":120,"line":342},7,[344,349,353,358,363,368,372,376,381,385,390,395,399,403,408,412,416,421],{"type":67,"tag":118,"props":345,"children":346},{"style":299},[347],{"type":73,"value":348},"  messages",{"type":67,"tag":118,"props":350,"children":351},{"style":131},[352],{"type":73,"value":307},{"type":67,"tag":118,"props":354,"children":355},{"style":137},[356],{"type":73,"value":357}," [",{"type":67,"tag":118,"props":359,"children":360},{"style":131},[361],{"type":73,"value":362},"{",{"type":67,"tag":118,"props":364,"children":365},{"style":299},[366],{"type":73,"value":367}," role",{"type":67,"tag":118,"props":369,"children":370},{"style":131},[371],{"type":73,"value":307},{"type":67,"tag":118,"props":373,"children":374},{"style":131},[375],{"type":73,"value":155},{"type":67,"tag":118,"props":377,"children":378},{"style":158},[379],{"type":73,"value":380},"user",{"type":67,"tag":118,"props":382,"children":383},{"style":131},[384],{"type":73,"value":320},{"type":67,"tag":118,"props":386,"children":387},{"style":131},[388],{"type":73,"value":389},",",{"type":67,"tag":118,"props":391,"children":392},{"style":299},[393],{"type":73,"value":394}," content",{"type":67,"tag":118,"props":396,"children":397},{"style":131},[398],{"type":73,"value":307},{"type":67,"tag":118,"props":400,"children":401},{"style":131},[402],{"type":73,"value":155},{"type":67,"tag":118,"props":404,"children":405},{"style":158},[406],{"type":73,"value":407},"John Doe, 30",{"type":67,"tag":118,"props":409,"children":410},{"style":131},[411],{"type":73,"value":320},{"type":67,"tag":118,"props":413,"children":414},{"style":131},[415],{"type":73,"value":145},{"type":67,"tag":118,"props":417,"children":418},{"style":137},[419],{"type":73,"value":420},"]",{"type":67,"tag":118,"props":422,"children":423},{"style":131},[424],{"type":73,"value":339},{"type":67,"tag":118,"props":426,"children":428},{"class":120,"line":427},8,[429,434,438,442,447,452,456],{"type":67,"tag":118,"props":430,"children":431},{"style":299},[432],{"type":73,"value":433},"  outputSchema",{"type":67,"tag":118,"props":435,"children":436},{"style":131},[437],{"type":73,"value":307},{"type":67,"tag":118,"props":439,"children":440},{"style":137},[441],{"type":73,"value":221},{"type":67,"tag":118,"props":443,"children":444},{"style":131},[445],{"type":73,"value":446},".",{"type":67,"tag":118,"props":448,"children":449},{"style":280},[450],{"type":73,"value":451},"object",{"type":67,"tag":118,"props":453,"children":454},{"style":137},[455],{"type":73,"value":287},{"type":67,"tag":118,"props":457,"children":458},{"style":131},[459],{"type":73,"value":292},{"type":67,"tag":118,"props":461,"children":463},{"class":120,"line":462},9,[464,469,473,477,481,486,491],{"type":67,"tag":118,"props":465,"children":466},{"style":299},[467],{"type":73,"value":468},"    name",{"type":67,"tag":118,"props":470,"children":471},{"style":131},[472],{"type":73,"value":307},{"type":67,"tag":118,"props":474,"children":475},{"style":137},[476],{"type":73,"value":221},{"type":67,"tag":118,"props":478,"children":479},{"style":131},[480],{"type":73,"value":446},{"type":67,"tag":118,"props":482,"children":483},{"style":280},[484],{"type":73,"value":485},"string",{"type":67,"tag":118,"props":487,"children":488},{"style":137},[489],{"type":73,"value":490},"()",{"type":67,"tag":118,"props":492,"children":493},{"style":131},[494],{"type":73,"value":339},{"type":67,"tag":118,"props":496,"children":498},{"class":120,"line":497},10,[499,504,508,512,516,521,525],{"type":67,"tag":118,"props":500,"children":501},{"style":299},[502],{"type":73,"value":503},"    age",{"type":67,"tag":118,"props":505,"children":506},{"style":131},[507],{"type":73,"value":307},{"type":67,"tag":118,"props":509,"children":510},{"style":137},[511],{"type":73,"value":221},{"type":67,"tag":118,"props":513,"children":514},{"style":131},[515],{"type":73,"value":446},{"type":67,"tag":118,"props":517,"children":518},{"style":280},[519],{"type":73,"value":520},"number",{"type":67,"tag":118,"props":522,"children":523},{"style":137},[524],{"type":73,"value":490},{"type":67,"tag":118,"props":526,"children":527},{"style":131},[528],{"type":73,"value":339},{"type":67,"tag":118,"props":530,"children":532},{"class":120,"line":531},11,[533,538,542],{"type":67,"tag":118,"props":534,"children":535},{"style":131},[536],{"type":73,"value":537},"  }",{"type":67,"tag":118,"props":539,"children":540},{"style":137},[541],{"type":73,"value":334},{"type":67,"tag":118,"props":543,"children":544},{"style":131},[545],{"type":73,"value":339},{"type":67,"tag":118,"props":547,"children":549},{"class":120,"line":548},12,[550,555],{"type":67,"tag":118,"props":551,"children":552},{"style":131},[553],{"type":73,"value":554},"}",{"type":67,"tag":118,"props":556,"children":557},{"style":137},[558],{"type":73,"value":559},")\n",{"type":67,"tag":118,"props":561,"children":563},{"class":120,"line":562},13,[564],{"type":67,"tag":118,"props":565,"children":566},{"emptyLinePlaceholder":249},[567],{"type":73,"value":252},{"type":67,"tag":118,"props":569,"children":571},{"class":120,"line":570},14,[572,577,581,586],{"type":67,"tag":118,"props":573,"children":574},{"style":137},[575],{"type":73,"value":576},"person",{"type":67,"tag":118,"props":578,"children":579},{"style":131},[580],{"type":73,"value":446},{"type":67,"tag":118,"props":582,"children":583},{"style":137},[584],{"type":73,"value":585},"name ",{"type":67,"tag":118,"props":587,"children":589},{"style":588},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[590],{"type":73,"value":591},"\u002F\u002F string — fully typed, no cast\n",{"type":67,"tag":118,"props":593,"children":595},{"class":120,"line":594},15,[596,600,604,609],{"type":67,"tag":118,"props":597,"children":598},{"style":137},[599],{"type":73,"value":576},{"type":67,"tag":118,"props":601,"children":602},{"style":131},[603],{"type":73,"value":446},{"type":67,"tag":118,"props":605,"children":606},{"style":137},[607],{"type":73,"value":608},"age ",{"type":67,"tag":118,"props":610,"children":611},{"style":588},[612],{"type":73,"value":613},"\u002F\u002F number\n",{"type":67,"tag":80,"props":615,"children":616},{},[617,619,625,627,633,635,641,643,649],{"type":73,"value":618},"When ",{"type":67,"tag":92,"props":620,"children":622},{"className":621},[],[623],{"type":73,"value":624},"outputSchema",{"type":73,"value":626}," is provided, ",{"type":67,"tag":92,"props":628,"children":630},{"className":629},[],[631],{"type":73,"value":632},"chat()",{"type":73,"value":634}," returns ",{"type":67,"tag":92,"props":636,"children":638},{"className":637},[],[639],{"type":73,"value":640},"Promise\u003CInferSchemaType\u003CTSchema>>",{"type":73,"value":642}," instead of ",{"type":67,"tag":92,"props":644,"children":646},{"className":645},[],[647],{"type":73,"value":648},"AsyncIterable\u003CStreamChunk>",{"type":73,"value":650},". The result is fully typed.",{"type":67,"tag":80,"props":652,"children":653},{},[654,656,662,664,670,672,677,679,684,686,691,693,698],{"type":73,"value":655},"Adding ",{"type":67,"tag":92,"props":657,"children":659},{"className":658},[],[660],{"type":73,"value":661},"stream: true",{"type":73,"value":663}," switches the return to ",{"type":67,"tag":92,"props":665,"children":667},{"className":666},[],[668],{"type":73,"value":669},"StructuredOutputStream\u003CInferSchemaType\u003CTSchema>>",{"type":73,"value":671}," — incremental JSON deltas plus a terminal validated object. See ",{"type":67,"tag":84,"props":673,"children":674},{},[675],{"type":73,"value":676},"Pattern 3",{"type":73,"value":678}," below for direct iteration, ",{"type":67,"tag":84,"props":680,"children":681},{},[682],{"type":73,"value":683},"Pattern 4",{"type":73,"value":685}," for the ",{"type":67,"tag":92,"props":687,"children":689},{"className":688},[],[690],{"type":73,"value":97},{"type":73,"value":692}," shape on the client, and ",{"type":67,"tag":84,"props":694,"children":695},{},[696],{"type":73,"value":697},"Pattern 5",{"type":73,"value":699}," for multi-turn structured chats.",{"type":67,"tag":101,"props":701,"children":703},{"id":702},"decision-which-pattern-fits",[704],{"type":73,"value":705},"Decision: which pattern fits",{"type":67,"tag":707,"props":708,"children":709},"table",{},[710,729],{"type":67,"tag":711,"props":712,"children":713},"thead",{},[714],{"type":67,"tag":715,"props":716,"children":717},"tr",{},[718,724],{"type":67,"tag":719,"props":720,"children":721},"th",{},[722],{"type":73,"value":723},"Building this",{"type":67,"tag":719,"props":725,"children":726},{},[727],{"type":73,"value":728},"Use",{"type":67,"tag":730,"props":731,"children":732},"tbody",{},[733,747,766,779,792],{"type":67,"tag":715,"props":734,"children":735},{},[736,742],{"type":67,"tag":737,"props":738,"children":739},"td",{},[740],{"type":73,"value":741},"One prompt in → one typed object out (script, server endpoint, CLI)",{"type":67,"tag":737,"props":743,"children":744},{},[745],{"type":73,"value":746},"Pattern 1 (basic) or 2 (nested)",{"type":67,"tag":715,"props":748,"children":749},{},[750,755],{"type":67,"tag":737,"props":751,"children":752},{},[753],{"type":73,"value":754},"A UI that fills in field by field as the model streams (progressive form, live card)",{"type":67,"tag":737,"props":756,"children":757},{},[758,760],{"type":73,"value":759},"Pattern 4 — ",{"type":67,"tag":92,"props":761,"children":763},{"className":762},[],[764],{"type":73,"value":765},"useChat({ outputSchema })",{"type":67,"tag":715,"props":767,"children":768},{},[769,774],{"type":67,"tag":737,"props":770,"children":771},{},[772],{"type":73,"value":773},"Direct iteration of the stream in Node or tests",{"type":67,"tag":737,"props":775,"children":776},{},[777],{"type":73,"value":778},"Pattern 3 — async iterable",{"type":67,"tag":715,"props":780,"children":781},{},[782,787],{"type":67,"tag":737,"props":783,"children":784},{},[785],{"type":73,"value":786},"Users iterate on a structured object across multiple turns (recipe builder, ticket refinement)",{"type":67,"tag":737,"props":788,"children":789},{},[790],{"type":73,"value":791},"Pattern 5 — multi-turn structured chat",{"type":67,"tag":715,"props":793,"children":794},{},[795,800],{"type":67,"tag":737,"props":796,"children":797},{},[798],{"type":73,"value":799},"Tools that gather info, then return a typed object",{"type":67,"tag":737,"props":801,"children":802},{},[803,805,811],{"type":73,"value":804},"Combine any of the above with ",{"type":67,"tag":92,"props":806,"children":808},{"className":807},[],[809],{"type":73,"value":810},"tools",{"type":73,"value":812}," — see ai-core\u002Ftool-calling",{"type":67,"tag":101,"props":814,"children":816},{"id":815},"core-patterns",[817],{"type":73,"value":818},"Core Patterns",{"type":67,"tag":820,"props":821,"children":823},"h3",{"id":822},"pattern-1-basic-structured-output-with-zod",[824],{"type":73,"value":825},"Pattern 1: Basic structured output with Zod",{"type":67,"tag":108,"props":827,"children":829},{"className":110,"code":828,"language":15,"meta":112,"style":112},"import { chat } from '@tanstack\u002Fai'\nimport { openaiText } from '@tanstack\u002Fai-openai'\nimport { z } from 'zod'\n\nconst PersonSchema = z.object({\n  name: z.string().meta({ description: \"The person's full name\" }),\n  age: z.number().meta({ description: \"The person's age in years\" }),\n  email: z.string().email().meta({ description: 'Email address' }),\n})\n\n\u002F\u002F chat() returns Promise\u003C{ name: string; age: number; email: string }>\nconst person = await chat({\n  adapter: openaiText('gpt-5.2'),\n  messages: [\n    {\n      role: 'user',\n      content:\n        'Extract the person info: John Doe is 30 years old, email john@example.com',\n    },\n  ],\n  outputSchema: PersonSchema,\n})\n\nconsole.log(person.name) \u002F\u002F \"John Doe\"\nconsole.log(person.age) \u002F\u002F 30\nconsole.log(person.email) \u002F\u002F \"john@example.com\"\n",[830],{"type":67,"tag":92,"props":831,"children":832},{"__ignoreMap":112},[833,868,903,938,945,981,1062,1139,1229,1240,1247,1255,1286,1325,1341,1349,1378,1392,1414,1423,1436,1457,1469,1477,1514,1548],{"type":67,"tag":118,"props":834,"children":835},{"class":120,"line":121},[836,840,844,848,852,856,860,864],{"type":67,"tag":118,"props":837,"children":838},{"style":125},[839],{"type":73,"value":128},{"type":67,"tag":118,"props":841,"children":842},{"style":131},[843],{"type":73,"value":134},{"type":67,"tag":118,"props":845,"children":846},{"style":137},[847],{"type":73,"value":140},{"type":67,"tag":118,"props":849,"children":850},{"style":131},[851],{"type":73,"value":145},{"type":67,"tag":118,"props":853,"children":854},{"style":125},[855],{"type":73,"value":150},{"type":67,"tag":118,"props":857,"children":858},{"style":131},[859],{"type":73,"value":155},{"type":67,"tag":118,"props":861,"children":862},{"style":158},[863],{"type":73,"value":161},{"type":67,"tag":118,"props":865,"children":866},{"style":131},[867],{"type":73,"value":166},{"type":67,"tag":118,"props":869,"children":870},{"class":120,"line":169},[871,875,879,883,887,891,895,899],{"type":67,"tag":118,"props":872,"children":873},{"style":125},[874],{"type":73,"value":128},{"type":67,"tag":118,"props":876,"children":877},{"style":131},[878],{"type":73,"value":134},{"type":67,"tag":118,"props":880,"children":881},{"style":137},[882],{"type":73,"value":183},{"type":67,"tag":118,"props":884,"children":885},{"style":131},[886],{"type":73,"value":145},{"type":67,"tag":118,"props":888,"children":889},{"style":125},[890],{"type":73,"value":150},{"type":67,"tag":118,"props":892,"children":893},{"style":131},[894],{"type":73,"value":155},{"type":67,"tag":118,"props":896,"children":897},{"style":158},[898],{"type":73,"value":200},{"type":67,"tag":118,"props":900,"children":901},{"style":131},[902],{"type":73,"value":166},{"type":67,"tag":118,"props":904,"children":905},{"class":120,"line":207},[906,910,914,918,922,926,930,934],{"type":67,"tag":118,"props":907,"children":908},{"style":125},[909],{"type":73,"value":128},{"type":67,"tag":118,"props":911,"children":912},{"style":131},[913],{"type":73,"value":134},{"type":67,"tag":118,"props":915,"children":916},{"style":137},[917],{"type":73,"value":221},{"type":67,"tag":118,"props":919,"children":920},{"style":131},[921],{"type":73,"value":145},{"type":67,"tag":118,"props":923,"children":924},{"style":125},[925],{"type":73,"value":150},{"type":67,"tag":118,"props":927,"children":928},{"style":131},[929],{"type":73,"value":155},{"type":67,"tag":118,"props":931,"children":932},{"style":158},[933],{"type":73,"value":238},{"type":67,"tag":118,"props":935,"children":936},{"style":131},[937],{"type":73,"value":166},{"type":67,"tag":118,"props":939,"children":940},{"class":120,"line":245},[941],{"type":67,"tag":118,"props":942,"children":943},{"emptyLinePlaceholder":249},[944],{"type":73,"value":252},{"type":67,"tag":118,"props":946,"children":947},{"class":120,"line":255},[948,952,957,961,965,969,973,977],{"type":67,"tag":118,"props":949,"children":950},{"style":259},[951],{"type":73,"value":262},{"type":67,"tag":118,"props":953,"children":954},{"style":137},[955],{"type":73,"value":956}," PersonSchema ",{"type":67,"tag":118,"props":958,"children":959},{"style":131},[960],{"type":73,"value":272},{"type":67,"tag":118,"props":962,"children":963},{"style":137},[964],{"type":73,"value":221},{"type":67,"tag":118,"props":966,"children":967},{"style":131},[968],{"type":73,"value":446},{"type":67,"tag":118,"props":970,"children":971},{"style":280},[972],{"type":73,"value":451},{"type":67,"tag":118,"props":974,"children":975},{"style":137},[976],{"type":73,"value":287},{"type":67,"tag":118,"props":978,"children":979},{"style":131},[980],{"type":73,"value":292},{"type":67,"tag":118,"props":982,"children":983},{"class":120,"line":295},[984,989,993,997,1001,1005,1009,1013,1018,1022,1026,1031,1035,1040,1045,1050,1054,1058],{"type":67,"tag":118,"props":985,"children":986},{"style":299},[987],{"type":73,"value":988},"  name",{"type":67,"tag":118,"props":990,"children":991},{"style":131},[992],{"type":73,"value":307},{"type":67,"tag":118,"props":994,"children":995},{"style":137},[996],{"type":73,"value":221},{"type":67,"tag":118,"props":998,"children":999},{"style":131},[1000],{"type":73,"value":446},{"type":67,"tag":118,"props":1002,"children":1003},{"style":280},[1004],{"type":73,"value":485},{"type":67,"tag":118,"props":1006,"children":1007},{"style":137},[1008],{"type":73,"value":490},{"type":67,"tag":118,"props":1010,"children":1011},{"style":131},[1012],{"type":73,"value":446},{"type":67,"tag":118,"props":1014,"children":1015},{"style":280},[1016],{"type":73,"value":1017},"meta",{"type":67,"tag":118,"props":1019,"children":1020},{"style":137},[1021],{"type":73,"value":287},{"type":67,"tag":118,"props":1023,"children":1024},{"style":131},[1025],{"type":73,"value":362},{"type":67,"tag":118,"props":1027,"children":1028},{"style":299},[1029],{"type":73,"value":1030}," description",{"type":67,"tag":118,"props":1032,"children":1033},{"style":131},[1034],{"type":73,"value":307},{"type":67,"tag":118,"props":1036,"children":1037},{"style":131},[1038],{"type":73,"value":1039}," \"",{"type":67,"tag":118,"props":1041,"children":1042},{"style":158},[1043],{"type":73,"value":1044},"The person's full name",{"type":67,"tag":118,"props":1046,"children":1047},{"style":131},[1048],{"type":73,"value":1049},"\"",{"type":67,"tag":118,"props":1051,"children":1052},{"style":131},[1053],{"type":73,"value":145},{"type":67,"tag":118,"props":1055,"children":1056},{"style":137},[1057],{"type":73,"value":334},{"type":67,"tag":118,"props":1059,"children":1060},{"style":131},[1061],{"type":73,"value":339},{"type":67,"tag":118,"props":1063,"children":1064},{"class":120,"line":342},[1065,1070,1074,1078,1082,1086,1090,1094,1098,1102,1106,1110,1114,1118,1123,1127,1131,1135],{"type":67,"tag":118,"props":1066,"children":1067},{"style":299},[1068],{"type":73,"value":1069},"  age",{"type":67,"tag":118,"props":1071,"children":1072},{"style":131},[1073],{"type":73,"value":307},{"type":67,"tag":118,"props":1075,"children":1076},{"style":137},[1077],{"type":73,"value":221},{"type":67,"tag":118,"props":1079,"children":1080},{"style":131},[1081],{"type":73,"value":446},{"type":67,"tag":118,"props":1083,"children":1084},{"style":280},[1085],{"type":73,"value":520},{"type":67,"tag":118,"props":1087,"children":1088},{"style":137},[1089],{"type":73,"value":490},{"type":67,"tag":118,"props":1091,"children":1092},{"style":131},[1093],{"type":73,"value":446},{"type":67,"tag":118,"props":1095,"children":1096},{"style":280},[1097],{"type":73,"value":1017},{"type":67,"tag":118,"props":1099,"children":1100},{"style":137},[1101],{"type":73,"value":287},{"type":67,"tag":118,"props":1103,"children":1104},{"style":131},[1105],{"type":73,"value":362},{"type":67,"tag":118,"props":1107,"children":1108},{"style":299},[1109],{"type":73,"value":1030},{"type":67,"tag":118,"props":1111,"children":1112},{"style":131},[1113],{"type":73,"value":307},{"type":67,"tag":118,"props":1115,"children":1116},{"style":131},[1117],{"type":73,"value":1039},{"type":67,"tag":118,"props":1119,"children":1120},{"style":158},[1121],{"type":73,"value":1122},"The person's age in years",{"type":67,"tag":118,"props":1124,"children":1125},{"style":131},[1126],{"type":73,"value":1049},{"type":67,"tag":118,"props":1128,"children":1129},{"style":131},[1130],{"type":73,"value":145},{"type":67,"tag":118,"props":1132,"children":1133},{"style":137},[1134],{"type":73,"value":334},{"type":67,"tag":118,"props":1136,"children":1137},{"style":131},[1138],{"type":73,"value":339},{"type":67,"tag":118,"props":1140,"children":1141},{"class":120,"line":427},[1142,1147,1151,1155,1159,1163,1167,1171,1176,1180,1184,1188,1192,1196,1200,1204,1208,1213,1217,1221,1225],{"type":67,"tag":118,"props":1143,"children":1144},{"style":299},[1145],{"type":73,"value":1146},"  email",{"type":67,"tag":118,"props":1148,"children":1149},{"style":131},[1150],{"type":73,"value":307},{"type":67,"tag":118,"props":1152,"children":1153},{"style":137},[1154],{"type":73,"value":221},{"type":67,"tag":118,"props":1156,"children":1157},{"style":131},[1158],{"type":73,"value":446},{"type":67,"tag":118,"props":1160,"children":1161},{"style":280},[1162],{"type":73,"value":485},{"type":67,"tag":118,"props":1164,"children":1165},{"style":137},[1166],{"type":73,"value":490},{"type":67,"tag":118,"props":1168,"children":1169},{"style":131},[1170],{"type":73,"value":446},{"type":67,"tag":118,"props":1172,"children":1173},{"style":280},[1174],{"type":73,"value":1175},"email",{"type":67,"tag":118,"props":1177,"children":1178},{"style":137},[1179],{"type":73,"value":490},{"type":67,"tag":118,"props":1181,"children":1182},{"style":131},[1183],{"type":73,"value":446},{"type":67,"tag":118,"props":1185,"children":1186},{"style":280},[1187],{"type":73,"value":1017},{"type":67,"tag":118,"props":1189,"children":1190},{"style":137},[1191],{"type":73,"value":287},{"type":67,"tag":118,"props":1193,"children":1194},{"style":131},[1195],{"type":73,"value":362},{"type":67,"tag":118,"props":1197,"children":1198},{"style":299},[1199],{"type":73,"value":1030},{"type":67,"tag":118,"props":1201,"children":1202},{"style":131},[1203],{"type":73,"value":307},{"type":67,"tag":118,"props":1205,"children":1206},{"style":131},[1207],{"type":73,"value":155},{"type":67,"tag":118,"props":1209,"children":1210},{"style":158},[1211],{"type":73,"value":1212},"Email address",{"type":67,"tag":118,"props":1214,"children":1215},{"style":131},[1216],{"type":73,"value":320},{"type":67,"tag":118,"props":1218,"children":1219},{"style":131},[1220],{"type":73,"value":145},{"type":67,"tag":118,"props":1222,"children":1223},{"style":137},[1224],{"type":73,"value":334},{"type":67,"tag":118,"props":1226,"children":1227},{"style":131},[1228],{"type":73,"value":339},{"type":67,"tag":118,"props":1230,"children":1231},{"class":120,"line":462},[1232,1236],{"type":67,"tag":118,"props":1233,"children":1234},{"style":131},[1235],{"type":73,"value":554},{"type":67,"tag":118,"props":1237,"children":1238},{"style":137},[1239],{"type":73,"value":559},{"type":67,"tag":118,"props":1241,"children":1242},{"class":120,"line":497},[1243],{"type":67,"tag":118,"props":1244,"children":1245},{"emptyLinePlaceholder":249},[1246],{"type":73,"value":252},{"type":67,"tag":118,"props":1248,"children":1249},{"class":120,"line":531},[1250],{"type":67,"tag":118,"props":1251,"children":1252},{"style":588},[1253],{"type":73,"value":1254},"\u002F\u002F chat() returns Promise\u003C{ name: string; age: number; email: string }>\n",{"type":67,"tag":118,"props":1256,"children":1257},{"class":120,"line":548},[1258,1262,1266,1270,1274,1278,1282],{"type":67,"tag":118,"props":1259,"children":1260},{"style":259},[1261],{"type":73,"value":262},{"type":67,"tag":118,"props":1263,"children":1264},{"style":137},[1265],{"type":73,"value":267},{"type":67,"tag":118,"props":1267,"children":1268},{"style":131},[1269],{"type":73,"value":272},{"type":67,"tag":118,"props":1271,"children":1272},{"style":125},[1273],{"type":73,"value":277},{"type":67,"tag":118,"props":1275,"children":1276},{"style":280},[1277],{"type":73,"value":140},{"type":67,"tag":118,"props":1279,"children":1280},{"style":137},[1281],{"type":73,"value":287},{"type":67,"tag":118,"props":1283,"children":1284},{"style":131},[1285],{"type":73,"value":292},{"type":67,"tag":118,"props":1287,"children":1288},{"class":120,"line":562},[1289,1293,1297,1301,1305,1309,1313,1317,1321],{"type":67,"tag":118,"props":1290,"children":1291},{"style":299},[1292],{"type":73,"value":302},{"type":67,"tag":118,"props":1294,"children":1295},{"style":131},[1296],{"type":73,"value":307},{"type":67,"tag":118,"props":1298,"children":1299},{"style":280},[1300],{"type":73,"value":183},{"type":67,"tag":118,"props":1302,"children":1303},{"style":137},[1304],{"type":73,"value":287},{"type":67,"tag":118,"props":1306,"children":1307},{"style":131},[1308],{"type":73,"value":320},{"type":67,"tag":118,"props":1310,"children":1311},{"style":158},[1312],{"type":73,"value":325},{"type":67,"tag":118,"props":1314,"children":1315},{"style":131},[1316],{"type":73,"value":320},{"type":67,"tag":118,"props":1318,"children":1319},{"style":137},[1320],{"type":73,"value":334},{"type":67,"tag":118,"props":1322,"children":1323},{"style":131},[1324],{"type":73,"value":339},{"type":67,"tag":118,"props":1326,"children":1327},{"class":120,"line":570},[1328,1332,1336],{"type":67,"tag":118,"props":1329,"children":1330},{"style":299},[1331],{"type":73,"value":348},{"type":67,"tag":118,"props":1333,"children":1334},{"style":131},[1335],{"type":73,"value":307},{"type":67,"tag":118,"props":1337,"children":1338},{"style":137},[1339],{"type":73,"value":1340}," [\n",{"type":67,"tag":118,"props":1342,"children":1343},{"class":120,"line":594},[1344],{"type":67,"tag":118,"props":1345,"children":1346},{"style":131},[1347],{"type":73,"value":1348},"    {\n",{"type":67,"tag":118,"props":1350,"children":1352},{"class":120,"line":1351},16,[1353,1358,1362,1366,1370,1374],{"type":67,"tag":118,"props":1354,"children":1355},{"style":299},[1356],{"type":73,"value":1357},"      role",{"type":67,"tag":118,"props":1359,"children":1360},{"style":131},[1361],{"type":73,"value":307},{"type":67,"tag":118,"props":1363,"children":1364},{"style":131},[1365],{"type":73,"value":155},{"type":67,"tag":118,"props":1367,"children":1368},{"style":158},[1369],{"type":73,"value":380},{"type":67,"tag":118,"props":1371,"children":1372},{"style":131},[1373],{"type":73,"value":320},{"type":67,"tag":118,"props":1375,"children":1376},{"style":131},[1377],{"type":73,"value":339},{"type":67,"tag":118,"props":1379,"children":1381},{"class":120,"line":1380},17,[1382,1387],{"type":67,"tag":118,"props":1383,"children":1384},{"style":299},[1385],{"type":73,"value":1386},"      content",{"type":67,"tag":118,"props":1388,"children":1389},{"style":131},[1390],{"type":73,"value":1391},":\n",{"type":67,"tag":118,"props":1393,"children":1395},{"class":120,"line":1394},18,[1396,1401,1406,1410],{"type":67,"tag":118,"props":1397,"children":1398},{"style":131},[1399],{"type":73,"value":1400},"        '",{"type":67,"tag":118,"props":1402,"children":1403},{"style":158},[1404],{"type":73,"value":1405},"Extract the person info: John Doe is 30 years old, email john@example.com",{"type":67,"tag":118,"props":1407,"children":1408},{"style":131},[1409],{"type":73,"value":320},{"type":67,"tag":118,"props":1411,"children":1412},{"style":131},[1413],{"type":73,"value":339},{"type":67,"tag":118,"props":1415,"children":1417},{"class":120,"line":1416},19,[1418],{"type":67,"tag":118,"props":1419,"children":1420},{"style":131},[1421],{"type":73,"value":1422},"    },\n",{"type":67,"tag":118,"props":1424,"children":1426},{"class":120,"line":1425},20,[1427,1432],{"type":67,"tag":118,"props":1428,"children":1429},{"style":137},[1430],{"type":73,"value":1431},"  ]",{"type":67,"tag":118,"props":1433,"children":1434},{"style":131},[1435],{"type":73,"value":339},{"type":67,"tag":118,"props":1437,"children":1439},{"class":120,"line":1438},21,[1440,1444,1448,1453],{"type":67,"tag":118,"props":1441,"children":1442},{"style":299},[1443],{"type":73,"value":433},{"type":67,"tag":118,"props":1445,"children":1446},{"style":131},[1447],{"type":73,"value":307},{"type":67,"tag":118,"props":1449,"children":1450},{"style":137},[1451],{"type":73,"value":1452}," PersonSchema",{"type":67,"tag":118,"props":1454,"children":1455},{"style":131},[1456],{"type":73,"value":339},{"type":67,"tag":118,"props":1458,"children":1460},{"class":120,"line":1459},22,[1461,1465],{"type":67,"tag":118,"props":1462,"children":1463},{"style":131},[1464],{"type":73,"value":554},{"type":67,"tag":118,"props":1466,"children":1467},{"style":137},[1468],{"type":73,"value":559},{"type":67,"tag":118,"props":1470,"children":1472},{"class":120,"line":1471},23,[1473],{"type":67,"tag":118,"props":1474,"children":1475},{"emptyLinePlaceholder":249},[1476],{"type":73,"value":252},{"type":67,"tag":118,"props":1478,"children":1480},{"class":120,"line":1479},24,[1481,1486,1490,1495,1500,1504,1509],{"type":67,"tag":118,"props":1482,"children":1483},{"style":137},[1484],{"type":73,"value":1485},"console",{"type":67,"tag":118,"props":1487,"children":1488},{"style":131},[1489],{"type":73,"value":446},{"type":67,"tag":118,"props":1491,"children":1492},{"style":280},[1493],{"type":73,"value":1494},"log",{"type":67,"tag":118,"props":1496,"children":1497},{"style":137},[1498],{"type":73,"value":1499},"(person",{"type":67,"tag":118,"props":1501,"children":1502},{"style":131},[1503],{"type":73,"value":446},{"type":67,"tag":118,"props":1505,"children":1506},{"style":137},[1507],{"type":73,"value":1508},"name) ",{"type":67,"tag":118,"props":1510,"children":1511},{"style":588},[1512],{"type":73,"value":1513},"\u002F\u002F \"John Doe\"\n",{"type":67,"tag":118,"props":1515,"children":1517},{"class":120,"line":1516},25,[1518,1522,1526,1530,1534,1538,1543],{"type":67,"tag":118,"props":1519,"children":1520},{"style":137},[1521],{"type":73,"value":1485},{"type":67,"tag":118,"props":1523,"children":1524},{"style":131},[1525],{"type":73,"value":446},{"type":67,"tag":118,"props":1527,"children":1528},{"style":280},[1529],{"type":73,"value":1494},{"type":67,"tag":118,"props":1531,"children":1532},{"style":137},[1533],{"type":73,"value":1499},{"type":67,"tag":118,"props":1535,"children":1536},{"style":131},[1537],{"type":73,"value":446},{"type":67,"tag":118,"props":1539,"children":1540},{"style":137},[1541],{"type":73,"value":1542},"age) ",{"type":67,"tag":118,"props":1544,"children":1545},{"style":588},[1546],{"type":73,"value":1547},"\u002F\u002F 30\n",{"type":67,"tag":118,"props":1549,"children":1551},{"class":120,"line":1550},26,[1552,1556,1560,1564,1568,1572,1577],{"type":67,"tag":118,"props":1553,"children":1554},{"style":137},[1555],{"type":73,"value":1485},{"type":67,"tag":118,"props":1557,"children":1558},{"style":131},[1559],{"type":73,"value":446},{"type":67,"tag":118,"props":1561,"children":1562},{"style":280},[1563],{"type":73,"value":1494},{"type":67,"tag":118,"props":1565,"children":1566},{"style":137},[1567],{"type":73,"value":1499},{"type":67,"tag":118,"props":1569,"children":1570},{"style":131},[1571],{"type":73,"value":446},{"type":67,"tag":118,"props":1573,"children":1574},{"style":137},[1575],{"type":73,"value":1576},"email) ",{"type":67,"tag":118,"props":1578,"children":1579},{"style":588},[1580],{"type":73,"value":1581},"\u002F\u002F \"john@example.com\"\n",{"type":67,"tag":820,"props":1583,"children":1585},{"id":1584},"pattern-2-complex-nested-schemas",[1586],{"type":73,"value":1587},"Pattern 2: Complex nested schemas",{"type":67,"tag":108,"props":1589,"children":1591},{"className":110,"code":1590,"language":15,"meta":112,"style":112},"import { chat } from '@tanstack\u002Fai'\nimport { anthropicText } from '@tanstack\u002Fai-anthropic'\nimport { z } from 'zod'\n\nconst CompanySchema = z.object({\n  name: z.string(),\n  founded: z.number().meta({ description: 'Year the company was founded' }),\n  headquarters: z.object({\n    city: z.string(),\n    country: z.string(),\n    address: z.string().optional(),\n  }),\n  employees: z.array(\n    z.object({\n      name: z.string(),\n      role: z.string(),\n      department: z.string(),\n    }),\n  ),\n  financials: z\n    .object({\n      revenue: z\n        .number()\n        .meta({ description: 'Annual revenue in millions USD' }),\n      profitable: z.boolean(),\n    })\n    .optional(),\n})\n\nconst company = await chat({\n  adapter: anthropicText('claude-sonnet-4-5'),\n  messages: [\n    {\n      role: 'user',\n      content: 'Extract company info from this article: ...',\n    },\n  ],\n  outputSchema: CompanySchema,\n})\n\n\u002F\u002F Full type safety on nested properties\nconsole.log(company.headquarters.city)\nconsole.log(company.employees[0].role)\nconsole.log(company.financials?.revenue)\n",[1592],{"type":67,"tag":92,"props":1593,"children":1594},{"__ignoreMap":112},[1595,1630,1667,1702,1709,1745,1776,1853,1885,1917,1949,1994,2009,2039,2063,2095,2126,2158,2174,2186,2203,2223,2239,2256,2308,2341,2352,2372,2384,2392,2425,2466,2482,2490,2518,2547,2555,2567,2588,2600,2608,2617,2656,2704],{"type":67,"tag":118,"props":1596,"children":1597},{"class":120,"line":121},[1598,1602,1606,1610,1614,1618,1622,1626],{"type":67,"tag":118,"props":1599,"children":1600},{"style":125},[1601],{"type":73,"value":128},{"type":67,"tag":118,"props":1603,"children":1604},{"style":131},[1605],{"type":73,"value":134},{"type":67,"tag":118,"props":1607,"children":1608},{"style":137},[1609],{"type":73,"value":140},{"type":67,"tag":118,"props":1611,"children":1612},{"style":131},[1613],{"type":73,"value":145},{"type":67,"tag":118,"props":1615,"children":1616},{"style":125},[1617],{"type":73,"value":150},{"type":67,"tag":118,"props":1619,"children":1620},{"style":131},[1621],{"type":73,"value":155},{"type":67,"tag":118,"props":1623,"children":1624},{"style":158},[1625],{"type":73,"value":161},{"type":67,"tag":118,"props":1627,"children":1628},{"style":131},[1629],{"type":73,"value":166},{"type":67,"tag":118,"props":1631,"children":1632},{"class":120,"line":169},[1633,1637,1641,1646,1650,1654,1658,1663],{"type":67,"tag":118,"props":1634,"children":1635},{"style":125},[1636],{"type":73,"value":128},{"type":67,"tag":118,"props":1638,"children":1639},{"style":131},[1640],{"type":73,"value":134},{"type":67,"tag":118,"props":1642,"children":1643},{"style":137},[1644],{"type":73,"value":1645}," anthropicText",{"type":67,"tag":118,"props":1647,"children":1648},{"style":131},[1649],{"type":73,"value":145},{"type":67,"tag":118,"props":1651,"children":1652},{"style":125},[1653],{"type":73,"value":150},{"type":67,"tag":118,"props":1655,"children":1656},{"style":131},[1657],{"type":73,"value":155},{"type":67,"tag":118,"props":1659,"children":1660},{"style":158},[1661],{"type":73,"value":1662},"@tanstack\u002Fai-anthropic",{"type":67,"tag":118,"props":1664,"children":1665},{"style":131},[1666],{"type":73,"value":166},{"type":67,"tag":118,"props":1668,"children":1669},{"class":120,"line":207},[1670,1674,1678,1682,1686,1690,1694,1698],{"type":67,"tag":118,"props":1671,"children":1672},{"style":125},[1673],{"type":73,"value":128},{"type":67,"tag":118,"props":1675,"children":1676},{"style":131},[1677],{"type":73,"value":134},{"type":67,"tag":118,"props":1679,"children":1680},{"style":137},[1681],{"type":73,"value":221},{"type":67,"tag":118,"props":1683,"children":1684},{"style":131},[1685],{"type":73,"value":145},{"type":67,"tag":118,"props":1687,"children":1688},{"style":125},[1689],{"type":73,"value":150},{"type":67,"tag":118,"props":1691,"children":1692},{"style":131},[1693],{"type":73,"value":155},{"type":67,"tag":118,"props":1695,"children":1696},{"style":158},[1697],{"type":73,"value":238},{"type":67,"tag":118,"props":1699,"children":1700},{"style":131},[1701],{"type":73,"value":166},{"type":67,"tag":118,"props":1703,"children":1704},{"class":120,"line":245},[1705],{"type":67,"tag":118,"props":1706,"children":1707},{"emptyLinePlaceholder":249},[1708],{"type":73,"value":252},{"type":67,"tag":118,"props":1710,"children":1711},{"class":120,"line":255},[1712,1716,1721,1725,1729,1733,1737,1741],{"type":67,"tag":118,"props":1713,"children":1714},{"style":259},[1715],{"type":73,"value":262},{"type":67,"tag":118,"props":1717,"children":1718},{"style":137},[1719],{"type":73,"value":1720}," CompanySchema ",{"type":67,"tag":118,"props":1722,"children":1723},{"style":131},[1724],{"type":73,"value":272},{"type":67,"tag":118,"props":1726,"children":1727},{"style":137},[1728],{"type":73,"value":221},{"type":67,"tag":118,"props":1730,"children":1731},{"style":131},[1732],{"type":73,"value":446},{"type":67,"tag":118,"props":1734,"children":1735},{"style":280},[1736],{"type":73,"value":451},{"type":67,"tag":118,"props":1738,"children":1739},{"style":137},[1740],{"type":73,"value":287},{"type":67,"tag":118,"props":1742,"children":1743},{"style":131},[1744],{"type":73,"value":292},{"type":67,"tag":118,"props":1746,"children":1747},{"class":120,"line":295},[1748,1752,1756,1760,1764,1768,1772],{"type":67,"tag":118,"props":1749,"children":1750},{"style":299},[1751],{"type":73,"value":988},{"type":67,"tag":118,"props":1753,"children":1754},{"style":131},[1755],{"type":73,"value":307},{"type":67,"tag":118,"props":1757,"children":1758},{"style":137},[1759],{"type":73,"value":221},{"type":67,"tag":118,"props":1761,"children":1762},{"style":131},[1763],{"type":73,"value":446},{"type":67,"tag":118,"props":1765,"children":1766},{"style":280},[1767],{"type":73,"value":485},{"type":67,"tag":118,"props":1769,"children":1770},{"style":137},[1771],{"type":73,"value":490},{"type":67,"tag":118,"props":1773,"children":1774},{"style":131},[1775],{"type":73,"value":339},{"type":67,"tag":118,"props":1777,"children":1778},{"class":120,"line":342},[1779,1784,1788,1792,1796,1800,1804,1808,1812,1816,1820,1824,1828,1832,1837,1841,1845,1849],{"type":67,"tag":118,"props":1780,"children":1781},{"style":299},[1782],{"type":73,"value":1783},"  founded",{"type":67,"tag":118,"props":1785,"children":1786},{"style":131},[1787],{"type":73,"value":307},{"type":67,"tag":118,"props":1789,"children":1790},{"style":137},[1791],{"type":73,"value":221},{"type":67,"tag":118,"props":1793,"children":1794},{"style":131},[1795],{"type":73,"value":446},{"type":67,"tag":118,"props":1797,"children":1798},{"style":280},[1799],{"type":73,"value":520},{"type":67,"tag":118,"props":1801,"children":1802},{"style":137},[1803],{"type":73,"value":490},{"type":67,"tag":118,"props":1805,"children":1806},{"style":131},[1807],{"type":73,"value":446},{"type":67,"tag":118,"props":1809,"children":1810},{"style":280},[1811],{"type":73,"value":1017},{"type":67,"tag":118,"props":1813,"children":1814},{"style":137},[1815],{"type":73,"value":287},{"type":67,"tag":118,"props":1817,"children":1818},{"style":131},[1819],{"type":73,"value":362},{"type":67,"tag":118,"props":1821,"children":1822},{"style":299},[1823],{"type":73,"value":1030},{"type":67,"tag":118,"props":1825,"children":1826},{"style":131},[1827],{"type":73,"value":307},{"type":67,"tag":118,"props":1829,"children":1830},{"style":131},[1831],{"type":73,"value":155},{"type":67,"tag":118,"props":1833,"children":1834},{"style":158},[1835],{"type":73,"value":1836},"Year the company was founded",{"type":67,"tag":118,"props":1838,"children":1839},{"style":131},[1840],{"type":73,"value":320},{"type":67,"tag":118,"props":1842,"children":1843},{"style":131},[1844],{"type":73,"value":145},{"type":67,"tag":118,"props":1846,"children":1847},{"style":137},[1848],{"type":73,"value":334},{"type":67,"tag":118,"props":1850,"children":1851},{"style":131},[1852],{"type":73,"value":339},{"type":67,"tag":118,"props":1854,"children":1855},{"class":120,"line":427},[1856,1861,1865,1869,1873,1877,1881],{"type":67,"tag":118,"props":1857,"children":1858},{"style":299},[1859],{"type":73,"value":1860},"  headquarters",{"type":67,"tag":118,"props":1862,"children":1863},{"style":131},[1864],{"type":73,"value":307},{"type":67,"tag":118,"props":1866,"children":1867},{"style":137},[1868],{"type":73,"value":221},{"type":67,"tag":118,"props":1870,"children":1871},{"style":131},[1872],{"type":73,"value":446},{"type":67,"tag":118,"props":1874,"children":1875},{"style":280},[1876],{"type":73,"value":451},{"type":67,"tag":118,"props":1878,"children":1879},{"style":137},[1880],{"type":73,"value":287},{"type":67,"tag":118,"props":1882,"children":1883},{"style":131},[1884],{"type":73,"value":292},{"type":67,"tag":118,"props":1886,"children":1887},{"class":120,"line":462},[1888,1893,1897,1901,1905,1909,1913],{"type":67,"tag":118,"props":1889,"children":1890},{"style":299},[1891],{"type":73,"value":1892},"    city",{"type":67,"tag":118,"props":1894,"children":1895},{"style":131},[1896],{"type":73,"value":307},{"type":67,"tag":118,"props":1898,"children":1899},{"style":137},[1900],{"type":73,"value":221},{"type":67,"tag":118,"props":1902,"children":1903},{"style":131},[1904],{"type":73,"value":446},{"type":67,"tag":118,"props":1906,"children":1907},{"style":280},[1908],{"type":73,"value":485},{"type":67,"tag":118,"props":1910,"children":1911},{"style":137},[1912],{"type":73,"value":490},{"type":67,"tag":118,"props":1914,"children":1915},{"style":131},[1916],{"type":73,"value":339},{"type":67,"tag":118,"props":1918,"children":1919},{"class":120,"line":497},[1920,1925,1929,1933,1937,1941,1945],{"type":67,"tag":118,"props":1921,"children":1922},{"style":299},[1923],{"type":73,"value":1924},"    country",{"type":67,"tag":118,"props":1926,"children":1927},{"style":131},[1928],{"type":73,"value":307},{"type":67,"tag":118,"props":1930,"children":1931},{"style":137},[1932],{"type":73,"value":221},{"type":67,"tag":118,"props":1934,"children":1935},{"style":131},[1936],{"type":73,"value":446},{"type":67,"tag":118,"props":1938,"children":1939},{"style":280},[1940],{"type":73,"value":485},{"type":67,"tag":118,"props":1942,"children":1943},{"style":137},[1944],{"type":73,"value":490},{"type":67,"tag":118,"props":1946,"children":1947},{"style":131},[1948],{"type":73,"value":339},{"type":67,"tag":118,"props":1950,"children":1951},{"class":120,"line":531},[1952,1957,1961,1965,1969,1973,1977,1981,1986,1990],{"type":67,"tag":118,"props":1953,"children":1954},{"style":299},[1955],{"type":73,"value":1956},"    address",{"type":67,"tag":118,"props":1958,"children":1959},{"style":131},[1960],{"type":73,"value":307},{"type":67,"tag":118,"props":1962,"children":1963},{"style":137},[1964],{"type":73,"value":221},{"type":67,"tag":118,"props":1966,"children":1967},{"style":131},[1968],{"type":73,"value":446},{"type":67,"tag":118,"props":1970,"children":1971},{"style":280},[1972],{"type":73,"value":485},{"type":67,"tag":118,"props":1974,"children":1975},{"style":137},[1976],{"type":73,"value":490},{"type":67,"tag":118,"props":1978,"children":1979},{"style":131},[1980],{"type":73,"value":446},{"type":67,"tag":118,"props":1982,"children":1983},{"style":280},[1984],{"type":73,"value":1985},"optional",{"type":67,"tag":118,"props":1987,"children":1988},{"style":137},[1989],{"type":73,"value":490},{"type":67,"tag":118,"props":1991,"children":1992},{"style":131},[1993],{"type":73,"value":339},{"type":67,"tag":118,"props":1995,"children":1996},{"class":120,"line":548},[1997,2001,2005],{"type":67,"tag":118,"props":1998,"children":1999},{"style":131},[2000],{"type":73,"value":537},{"type":67,"tag":118,"props":2002,"children":2003},{"style":137},[2004],{"type":73,"value":334},{"type":67,"tag":118,"props":2006,"children":2007},{"style":131},[2008],{"type":73,"value":339},{"type":67,"tag":118,"props":2010,"children":2011},{"class":120,"line":562},[2012,2017,2021,2025,2029,2034],{"type":67,"tag":118,"props":2013,"children":2014},{"style":299},[2015],{"type":73,"value":2016},"  employees",{"type":67,"tag":118,"props":2018,"children":2019},{"style":131},[2020],{"type":73,"value":307},{"type":67,"tag":118,"props":2022,"children":2023},{"style":137},[2024],{"type":73,"value":221},{"type":67,"tag":118,"props":2026,"children":2027},{"style":131},[2028],{"type":73,"value":446},{"type":67,"tag":118,"props":2030,"children":2031},{"style":280},[2032],{"type":73,"value":2033},"array",{"type":67,"tag":118,"props":2035,"children":2036},{"style":137},[2037],{"type":73,"value":2038},"(\n",{"type":67,"tag":118,"props":2040,"children":2041},{"class":120,"line":570},[2042,2047,2051,2055,2059],{"type":67,"tag":118,"props":2043,"children":2044},{"style":137},[2045],{"type":73,"value":2046},"    z",{"type":67,"tag":118,"props":2048,"children":2049},{"style":131},[2050],{"type":73,"value":446},{"type":67,"tag":118,"props":2052,"children":2053},{"style":280},[2054],{"type":73,"value":451},{"type":67,"tag":118,"props":2056,"children":2057},{"style":137},[2058],{"type":73,"value":287},{"type":67,"tag":118,"props":2060,"children":2061},{"style":131},[2062],{"type":73,"value":292},{"type":67,"tag":118,"props":2064,"children":2065},{"class":120,"line":594},[2066,2071,2075,2079,2083,2087,2091],{"type":67,"tag":118,"props":2067,"children":2068},{"style":299},[2069],{"type":73,"value":2070},"      name",{"type":67,"tag":118,"props":2072,"children":2073},{"style":131},[2074],{"type":73,"value":307},{"type":67,"tag":118,"props":2076,"children":2077},{"style":137},[2078],{"type":73,"value":221},{"type":67,"tag":118,"props":2080,"children":2081},{"style":131},[2082],{"type":73,"value":446},{"type":67,"tag":118,"props":2084,"children":2085},{"style":280},[2086],{"type":73,"value":485},{"type":67,"tag":118,"props":2088,"children":2089},{"style":137},[2090],{"type":73,"value":490},{"type":67,"tag":118,"props":2092,"children":2093},{"style":131},[2094],{"type":73,"value":339},{"type":67,"tag":118,"props":2096,"children":2097},{"class":120,"line":1351},[2098,2102,2106,2110,2114,2118,2122],{"type":67,"tag":118,"props":2099,"children":2100},{"style":299},[2101],{"type":73,"value":1357},{"type":67,"tag":118,"props":2103,"children":2104},{"style":131},[2105],{"type":73,"value":307},{"type":67,"tag":118,"props":2107,"children":2108},{"style":137},[2109],{"type":73,"value":221},{"type":67,"tag":118,"props":2111,"children":2112},{"style":131},[2113],{"type":73,"value":446},{"type":67,"tag":118,"props":2115,"children":2116},{"style":280},[2117],{"type":73,"value":485},{"type":67,"tag":118,"props":2119,"children":2120},{"style":137},[2121],{"type":73,"value":490},{"type":67,"tag":118,"props":2123,"children":2124},{"style":131},[2125],{"type":73,"value":339},{"type":67,"tag":118,"props":2127,"children":2128},{"class":120,"line":1380},[2129,2134,2138,2142,2146,2150,2154],{"type":67,"tag":118,"props":2130,"children":2131},{"style":299},[2132],{"type":73,"value":2133},"      department",{"type":67,"tag":118,"props":2135,"children":2136},{"style":131},[2137],{"type":73,"value":307},{"type":67,"tag":118,"props":2139,"children":2140},{"style":137},[2141],{"type":73,"value":221},{"type":67,"tag":118,"props":2143,"children":2144},{"style":131},[2145],{"type":73,"value":446},{"type":67,"tag":118,"props":2147,"children":2148},{"style":280},[2149],{"type":73,"value":485},{"type":67,"tag":118,"props":2151,"children":2152},{"style":137},[2153],{"type":73,"value":490},{"type":67,"tag":118,"props":2155,"children":2156},{"style":131},[2157],{"type":73,"value":339},{"type":67,"tag":118,"props":2159,"children":2160},{"class":120,"line":1394},[2161,2166,2170],{"type":67,"tag":118,"props":2162,"children":2163},{"style":131},[2164],{"type":73,"value":2165},"    }",{"type":67,"tag":118,"props":2167,"children":2168},{"style":137},[2169],{"type":73,"value":334},{"type":67,"tag":118,"props":2171,"children":2172},{"style":131},[2173],{"type":73,"value":339},{"type":67,"tag":118,"props":2175,"children":2176},{"class":120,"line":1416},[2177,2182],{"type":67,"tag":118,"props":2178,"children":2179},{"style":137},[2180],{"type":73,"value":2181},"  )",{"type":67,"tag":118,"props":2183,"children":2184},{"style":131},[2185],{"type":73,"value":339},{"type":67,"tag":118,"props":2187,"children":2188},{"class":120,"line":1425},[2189,2194,2198],{"type":67,"tag":118,"props":2190,"children":2191},{"style":299},[2192],{"type":73,"value":2193},"  financials",{"type":67,"tag":118,"props":2195,"children":2196},{"style":131},[2197],{"type":73,"value":307},{"type":67,"tag":118,"props":2199,"children":2200},{"style":137},[2201],{"type":73,"value":2202}," z\n",{"type":67,"tag":118,"props":2204,"children":2205},{"class":120,"line":1438},[2206,2211,2215,2219],{"type":67,"tag":118,"props":2207,"children":2208},{"style":131},[2209],{"type":73,"value":2210},"    .",{"type":67,"tag":118,"props":2212,"children":2213},{"style":280},[2214],{"type":73,"value":451},{"type":67,"tag":118,"props":2216,"children":2217},{"style":137},[2218],{"type":73,"value":287},{"type":67,"tag":118,"props":2220,"children":2221},{"style":131},[2222],{"type":73,"value":292},{"type":67,"tag":118,"props":2224,"children":2225},{"class":120,"line":1459},[2226,2231,2235],{"type":67,"tag":118,"props":2227,"children":2228},{"style":299},[2229],{"type":73,"value":2230},"      revenue",{"type":67,"tag":118,"props":2232,"children":2233},{"style":131},[2234],{"type":73,"value":307},{"type":67,"tag":118,"props":2236,"children":2237},{"style":137},[2238],{"type":73,"value":2202},{"type":67,"tag":118,"props":2240,"children":2241},{"class":120,"line":1471},[2242,2247,2251],{"type":67,"tag":118,"props":2243,"children":2244},{"style":131},[2245],{"type":73,"value":2246},"        .",{"type":67,"tag":118,"props":2248,"children":2249},{"style":280},[2250],{"type":73,"value":520},{"type":67,"tag":118,"props":2252,"children":2253},{"style":137},[2254],{"type":73,"value":2255},"()\n",{"type":67,"tag":118,"props":2257,"children":2258},{"class":120,"line":1479},[2259,2263,2267,2271,2275,2279,2283,2287,2292,2296,2300,2304],{"type":67,"tag":118,"props":2260,"children":2261},{"style":131},[2262],{"type":73,"value":2246},{"type":67,"tag":118,"props":2264,"children":2265},{"style":280},[2266],{"type":73,"value":1017},{"type":67,"tag":118,"props":2268,"children":2269},{"style":137},[2270],{"type":73,"value":287},{"type":67,"tag":118,"props":2272,"children":2273},{"style":131},[2274],{"type":73,"value":362},{"type":67,"tag":118,"props":2276,"children":2277},{"style":299},[2278],{"type":73,"value":1030},{"type":67,"tag":118,"props":2280,"children":2281},{"style":131},[2282],{"type":73,"value":307},{"type":67,"tag":118,"props":2284,"children":2285},{"style":131},[2286],{"type":73,"value":155},{"type":67,"tag":118,"props":2288,"children":2289},{"style":158},[2290],{"type":73,"value":2291},"Annual revenue in millions USD",{"type":67,"tag":118,"props":2293,"children":2294},{"style":131},[2295],{"type":73,"value":320},{"type":67,"tag":118,"props":2297,"children":2298},{"style":131},[2299],{"type":73,"value":145},{"type":67,"tag":118,"props":2301,"children":2302},{"style":137},[2303],{"type":73,"value":334},{"type":67,"tag":118,"props":2305,"children":2306},{"style":131},[2307],{"type":73,"value":339},{"type":67,"tag":118,"props":2309,"children":2310},{"class":120,"line":1516},[2311,2316,2320,2324,2328,2333,2337],{"type":67,"tag":118,"props":2312,"children":2313},{"style":299},[2314],{"type":73,"value":2315},"      profitable",{"type":67,"tag":118,"props":2317,"children":2318},{"style":131},[2319],{"type":73,"value":307},{"type":67,"tag":118,"props":2321,"children":2322},{"style":137},[2323],{"type":73,"value":221},{"type":67,"tag":118,"props":2325,"children":2326},{"style":131},[2327],{"type":73,"value":446},{"type":67,"tag":118,"props":2329,"children":2330},{"style":280},[2331],{"type":73,"value":2332},"boolean",{"type":67,"tag":118,"props":2334,"children":2335},{"style":137},[2336],{"type":73,"value":490},{"type":67,"tag":118,"props":2338,"children":2339},{"style":131},[2340],{"type":73,"value":339},{"type":67,"tag":118,"props":2342,"children":2343},{"class":120,"line":1550},[2344,2348],{"type":67,"tag":118,"props":2345,"children":2346},{"style":131},[2347],{"type":73,"value":2165},{"type":67,"tag":118,"props":2349,"children":2350},{"style":137},[2351],{"type":73,"value":559},{"type":67,"tag":118,"props":2353,"children":2355},{"class":120,"line":2354},27,[2356,2360,2364,2368],{"type":67,"tag":118,"props":2357,"children":2358},{"style":131},[2359],{"type":73,"value":2210},{"type":67,"tag":118,"props":2361,"children":2362},{"style":280},[2363],{"type":73,"value":1985},{"type":67,"tag":118,"props":2365,"children":2366},{"style":137},[2367],{"type":73,"value":490},{"type":67,"tag":118,"props":2369,"children":2370},{"style":131},[2371],{"type":73,"value":339},{"type":67,"tag":118,"props":2373,"children":2375},{"class":120,"line":2374},28,[2376,2380],{"type":67,"tag":118,"props":2377,"children":2378},{"style":131},[2379],{"type":73,"value":554},{"type":67,"tag":118,"props":2381,"children":2382},{"style":137},[2383],{"type":73,"value":559},{"type":67,"tag":118,"props":2385,"children":2387},{"class":120,"line":2386},29,[2388],{"type":67,"tag":118,"props":2389,"children":2390},{"emptyLinePlaceholder":249},[2391],{"type":73,"value":252},{"type":67,"tag":118,"props":2393,"children":2395},{"class":120,"line":2394},30,[2396,2400,2405,2409,2413,2417,2421],{"type":67,"tag":118,"props":2397,"children":2398},{"style":259},[2399],{"type":73,"value":262},{"type":67,"tag":118,"props":2401,"children":2402},{"style":137},[2403],{"type":73,"value":2404}," company ",{"type":67,"tag":118,"props":2406,"children":2407},{"style":131},[2408],{"type":73,"value":272},{"type":67,"tag":118,"props":2410,"children":2411},{"style":125},[2412],{"type":73,"value":277},{"type":67,"tag":118,"props":2414,"children":2415},{"style":280},[2416],{"type":73,"value":140},{"type":67,"tag":118,"props":2418,"children":2419},{"style":137},[2420],{"type":73,"value":287},{"type":67,"tag":118,"props":2422,"children":2423},{"style":131},[2424],{"type":73,"value":292},{"type":67,"tag":118,"props":2426,"children":2428},{"class":120,"line":2427},31,[2429,2433,2437,2441,2445,2449,2454,2458,2462],{"type":67,"tag":118,"props":2430,"children":2431},{"style":299},[2432],{"type":73,"value":302},{"type":67,"tag":118,"props":2434,"children":2435},{"style":131},[2436],{"type":73,"value":307},{"type":67,"tag":118,"props":2438,"children":2439},{"style":280},[2440],{"type":73,"value":1645},{"type":67,"tag":118,"props":2442,"children":2443},{"style":137},[2444],{"type":73,"value":287},{"type":67,"tag":118,"props":2446,"children":2447},{"style":131},[2448],{"type":73,"value":320},{"type":67,"tag":118,"props":2450,"children":2451},{"style":158},[2452],{"type":73,"value":2453},"claude-sonnet-4-5",{"type":67,"tag":118,"props":2455,"children":2456},{"style":131},[2457],{"type":73,"value":320},{"type":67,"tag":118,"props":2459,"children":2460},{"style":137},[2461],{"type":73,"value":334},{"type":67,"tag":118,"props":2463,"children":2464},{"style":131},[2465],{"type":73,"value":339},{"type":67,"tag":118,"props":2467,"children":2469},{"class":120,"line":2468},32,[2470,2474,2478],{"type":67,"tag":118,"props":2471,"children":2472},{"style":299},[2473],{"type":73,"value":348},{"type":67,"tag":118,"props":2475,"children":2476},{"style":131},[2477],{"type":73,"value":307},{"type":67,"tag":118,"props":2479,"children":2480},{"style":137},[2481],{"type":73,"value":1340},{"type":67,"tag":118,"props":2483,"children":2485},{"class":120,"line":2484},33,[2486],{"type":67,"tag":118,"props":2487,"children":2488},{"style":131},[2489],{"type":73,"value":1348},{"type":67,"tag":118,"props":2491,"children":2493},{"class":120,"line":2492},34,[2494,2498,2502,2506,2510,2514],{"type":67,"tag":118,"props":2495,"children":2496},{"style":299},[2497],{"type":73,"value":1357},{"type":67,"tag":118,"props":2499,"children":2500},{"style":131},[2501],{"type":73,"value":307},{"type":67,"tag":118,"props":2503,"children":2504},{"style":131},[2505],{"type":73,"value":155},{"type":67,"tag":118,"props":2507,"children":2508},{"style":158},[2509],{"type":73,"value":380},{"type":67,"tag":118,"props":2511,"children":2512},{"style":131},[2513],{"type":73,"value":320},{"type":67,"tag":118,"props":2515,"children":2516},{"style":131},[2517],{"type":73,"value":339},{"type":67,"tag":118,"props":2519,"children":2521},{"class":120,"line":2520},35,[2522,2526,2530,2534,2539,2543],{"type":67,"tag":118,"props":2523,"children":2524},{"style":299},[2525],{"type":73,"value":1386},{"type":67,"tag":118,"props":2527,"children":2528},{"style":131},[2529],{"type":73,"value":307},{"type":67,"tag":118,"props":2531,"children":2532},{"style":131},[2533],{"type":73,"value":155},{"type":67,"tag":118,"props":2535,"children":2536},{"style":158},[2537],{"type":73,"value":2538},"Extract company info from this article: ...",{"type":67,"tag":118,"props":2540,"children":2541},{"style":131},[2542],{"type":73,"value":320},{"type":67,"tag":118,"props":2544,"children":2545},{"style":131},[2546],{"type":73,"value":339},{"type":67,"tag":118,"props":2548,"children":2550},{"class":120,"line":2549},36,[2551],{"type":67,"tag":118,"props":2552,"children":2553},{"style":131},[2554],{"type":73,"value":1422},{"type":67,"tag":118,"props":2556,"children":2558},{"class":120,"line":2557},37,[2559,2563],{"type":67,"tag":118,"props":2560,"children":2561},{"style":137},[2562],{"type":73,"value":1431},{"type":67,"tag":118,"props":2564,"children":2565},{"style":131},[2566],{"type":73,"value":339},{"type":67,"tag":118,"props":2568,"children":2570},{"class":120,"line":2569},38,[2571,2575,2579,2584],{"type":67,"tag":118,"props":2572,"children":2573},{"style":299},[2574],{"type":73,"value":433},{"type":67,"tag":118,"props":2576,"children":2577},{"style":131},[2578],{"type":73,"value":307},{"type":67,"tag":118,"props":2580,"children":2581},{"style":137},[2582],{"type":73,"value":2583}," CompanySchema",{"type":67,"tag":118,"props":2585,"children":2586},{"style":131},[2587],{"type":73,"value":339},{"type":67,"tag":118,"props":2589,"children":2591},{"class":120,"line":2590},39,[2592,2596],{"type":67,"tag":118,"props":2593,"children":2594},{"style":131},[2595],{"type":73,"value":554},{"type":67,"tag":118,"props":2597,"children":2598},{"style":137},[2599],{"type":73,"value":559},{"type":67,"tag":118,"props":2601,"children":2603},{"class":120,"line":2602},40,[2604],{"type":67,"tag":118,"props":2605,"children":2606},{"emptyLinePlaceholder":249},[2607],{"type":73,"value":252},{"type":67,"tag":118,"props":2609,"children":2611},{"class":120,"line":2610},41,[2612],{"type":67,"tag":118,"props":2613,"children":2614},{"style":588},[2615],{"type":73,"value":2616},"\u002F\u002F Full type safety on nested properties\n",{"type":67,"tag":118,"props":2618,"children":2620},{"class":120,"line":2619},42,[2621,2625,2629,2633,2638,2642,2647,2651],{"type":67,"tag":118,"props":2622,"children":2623},{"style":137},[2624],{"type":73,"value":1485},{"type":67,"tag":118,"props":2626,"children":2627},{"style":131},[2628],{"type":73,"value":446},{"type":67,"tag":118,"props":2630,"children":2631},{"style":280},[2632],{"type":73,"value":1494},{"type":67,"tag":118,"props":2634,"children":2635},{"style":137},[2636],{"type":73,"value":2637},"(company",{"type":67,"tag":118,"props":2639,"children":2640},{"style":131},[2641],{"type":73,"value":446},{"type":67,"tag":118,"props":2643,"children":2644},{"style":137},[2645],{"type":73,"value":2646},"headquarters",{"type":67,"tag":118,"props":2648,"children":2649},{"style":131},[2650],{"type":73,"value":446},{"type":67,"tag":118,"props":2652,"children":2653},{"style":137},[2654],{"type":73,"value":2655},"city)\n",{"type":67,"tag":118,"props":2657,"children":2659},{"class":120,"line":2658},43,[2660,2664,2668,2672,2676,2680,2685,2691,2695,2699],{"type":67,"tag":118,"props":2661,"children":2662},{"style":137},[2663],{"type":73,"value":1485},{"type":67,"tag":118,"props":2665,"children":2666},{"style":131},[2667],{"type":73,"value":446},{"type":67,"tag":118,"props":2669,"children":2670},{"style":280},[2671],{"type":73,"value":1494},{"type":67,"tag":118,"props":2673,"children":2674},{"style":137},[2675],{"type":73,"value":2637},{"type":67,"tag":118,"props":2677,"children":2678},{"style":131},[2679],{"type":73,"value":446},{"type":67,"tag":118,"props":2681,"children":2682},{"style":137},[2683],{"type":73,"value":2684},"employees[",{"type":67,"tag":118,"props":2686,"children":2688},{"style":2687},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[2689],{"type":73,"value":2690},"0",{"type":67,"tag":118,"props":2692,"children":2693},{"style":137},[2694],{"type":73,"value":420},{"type":67,"tag":118,"props":2696,"children":2697},{"style":131},[2698],{"type":73,"value":446},{"type":67,"tag":118,"props":2700,"children":2701},{"style":137},[2702],{"type":73,"value":2703},"role)\n",{"type":67,"tag":118,"props":2705,"children":2707},{"class":120,"line":2706},44,[2708,2712,2716,2720,2724,2728,2733,2738],{"type":67,"tag":118,"props":2709,"children":2710},{"style":137},[2711],{"type":73,"value":1485},{"type":67,"tag":118,"props":2713,"children":2714},{"style":131},[2715],{"type":73,"value":446},{"type":67,"tag":118,"props":2717,"children":2718},{"style":280},[2719],{"type":73,"value":1494},{"type":67,"tag":118,"props":2721,"children":2722},{"style":137},[2723],{"type":73,"value":2637},{"type":67,"tag":118,"props":2725,"children":2726},{"style":131},[2727],{"type":73,"value":446},{"type":67,"tag":118,"props":2729,"children":2730},{"style":137},[2731],{"type":73,"value":2732},"financials",{"type":67,"tag":118,"props":2734,"children":2735},{"style":131},[2736],{"type":73,"value":2737},"?.",{"type":67,"tag":118,"props":2739,"children":2740},{"style":137},[2741],{"type":73,"value":2742},"revenue)\n",{"type":67,"tag":820,"props":2744,"children":2746},{"id":2745},"pattern-3-direct-stream-iteration",[2747],{"type":73,"value":2748},"Pattern 3: Direct stream iteration",{"type":67,"tag":80,"props":2750,"children":2751},{},[2752,2754,2759,2761,2766],{"type":73,"value":2753},"Pass ",{"type":67,"tag":92,"props":2755,"children":2757},{"className":2756},[],[2758],{"type":73,"value":661},{"type":73,"value":2760}," alongside ",{"type":67,"tag":92,"props":2762,"children":2764},{"className":2763},[],[2765],{"type":73,"value":624},{"type":73,"value":2767}," to get an async iterable of standard streaming chunks plus a terminal validated object. Use this when you're a single process end-to-end — Node script, CLI, test, or a server endpoint that responds with one JSON blob. For the in-browser progressive-UI case, jump to Pattern 4 instead.",{"type":67,"tag":108,"props":2769,"children":2771},{"className":110,"code":2770,"language":15,"meta":112,"style":112},"import { chat } from '@tanstack\u002Fai'\nimport { openaiText } from '@tanstack\u002Fai-openai'\nimport { z } from 'zod'\n\nconst PersonSchema = z.object({\n  name: z.string(),\n  age: z.number(),\n  email: z.string().email(),\n})\n\nconst stream = chat({\n  adapter: openaiText('gpt-5.2'),\n  messages: [\n    { role: 'user', content: 'Extract: John Doe is 30, john@example.com' },\n  ],\n  outputSchema: PersonSchema,\n  stream: true,\n})\n\nfor await (const chunk of stream) {\n  if (chunk.type === 'CUSTOM' && chunk.name === 'structured-output.complete') {\n    \u002F\u002F Terminal event. `chunk.value.object` is fully validated and typed\n    \u002F\u002F against the schema you passed in — no helper or cast required.\n    chunk.value.object.name \u002F\u002F string\n    chunk.value.object.age \u002F\u002F number\n    chunk.value.reasoning \u002F\u002F string | undefined (thinking models only)\n  }\n}\n",[2772],{"type":67,"tag":92,"props":2773,"children":2774},{"__ignoreMap":112},[2775,2810,2845,2880,2887,2922,2953,2984,3027,3038,3045,3073,3112,3127,3185,3196,3215,3237,3248,3255,3295,3384,3392,3400,3438,3475,3504,3512],{"type":67,"tag":118,"props":2776,"children":2777},{"class":120,"line":121},[2778,2782,2786,2790,2794,2798,2802,2806],{"type":67,"tag":118,"props":2779,"children":2780},{"style":125},[2781],{"type":73,"value":128},{"type":67,"tag":118,"props":2783,"children":2784},{"style":131},[2785],{"type":73,"value":134},{"type":67,"tag":118,"props":2787,"children":2788},{"style":137},[2789],{"type":73,"value":140},{"type":67,"tag":118,"props":2791,"children":2792},{"style":131},[2793],{"type":73,"value":145},{"type":67,"tag":118,"props":2795,"children":2796},{"style":125},[2797],{"type":73,"value":150},{"type":67,"tag":118,"props":2799,"children":2800},{"style":131},[2801],{"type":73,"value":155},{"type":67,"tag":118,"props":2803,"children":2804},{"style":158},[2805],{"type":73,"value":161},{"type":67,"tag":118,"props":2807,"children":2808},{"style":131},[2809],{"type":73,"value":166},{"type":67,"tag":118,"props":2811,"children":2812},{"class":120,"line":169},[2813,2817,2821,2825,2829,2833,2837,2841],{"type":67,"tag":118,"props":2814,"children":2815},{"style":125},[2816],{"type":73,"value":128},{"type":67,"tag":118,"props":2818,"children":2819},{"style":131},[2820],{"type":73,"value":134},{"type":67,"tag":118,"props":2822,"children":2823},{"style":137},[2824],{"type":73,"value":183},{"type":67,"tag":118,"props":2826,"children":2827},{"style":131},[2828],{"type":73,"value":145},{"type":67,"tag":118,"props":2830,"children":2831},{"style":125},[2832],{"type":73,"value":150},{"type":67,"tag":118,"props":2834,"children":2835},{"style":131},[2836],{"type":73,"value":155},{"type":67,"tag":118,"props":2838,"children":2839},{"style":158},[2840],{"type":73,"value":200},{"type":67,"tag":118,"props":2842,"children":2843},{"style":131},[2844],{"type":73,"value":166},{"type":67,"tag":118,"props":2846,"children":2847},{"class":120,"line":207},[2848,2852,2856,2860,2864,2868,2872,2876],{"type":67,"tag":118,"props":2849,"children":2850},{"style":125},[2851],{"type":73,"value":128},{"type":67,"tag":118,"props":2853,"children":2854},{"style":131},[2855],{"type":73,"value":134},{"type":67,"tag":118,"props":2857,"children":2858},{"style":137},[2859],{"type":73,"value":221},{"type":67,"tag":118,"props":2861,"children":2862},{"style":131},[2863],{"type":73,"value":145},{"type":67,"tag":118,"props":2865,"children":2866},{"style":125},[2867],{"type":73,"value":150},{"type":67,"tag":118,"props":2869,"children":2870},{"style":131},[2871],{"type":73,"value":155},{"type":67,"tag":118,"props":2873,"children":2874},{"style":158},[2875],{"type":73,"value":238},{"type":67,"tag":118,"props":2877,"children":2878},{"style":131},[2879],{"type":73,"value":166},{"type":67,"tag":118,"props":2881,"children":2882},{"class":120,"line":245},[2883],{"type":67,"tag":118,"props":2884,"children":2885},{"emptyLinePlaceholder":249},[2886],{"type":73,"value":252},{"type":67,"tag":118,"props":2888,"children":2889},{"class":120,"line":255},[2890,2894,2898,2902,2906,2910,2914,2918],{"type":67,"tag":118,"props":2891,"children":2892},{"style":259},[2893],{"type":73,"value":262},{"type":67,"tag":118,"props":2895,"children":2896},{"style":137},[2897],{"type":73,"value":956},{"type":67,"tag":118,"props":2899,"children":2900},{"style":131},[2901],{"type":73,"value":272},{"type":67,"tag":118,"props":2903,"children":2904},{"style":137},[2905],{"type":73,"value":221},{"type":67,"tag":118,"props":2907,"children":2908},{"style":131},[2909],{"type":73,"value":446},{"type":67,"tag":118,"props":2911,"children":2912},{"style":280},[2913],{"type":73,"value":451},{"type":67,"tag":118,"props":2915,"children":2916},{"style":137},[2917],{"type":73,"value":287},{"type":67,"tag":118,"props":2919,"children":2920},{"style":131},[2921],{"type":73,"value":292},{"type":67,"tag":118,"props":2923,"children":2924},{"class":120,"line":295},[2925,2929,2933,2937,2941,2945,2949],{"type":67,"tag":118,"props":2926,"children":2927},{"style":299},[2928],{"type":73,"value":988},{"type":67,"tag":118,"props":2930,"children":2931},{"style":131},[2932],{"type":73,"value":307},{"type":67,"tag":118,"props":2934,"children":2935},{"style":137},[2936],{"type":73,"value":221},{"type":67,"tag":118,"props":2938,"children":2939},{"style":131},[2940],{"type":73,"value":446},{"type":67,"tag":118,"props":2942,"children":2943},{"style":280},[2944],{"type":73,"value":485},{"type":67,"tag":118,"props":2946,"children":2947},{"style":137},[2948],{"type":73,"value":490},{"type":67,"tag":118,"props":2950,"children":2951},{"style":131},[2952],{"type":73,"value":339},{"type":67,"tag":118,"props":2954,"children":2955},{"class":120,"line":342},[2956,2960,2964,2968,2972,2976,2980],{"type":67,"tag":118,"props":2957,"children":2958},{"style":299},[2959],{"type":73,"value":1069},{"type":67,"tag":118,"props":2961,"children":2962},{"style":131},[2963],{"type":73,"value":307},{"type":67,"tag":118,"props":2965,"children":2966},{"style":137},[2967],{"type":73,"value":221},{"type":67,"tag":118,"props":2969,"children":2970},{"style":131},[2971],{"type":73,"value":446},{"type":67,"tag":118,"props":2973,"children":2974},{"style":280},[2975],{"type":73,"value":520},{"type":67,"tag":118,"props":2977,"children":2978},{"style":137},[2979],{"type":73,"value":490},{"type":67,"tag":118,"props":2981,"children":2982},{"style":131},[2983],{"type":73,"value":339},{"type":67,"tag":118,"props":2985,"children":2986},{"class":120,"line":427},[2987,2991,2995,2999,3003,3007,3011,3015,3019,3023],{"type":67,"tag":118,"props":2988,"children":2989},{"style":299},[2990],{"type":73,"value":1146},{"type":67,"tag":118,"props":2992,"children":2993},{"style":131},[2994],{"type":73,"value":307},{"type":67,"tag":118,"props":2996,"children":2997},{"style":137},[2998],{"type":73,"value":221},{"type":67,"tag":118,"props":3000,"children":3001},{"style":131},[3002],{"type":73,"value":446},{"type":67,"tag":118,"props":3004,"children":3005},{"style":280},[3006],{"type":73,"value":485},{"type":67,"tag":118,"props":3008,"children":3009},{"style":137},[3010],{"type":73,"value":490},{"type":67,"tag":118,"props":3012,"children":3013},{"style":131},[3014],{"type":73,"value":446},{"type":67,"tag":118,"props":3016,"children":3017},{"style":280},[3018],{"type":73,"value":1175},{"type":67,"tag":118,"props":3020,"children":3021},{"style":137},[3022],{"type":73,"value":490},{"type":67,"tag":118,"props":3024,"children":3025},{"style":131},[3026],{"type":73,"value":339},{"type":67,"tag":118,"props":3028,"children":3029},{"class":120,"line":462},[3030,3034],{"type":67,"tag":118,"props":3031,"children":3032},{"style":131},[3033],{"type":73,"value":554},{"type":67,"tag":118,"props":3035,"children":3036},{"style":137},[3037],{"type":73,"value":559},{"type":67,"tag":118,"props":3039,"children":3040},{"class":120,"line":497},[3041],{"type":67,"tag":118,"props":3042,"children":3043},{"emptyLinePlaceholder":249},[3044],{"type":73,"value":252},{"type":67,"tag":118,"props":3046,"children":3047},{"class":120,"line":531},[3048,3052,3057,3061,3065,3069],{"type":67,"tag":118,"props":3049,"children":3050},{"style":259},[3051],{"type":73,"value":262},{"type":67,"tag":118,"props":3053,"children":3054},{"style":137},[3055],{"type":73,"value":3056}," stream ",{"type":67,"tag":118,"props":3058,"children":3059},{"style":131},[3060],{"type":73,"value":272},{"type":67,"tag":118,"props":3062,"children":3063},{"style":280},[3064],{"type":73,"value":140},{"type":67,"tag":118,"props":3066,"children":3067},{"style":137},[3068],{"type":73,"value":287},{"type":67,"tag":118,"props":3070,"children":3071},{"style":131},[3072],{"type":73,"value":292},{"type":67,"tag":118,"props":3074,"children":3075},{"class":120,"line":548},[3076,3080,3084,3088,3092,3096,3100,3104,3108],{"type":67,"tag":118,"props":3077,"children":3078},{"style":299},[3079],{"type":73,"value":302},{"type":67,"tag":118,"props":3081,"children":3082},{"style":131},[3083],{"type":73,"value":307},{"type":67,"tag":118,"props":3085,"children":3086},{"style":280},[3087],{"type":73,"value":183},{"type":67,"tag":118,"props":3089,"children":3090},{"style":137},[3091],{"type":73,"value":287},{"type":67,"tag":118,"props":3093,"children":3094},{"style":131},[3095],{"type":73,"value":320},{"type":67,"tag":118,"props":3097,"children":3098},{"style":158},[3099],{"type":73,"value":325},{"type":67,"tag":118,"props":3101,"children":3102},{"style":131},[3103],{"type":73,"value":320},{"type":67,"tag":118,"props":3105,"children":3106},{"style":137},[3107],{"type":73,"value":334},{"type":67,"tag":118,"props":3109,"children":3110},{"style":131},[3111],{"type":73,"value":339},{"type":67,"tag":118,"props":3113,"children":3114},{"class":120,"line":562},[3115,3119,3123],{"type":67,"tag":118,"props":3116,"children":3117},{"style":299},[3118],{"type":73,"value":348},{"type":67,"tag":118,"props":3120,"children":3121},{"style":131},[3122],{"type":73,"value":307},{"type":67,"tag":118,"props":3124,"children":3125},{"style":137},[3126],{"type":73,"value":1340},{"type":67,"tag":118,"props":3128,"children":3129},{"class":120,"line":570},[3130,3135,3139,3143,3147,3151,3155,3159,3163,3167,3171,3176,3180],{"type":67,"tag":118,"props":3131,"children":3132},{"style":131},[3133],{"type":73,"value":3134},"    {",{"type":67,"tag":118,"props":3136,"children":3137},{"style":299},[3138],{"type":73,"value":367},{"type":67,"tag":118,"props":3140,"children":3141},{"style":131},[3142],{"type":73,"value":307},{"type":67,"tag":118,"props":3144,"children":3145},{"style":131},[3146],{"type":73,"value":155},{"type":67,"tag":118,"props":3148,"children":3149},{"style":158},[3150],{"type":73,"value":380},{"type":67,"tag":118,"props":3152,"children":3153},{"style":131},[3154],{"type":73,"value":320},{"type":67,"tag":118,"props":3156,"children":3157},{"style":131},[3158],{"type":73,"value":389},{"type":67,"tag":118,"props":3160,"children":3161},{"style":299},[3162],{"type":73,"value":394},{"type":67,"tag":118,"props":3164,"children":3165},{"style":131},[3166],{"type":73,"value":307},{"type":67,"tag":118,"props":3168,"children":3169},{"style":131},[3170],{"type":73,"value":155},{"type":67,"tag":118,"props":3172,"children":3173},{"style":158},[3174],{"type":73,"value":3175},"Extract: John Doe is 30, john@example.com",{"type":67,"tag":118,"props":3177,"children":3178},{"style":131},[3179],{"type":73,"value":320},{"type":67,"tag":118,"props":3181,"children":3182},{"style":131},[3183],{"type":73,"value":3184}," },\n",{"type":67,"tag":118,"props":3186,"children":3187},{"class":120,"line":594},[3188,3192],{"type":67,"tag":118,"props":3189,"children":3190},{"style":137},[3191],{"type":73,"value":1431},{"type":67,"tag":118,"props":3193,"children":3194},{"style":131},[3195],{"type":73,"value":339},{"type":67,"tag":118,"props":3197,"children":3198},{"class":120,"line":1351},[3199,3203,3207,3211],{"type":67,"tag":118,"props":3200,"children":3201},{"style":299},[3202],{"type":73,"value":433},{"type":67,"tag":118,"props":3204,"children":3205},{"style":131},[3206],{"type":73,"value":307},{"type":67,"tag":118,"props":3208,"children":3209},{"style":137},[3210],{"type":73,"value":1452},{"type":67,"tag":118,"props":3212,"children":3213},{"style":131},[3214],{"type":73,"value":339},{"type":67,"tag":118,"props":3216,"children":3217},{"class":120,"line":1380},[3218,3223,3227,3233],{"type":67,"tag":118,"props":3219,"children":3220},{"style":299},[3221],{"type":73,"value":3222},"  stream",{"type":67,"tag":118,"props":3224,"children":3225},{"style":131},[3226],{"type":73,"value":307},{"type":67,"tag":118,"props":3228,"children":3230},{"style":3229},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[3231],{"type":73,"value":3232}," true",{"type":67,"tag":118,"props":3234,"children":3235},{"style":131},[3236],{"type":73,"value":339},{"type":67,"tag":118,"props":3238,"children":3239},{"class":120,"line":1394},[3240,3244],{"type":67,"tag":118,"props":3241,"children":3242},{"style":131},[3243],{"type":73,"value":554},{"type":67,"tag":118,"props":3245,"children":3246},{"style":137},[3247],{"type":73,"value":559},{"type":67,"tag":118,"props":3249,"children":3250},{"class":120,"line":1416},[3251],{"type":67,"tag":118,"props":3252,"children":3253},{"emptyLinePlaceholder":249},[3254],{"type":73,"value":252},{"type":67,"tag":118,"props":3256,"children":3257},{"class":120,"line":1425},[3258,3263,3267,3272,3276,3281,3286,3291],{"type":67,"tag":118,"props":3259,"children":3260},{"style":125},[3261],{"type":73,"value":3262},"for",{"type":67,"tag":118,"props":3264,"children":3265},{"style":125},[3266],{"type":73,"value":277},{"type":67,"tag":118,"props":3268,"children":3269},{"style":137},[3270],{"type":73,"value":3271}," (",{"type":67,"tag":118,"props":3273,"children":3274},{"style":259},[3275],{"type":73,"value":262},{"type":67,"tag":118,"props":3277,"children":3278},{"style":137},[3279],{"type":73,"value":3280}," chunk ",{"type":67,"tag":118,"props":3282,"children":3283},{"style":131},[3284],{"type":73,"value":3285},"of",{"type":67,"tag":118,"props":3287,"children":3288},{"style":137},[3289],{"type":73,"value":3290}," stream) ",{"type":67,"tag":118,"props":3292,"children":3293},{"style":131},[3294],{"type":73,"value":292},{"type":67,"tag":118,"props":3296,"children":3297},{"class":120,"line":1438},[3298,3303,3307,3312,3316,3321,3326,3330,3335,3339,3344,3349,3353,3358,3362,3366,3371,3375,3380],{"type":67,"tag":118,"props":3299,"children":3300},{"style":125},[3301],{"type":73,"value":3302},"  if",{"type":67,"tag":118,"props":3304,"children":3305},{"style":299},[3306],{"type":73,"value":3271},{"type":67,"tag":118,"props":3308,"children":3309},{"style":137},[3310],{"type":73,"value":3311},"chunk",{"type":67,"tag":118,"props":3313,"children":3314},{"style":131},[3315],{"type":73,"value":446},{"type":67,"tag":118,"props":3317,"children":3318},{"style":137},[3319],{"type":73,"value":3320},"type",{"type":67,"tag":118,"props":3322,"children":3323},{"style":131},[3324],{"type":73,"value":3325}," ===",{"type":67,"tag":118,"props":3327,"children":3328},{"style":131},[3329],{"type":73,"value":155},{"type":67,"tag":118,"props":3331,"children":3332},{"style":158},[3333],{"type":73,"value":3334},"CUSTOM",{"type":67,"tag":118,"props":3336,"children":3337},{"style":131},[3338],{"type":73,"value":320},{"type":67,"tag":118,"props":3340,"children":3341},{"style":131},[3342],{"type":73,"value":3343}," &&",{"type":67,"tag":118,"props":3345,"children":3346},{"style":137},[3347],{"type":73,"value":3348}," chunk",{"type":67,"tag":118,"props":3350,"children":3351},{"style":131},[3352],{"type":73,"value":446},{"type":67,"tag":118,"props":3354,"children":3355},{"style":137},[3356],{"type":73,"value":3357},"name",{"type":67,"tag":118,"props":3359,"children":3360},{"style":131},[3361],{"type":73,"value":3325},{"type":67,"tag":118,"props":3363,"children":3364},{"style":131},[3365],{"type":73,"value":155},{"type":67,"tag":118,"props":3367,"children":3368},{"style":158},[3369],{"type":73,"value":3370},"structured-output.complete",{"type":67,"tag":118,"props":3372,"children":3373},{"style":131},[3374],{"type":73,"value":320},{"type":67,"tag":118,"props":3376,"children":3377},{"style":299},[3378],{"type":73,"value":3379},") ",{"type":67,"tag":118,"props":3381,"children":3382},{"style":131},[3383],{"type":73,"value":292},{"type":67,"tag":118,"props":3385,"children":3386},{"class":120,"line":1459},[3387],{"type":67,"tag":118,"props":3388,"children":3389},{"style":588},[3390],{"type":73,"value":3391},"    \u002F\u002F Terminal event. `chunk.value.object` is fully validated and typed\n",{"type":67,"tag":118,"props":3393,"children":3394},{"class":120,"line":1471},[3395],{"type":67,"tag":118,"props":3396,"children":3397},{"style":588},[3398],{"type":73,"value":3399},"    \u002F\u002F against the schema you passed in — no helper or cast required.\n",{"type":67,"tag":118,"props":3401,"children":3402},{"class":120,"line":1479},[3403,3408,3412,3417,3421,3425,3429,3433],{"type":67,"tag":118,"props":3404,"children":3405},{"style":137},[3406],{"type":73,"value":3407},"    chunk",{"type":67,"tag":118,"props":3409,"children":3410},{"style":131},[3411],{"type":73,"value":446},{"type":67,"tag":118,"props":3413,"children":3414},{"style":137},[3415],{"type":73,"value":3416},"value",{"type":67,"tag":118,"props":3418,"children":3419},{"style":131},[3420],{"type":73,"value":446},{"type":67,"tag":118,"props":3422,"children":3423},{"style":137},[3424],{"type":73,"value":451},{"type":67,"tag":118,"props":3426,"children":3427},{"style":131},[3428],{"type":73,"value":446},{"type":67,"tag":118,"props":3430,"children":3431},{"style":137},[3432],{"type":73,"value":3357},{"type":67,"tag":118,"props":3434,"children":3435},{"style":588},[3436],{"type":73,"value":3437}," \u002F\u002F string\n",{"type":67,"tag":118,"props":3439,"children":3440},{"class":120,"line":1516},[3441,3445,3449,3453,3457,3461,3465,3470],{"type":67,"tag":118,"props":3442,"children":3443},{"style":137},[3444],{"type":73,"value":3407},{"type":67,"tag":118,"props":3446,"children":3447},{"style":131},[3448],{"type":73,"value":446},{"type":67,"tag":118,"props":3450,"children":3451},{"style":137},[3452],{"type":73,"value":3416},{"type":67,"tag":118,"props":3454,"children":3455},{"style":131},[3456],{"type":73,"value":446},{"type":67,"tag":118,"props":3458,"children":3459},{"style":137},[3460],{"type":73,"value":451},{"type":67,"tag":118,"props":3462,"children":3463},{"style":131},[3464],{"type":73,"value":446},{"type":67,"tag":118,"props":3466,"children":3467},{"style":137},[3468],{"type":73,"value":3469},"age",{"type":67,"tag":118,"props":3471,"children":3472},{"style":588},[3473],{"type":73,"value":3474}," \u002F\u002F number\n",{"type":67,"tag":118,"props":3476,"children":3477},{"class":120,"line":1550},[3478,3482,3486,3490,3494,3499],{"type":67,"tag":118,"props":3479,"children":3480},{"style":137},[3481],{"type":73,"value":3407},{"type":67,"tag":118,"props":3483,"children":3484},{"style":131},[3485],{"type":73,"value":446},{"type":67,"tag":118,"props":3487,"children":3488},{"style":137},[3489],{"type":73,"value":3416},{"type":67,"tag":118,"props":3491,"children":3492},{"style":131},[3493],{"type":73,"value":446},{"type":67,"tag":118,"props":3495,"children":3496},{"style":137},[3497],{"type":73,"value":3498},"reasoning",{"type":67,"tag":118,"props":3500,"children":3501},{"style":588},[3502],{"type":73,"value":3503}," \u002F\u002F string | undefined (thinking models only)\n",{"type":67,"tag":118,"props":3505,"children":3506},{"class":120,"line":2354},[3507],{"type":67,"tag":118,"props":3508,"children":3509},{"style":131},[3510],{"type":73,"value":3511},"  }\n",{"type":67,"tag":118,"props":3513,"children":3514},{"class":120,"line":2374},[3515],{"type":67,"tag":118,"props":3516,"children":3517},{"style":131},[3518],{"type":73,"value":3519},"}\n",{"type":67,"tag":80,"props":3521,"children":3522},{},[3523,3525,3530,3532,3538,3540,3546,3548,3554,3556,3562],{"type":73,"value":3524},"The terminal event is a ",{"type":67,"tag":92,"props":3526,"children":3528},{"className":3527},[],[3529],{"type":73,"value":3334},{"type":73,"value":3531}," chunk: ",{"type":67,"tag":92,"props":3533,"children":3535},{"className":3534},[],[3536],{"type":73,"value":3537},"{ type: 'CUSTOM', name: 'structured-output.complete', value: { object: T, raw: string, reasoning?: string } }",{"type":73,"value":3539},". The return type of ",{"type":67,"tag":92,"props":3541,"children":3543},{"className":3542},[],[3544],{"type":73,"value":3545},"chat({ outputSchema, stream: true })",{"type":73,"value":3547}," carries ",{"type":67,"tag":92,"props":3549,"children":3551},{"className":3550},[],[3552],{"type":73,"value":3553},"T",{"type":73,"value":3555}," through, so a plain discriminated narrow (",{"type":67,"tag":92,"props":3557,"children":3559},{"className":3558},[],[3560],{"type":73,"value":3561},"chunk.type === 'CUSTOM' && chunk.name === 'structured-output.complete'",{"type":73,"value":3563},") is enough — no type guard helper.",{"type":67,"tag":80,"props":3565,"children":3566},{},[3567],{"type":67,"tag":84,"props":3568,"children":3569},{},[3570],{"type":73,"value":3571},"Adapter coverage for streaming:",{"type":67,"tag":707,"props":3573,"children":3574},{},[3575,3601],{"type":67,"tag":711,"props":3576,"children":3577},{},[3578],{"type":67,"tag":715,"props":3579,"children":3580},{},[3581,3586],{"type":67,"tag":719,"props":3582,"children":3583},{},[3584],{"type":73,"value":3585},"Adapter",{"type":67,"tag":719,"props":3587,"children":3588},{},[3589,3594,3596],{"type":67,"tag":92,"props":3590,"children":3592},{"className":3591},[],[3593],{"type":73,"value":624},{"type":73,"value":3595}," + ",{"type":67,"tag":92,"props":3597,"children":3599},{"className":3598},[],[3600],{"type":73,"value":661},{"type":67,"tag":730,"props":3602,"children":3603},{},[3604,3642,3678,3722,3758,3783,3807],{"type":67,"tag":715,"props":3605,"children":3606},{},[3607,3617],{"type":67,"tag":737,"props":3608,"children":3609},{},[3610,3615],{"type":67,"tag":92,"props":3611,"children":3613},{"className":3612},[],[3614],{"type":73,"value":200},{"type":73,"value":3616}," (Responses + Chat Completions)",{"type":67,"tag":737,"props":3618,"children":3619},{},[3620,3625,3627,3633,3635,3640],{"type":67,"tag":84,"props":3621,"children":3622},{},[3623],{"type":73,"value":3624},"Native combined mode (#605)",{"type":73,"value":3626}," — schema wired into the regular ",{"type":67,"tag":92,"props":3628,"children":3630},{"className":3629},[],[3631],{"type":73,"value":3632},"chatStream",{"type":73,"value":3634}," call alongside ",{"type":67,"tag":92,"props":3636,"children":3638},{"className":3637},[],[3639],{"type":73,"value":810},{"type":73,"value":3641},"; engine harvests JSON, no finalization round-trip",{"type":67,"tag":715,"props":3643,"children":3644},{},[3645,3655],{"type":67,"tag":737,"props":3646,"children":3647},{},[3648,3653],{"type":67,"tag":92,"props":3649,"children":3651},{"className":3650},[],[3652],{"type":73,"value":1662},{"type":73,"value":3654}," (Claude 4.5+ only)",{"type":67,"tag":737,"props":3656,"children":3657},{},[3658,3662,3664,3670,3671,3676],{"type":67,"tag":84,"props":3659,"children":3660},{},[3661],{"type":73,"value":3624},{"type":73,"value":3663}," — ",{"type":67,"tag":92,"props":3665,"children":3667},{"className":3666},[],[3668],{"type":73,"value":3669},"output_config.format",{"type":73,"value":3595},{"type":67,"tag":92,"props":3672,"children":3674},{"className":3673},[],[3675],{"type":73,"value":810},{"type":73,"value":3677}," in one beta Messages call. Older Claude models fall back",{"type":67,"tag":715,"props":3679,"children":3680},{},[3681,3692],{"type":67,"tag":737,"props":3682,"children":3683},{},[3684,3690],{"type":67,"tag":92,"props":3685,"children":3687},{"className":3686},[],[3688],{"type":73,"value":3689},"@tanstack\u002Fai-gemini",{"type":73,"value":3691}," (Gemini 3.x only)",{"type":67,"tag":737,"props":3693,"children":3694},{},[3695,3699,3700,3706,3707,3712,3714,3720],{"type":67,"tag":84,"props":3696,"children":3697},{},[3698],{"type":73,"value":3624},{"type":73,"value":3663},{"type":67,"tag":92,"props":3701,"children":3703},{"className":3702},[],[3704],{"type":73,"value":3705},"responseSchema",{"type":73,"value":3595},{"type":67,"tag":92,"props":3708,"children":3710},{"className":3709},[],[3711],{"type":73,"value":810},{"type":73,"value":3713}," in one ",{"type":67,"tag":92,"props":3715,"children":3717},{"className":3716},[],[3718],{"type":73,"value":3719},"generateContentStream",{"type":73,"value":3721},". Gemini 2.x falls back",{"type":67,"tag":715,"props":3723,"children":3724},{},[3725,3736],{"type":67,"tag":737,"props":3726,"children":3727},{},[3728,3734],{"type":67,"tag":92,"props":3729,"children":3731},{"className":3730},[],[3732],{"type":73,"value":3733},"@tanstack\u002Fai-grok",{"type":73,"value":3735}," (Grok 4 family only)",{"type":67,"tag":737,"props":3737,"children":3738},{},[3739,3743,3744,3750,3751,3756],{"type":67,"tag":84,"props":3740,"children":3741},{},[3742],{"type":73,"value":3624},{"type":73,"value":3663},{"type":67,"tag":92,"props":3745,"children":3747},{"className":3746},[],[3748],{"type":73,"value":3749},"response_format: json_schema",{"type":73,"value":3595},{"type":67,"tag":92,"props":3752,"children":3754},{"className":3753},[],[3755],{"type":73,"value":810},{"type":73,"value":3757},". Grok 2 \u002F 3 fall back",{"type":67,"tag":715,"props":3759,"children":3760},{},[3761,3770],{"type":67,"tag":737,"props":3762,"children":3763},{},[3764],{"type":67,"tag":92,"props":3765,"children":3767},{"className":3766},[],[3768],{"type":73,"value":3769},"@tanstack\u002Fai-openrouter",{"type":67,"tag":737,"props":3771,"children":3772},{},[3773,3775,3781],{"type":73,"value":3774},"Native single-request stream (legacy ",{"type":67,"tag":92,"props":3776,"children":3778},{"className":3777},[],[3779],{"type":73,"value":3780},"structuredOutputStream",{"type":73,"value":3782}," path; per-call combined-mode lookup is a follow-up)",{"type":67,"tag":715,"props":3784,"children":3785},{},[3786,3795],{"type":67,"tag":737,"props":3787,"children":3788},{},[3789],{"type":67,"tag":92,"props":3790,"children":3792},{"className":3791},[],[3793],{"type":73,"value":3794},"@tanstack\u002Fai-groq",{"type":67,"tag":737,"props":3796,"children":3797},{},[3798,3800,3805],{"type":73,"value":3799},"Legacy ",{"type":67,"tag":92,"props":3801,"children":3803},{"className":3802},[],[3804],{"type":73,"value":3780},{"type":73,"value":3806}," only (no tools — Groq's API rejects schema + tools + stream)",{"type":67,"tag":715,"props":3808,"children":3809},{},[3810,3815],{"type":67,"tag":737,"props":3811,"children":3812},{},[3813],{"type":73,"value":3814},"All other adapters (ollama, older Claude, Gemini 2.x, Grok 2\u002F3)",{"type":67,"tag":737,"props":3816,"children":3817},{},[3818,3820,3826,3828,3833],{"type":73,"value":3819},"Fallback: runs non-streaming ",{"type":67,"tag":92,"props":3821,"children":3823},{"className":3822},[],[3824],{"type":73,"value":3825},"structuredOutput",{"type":73,"value":3827},", emits one ",{"type":67,"tag":92,"props":3829,"children":3831},{"className":3830},[],[3832],{"type":73,"value":3370},{"type":73,"value":3834}," event",{"type":67,"tag":80,"props":3836,"children":3837},{},[3838,3843,3845,3851,3853,3859,3861,3866,3868,3874,3876,3882,3884,3890,3892,3897,3899,3905,3907,3912,3914,3919,3921,3926],{"type":67,"tag":84,"props":3839,"children":3840},{},[3841],{"type":73,"value":3842},"Native combined mode vs fallback",{"type":73,"value":3844}," is signaled by the adapter's\noptional ",{"type":67,"tag":92,"props":3846,"children":3848},{"className":3847},[],[3849],{"type":73,"value":3850},"supportsCombinedToolsAndSchema(modelOptions)",{"type":73,"value":3852}," method. When\nit returns ",{"type":67,"tag":92,"props":3854,"children":3856},{"className":3855},[],[3857],{"type":73,"value":3858},"true",{"type":73,"value":3860},", the engine wires the JSON Schema into the regular\n",{"type":67,"tag":92,"props":3862,"children":3864},{"className":3863},[],[3865],{"type":73,"value":3632},{"type":73,"value":3867}," call and harvests the final-turn text — middleware sees\nthe run through ",{"type":67,"tag":92,"props":3869,"children":3871},{"className":3870},[],[3872],{"type":73,"value":3873},"beforeModel",{"type":73,"value":3875}," \u002F ",{"type":67,"tag":92,"props":3877,"children":3879},{"className":3878},[],[3880],{"type":73,"value":3881},"modelStream",{"type":73,"value":3883}," as usual, and the\n",{"type":67,"tag":92,"props":3885,"children":3887},{"className":3886},[],[3888],{"type":73,"value":3889},"'structuredOutput'",{"type":73,"value":3891}," middleware phase does ",{"type":67,"tag":84,"props":3893,"children":3894},{},[3895],{"type":73,"value":3896},"not",{"type":73,"value":3898}," fire. When it\nreturns ",{"type":67,"tag":92,"props":3900,"children":3902},{"className":3901},[],[3903],{"type":73,"value":3904},"false",{"type":73,"value":3906}," (or is omitted), the engine takes the legacy\nfinalization path: agent loop, then a separate ",{"type":67,"tag":92,"props":3908,"children":3910},{"className":3909},[],[3911],{"type":73,"value":3825},{"type":73,"value":3913}," \u002F\n",{"type":67,"tag":92,"props":3915,"children":3917},{"className":3916},[],[3918],{"type":73,"value":3780},{"type":73,"value":3920}," call with ",{"type":67,"tag":92,"props":3922,"children":3924},{"className":3923},[],[3925],{"type":73,"value":3889},{"type":73,"value":3927}," phase tagging.",{"type":67,"tag":80,"props":3929,"children":3930},{},[3931,3933,3938],{"type":73,"value":3932},"Consumer code is identical across providers — always read the final object off ",{"type":67,"tag":92,"props":3934,"children":3936},{"className":3935},[],[3937],{"type":73,"value":3370},{"type":73,"value":446},{"type":67,"tag":820,"props":3940,"children":3942},{"id":3941},"pattern-4-usechat-with-outputschema-progressive-ui",[3943],{"type":73,"value":3944},"Pattern 4: useChat with outputSchema (progressive UI)",{"type":67,"tag":80,"props":3946,"children":3947},{},[3948,3949,3954,3956,3961,3963,3969,3971,3977,3979,3985,3987,3993],{"type":73,"value":2753},{"type":67,"tag":92,"props":3950,"children":3952},{"className":3951},[],[3953],{"type":73,"value":624},{"type":73,"value":3955}," to ",{"type":67,"tag":92,"props":3957,"children":3959},{"className":3958},[],[3960],{"type":73,"value":97},{"type":73,"value":3962}," and you get a ",{"type":67,"tag":92,"props":3964,"children":3966},{"className":3965},[],[3967],{"type":73,"value":3968},"partial",{"type":73,"value":3970}," field that fills in as JSON streams in, plus a ",{"type":67,"tag":92,"props":3972,"children":3974},{"className":3973},[],[3975],{"type":73,"value":3976},"final",{"type":73,"value":3978}," field that snaps to the validated object on the terminal event. No ",{"type":67,"tag":92,"props":3980,"children":3982},{"className":3981},[],[3983],{"type":73,"value":3984},"onChunk",{"type":73,"value":3986}," ceremony, no manual JSON accumulation, no ",{"type":67,"tag":92,"props":3988,"children":3990},{"className":3989},[],[3991],{"type":73,"value":3992},"parsePartialJSON",{"type":73,"value":3994}," calls.",{"type":67,"tag":80,"props":3996,"children":3997},{},[3998,4003],{"type":67,"tag":84,"props":3999,"children":4000},{},[4001],{"type":73,"value":4002},"Server",{"type":73,"value":4004}," (same as Pattern 3, just behind an SSE endpoint):",{"type":67,"tag":108,"props":4006,"children":4008},{"className":110,"code":4007,"language":15,"meta":112,"style":112},"\u002F\u002F app\u002Fapi\u002Fextract-person\u002Froute.ts (or your framework's equivalent)\nimport { chat, toServerSentEventsResponse } from '@tanstack\u002Fai'\nimport { openaiText } from '@tanstack\u002Fai-openai'\nimport { z } from 'zod'\n\nconst PersonSchema = z.object({\n  name: z.string(),\n  age: z.number(),\n  email: z.string().email(),\n})\n\nexport async function POST(request: Request) {\n  const { messages } = await request.json()\n  const stream = chat({\n    adapter: openaiText('gpt-5.2'),\n    messages,\n    outputSchema: PersonSchema,\n    stream: true,\n  })\n  return toServerSentEventsResponse(stream)\n}\n",[4009],{"type":67,"tag":92,"props":4010,"children":4011},{"__ignoreMap":112},[4012,4020,4064,4099,4134,4141,4176,4207,4238,4281,4292,4299,4351,4398,4426,4466,4478,4498,4518,4529,4554],{"type":67,"tag":118,"props":4013,"children":4014},{"class":120,"line":121},[4015],{"type":67,"tag":118,"props":4016,"children":4017},{"style":588},[4018],{"type":73,"value":4019},"\u002F\u002F app\u002Fapi\u002Fextract-person\u002Froute.ts (or your framework's equivalent)\n",{"type":67,"tag":118,"props":4021,"children":4022},{"class":120,"line":169},[4023,4027,4031,4035,4039,4044,4048,4052,4056,4060],{"type":67,"tag":118,"props":4024,"children":4025},{"style":125},[4026],{"type":73,"value":128},{"type":67,"tag":118,"props":4028,"children":4029},{"style":131},[4030],{"type":73,"value":134},{"type":67,"tag":118,"props":4032,"children":4033},{"style":137},[4034],{"type":73,"value":140},{"type":67,"tag":118,"props":4036,"children":4037},{"style":131},[4038],{"type":73,"value":389},{"type":67,"tag":118,"props":4040,"children":4041},{"style":137},[4042],{"type":73,"value":4043}," toServerSentEventsResponse",{"type":67,"tag":118,"props":4045,"children":4046},{"style":131},[4047],{"type":73,"value":145},{"type":67,"tag":118,"props":4049,"children":4050},{"style":125},[4051],{"type":73,"value":150},{"type":67,"tag":118,"props":4053,"children":4054},{"style":131},[4055],{"type":73,"value":155},{"type":67,"tag":118,"props":4057,"children":4058},{"style":158},[4059],{"type":73,"value":161},{"type":67,"tag":118,"props":4061,"children":4062},{"style":131},[4063],{"type":73,"value":166},{"type":67,"tag":118,"props":4065,"children":4066},{"class":120,"line":207},[4067,4071,4075,4079,4083,4087,4091,4095],{"type":67,"tag":118,"props":4068,"children":4069},{"style":125},[4070],{"type":73,"value":128},{"type":67,"tag":118,"props":4072,"children":4073},{"style":131},[4074],{"type":73,"value":134},{"type":67,"tag":118,"props":4076,"children":4077},{"style":137},[4078],{"type":73,"value":183},{"type":67,"tag":118,"props":4080,"children":4081},{"style":131},[4082],{"type":73,"value":145},{"type":67,"tag":118,"props":4084,"children":4085},{"style":125},[4086],{"type":73,"value":150},{"type":67,"tag":118,"props":4088,"children":4089},{"style":131},[4090],{"type":73,"value":155},{"type":67,"tag":118,"props":4092,"children":4093},{"style":158},[4094],{"type":73,"value":200},{"type":67,"tag":118,"props":4096,"children":4097},{"style":131},[4098],{"type":73,"value":166},{"type":67,"tag":118,"props":4100,"children":4101},{"class":120,"line":245},[4102,4106,4110,4114,4118,4122,4126,4130],{"type":67,"tag":118,"props":4103,"children":4104},{"style":125},[4105],{"type":73,"value":128},{"type":67,"tag":118,"props":4107,"children":4108},{"style":131},[4109],{"type":73,"value":134},{"type":67,"tag":118,"props":4111,"children":4112},{"style":137},[4113],{"type":73,"value":221},{"type":67,"tag":118,"props":4115,"children":4116},{"style":131},[4117],{"type":73,"value":145},{"type":67,"tag":118,"props":4119,"children":4120},{"style":125},[4121],{"type":73,"value":150},{"type":67,"tag":118,"props":4123,"children":4124},{"style":131},[4125],{"type":73,"value":155},{"type":67,"tag":118,"props":4127,"children":4128},{"style":158},[4129],{"type":73,"value":238},{"type":67,"tag":118,"props":4131,"children":4132},{"style":131},[4133],{"type":73,"value":166},{"type":67,"tag":118,"props":4135,"children":4136},{"class":120,"line":255},[4137],{"type":67,"tag":118,"props":4138,"children":4139},{"emptyLinePlaceholder":249},[4140],{"type":73,"value":252},{"type":67,"tag":118,"props":4142,"children":4143},{"class":120,"line":295},[4144,4148,4152,4156,4160,4164,4168,4172],{"type":67,"tag":118,"props":4145,"children":4146},{"style":259},[4147],{"type":73,"value":262},{"type":67,"tag":118,"props":4149,"children":4150},{"style":137},[4151],{"type":73,"value":956},{"type":67,"tag":118,"props":4153,"children":4154},{"style":131},[4155],{"type":73,"value":272},{"type":67,"tag":118,"props":4157,"children":4158},{"style":137},[4159],{"type":73,"value":221},{"type":67,"tag":118,"props":4161,"children":4162},{"style":131},[4163],{"type":73,"value":446},{"type":67,"tag":118,"props":4165,"children":4166},{"style":280},[4167],{"type":73,"value":451},{"type":67,"tag":118,"props":4169,"children":4170},{"style":137},[4171],{"type":73,"value":287},{"type":67,"tag":118,"props":4173,"children":4174},{"style":131},[4175],{"type":73,"value":292},{"type":67,"tag":118,"props":4177,"children":4178},{"class":120,"line":342},[4179,4183,4187,4191,4195,4199,4203],{"type":67,"tag":118,"props":4180,"children":4181},{"style":299},[4182],{"type":73,"value":988},{"type":67,"tag":118,"props":4184,"children":4185},{"style":131},[4186],{"type":73,"value":307},{"type":67,"tag":118,"props":4188,"children":4189},{"style":137},[4190],{"type":73,"value":221},{"type":67,"tag":118,"props":4192,"children":4193},{"style":131},[4194],{"type":73,"value":446},{"type":67,"tag":118,"props":4196,"children":4197},{"style":280},[4198],{"type":73,"value":485},{"type":67,"tag":118,"props":4200,"children":4201},{"style":137},[4202],{"type":73,"value":490},{"type":67,"tag":118,"props":4204,"children":4205},{"style":131},[4206],{"type":73,"value":339},{"type":67,"tag":118,"props":4208,"children":4209},{"class":120,"line":427},[4210,4214,4218,4222,4226,4230,4234],{"type":67,"tag":118,"props":4211,"children":4212},{"style":299},[4213],{"type":73,"value":1069},{"type":67,"tag":118,"props":4215,"children":4216},{"style":131},[4217],{"type":73,"value":307},{"type":67,"tag":118,"props":4219,"children":4220},{"style":137},[4221],{"type":73,"value":221},{"type":67,"tag":118,"props":4223,"children":4224},{"style":131},[4225],{"type":73,"value":446},{"type":67,"tag":118,"props":4227,"children":4228},{"style":280},[4229],{"type":73,"value":520},{"type":67,"tag":118,"props":4231,"children":4232},{"style":137},[4233],{"type":73,"value":490},{"type":67,"tag":118,"props":4235,"children":4236},{"style":131},[4237],{"type":73,"value":339},{"type":67,"tag":118,"props":4239,"children":4240},{"class":120,"line":462},[4241,4245,4249,4253,4257,4261,4265,4269,4273,4277],{"type":67,"tag":118,"props":4242,"children":4243},{"style":299},[4244],{"type":73,"value":1146},{"type":67,"tag":118,"props":4246,"children":4247},{"style":131},[4248],{"type":73,"value":307},{"type":67,"tag":118,"props":4250,"children":4251},{"style":137},[4252],{"type":73,"value":221},{"type":67,"tag":118,"props":4254,"children":4255},{"style":131},[4256],{"type":73,"value":446},{"type":67,"tag":118,"props":4258,"children":4259},{"style":280},[4260],{"type":73,"value":485},{"type":67,"tag":118,"props":4262,"children":4263},{"style":137},[4264],{"type":73,"value":490},{"type":67,"tag":118,"props":4266,"children":4267},{"style":131},[4268],{"type":73,"value":446},{"type":67,"tag":118,"props":4270,"children":4271},{"style":280},[4272],{"type":73,"value":1175},{"type":67,"tag":118,"props":4274,"children":4275},{"style":137},[4276],{"type":73,"value":490},{"type":67,"tag":118,"props":4278,"children":4279},{"style":131},[4280],{"type":73,"value":339},{"type":67,"tag":118,"props":4282,"children":4283},{"class":120,"line":497},[4284,4288],{"type":67,"tag":118,"props":4285,"children":4286},{"style":131},[4287],{"type":73,"value":554},{"type":67,"tag":118,"props":4289,"children":4290},{"style":137},[4291],{"type":73,"value":559},{"type":67,"tag":118,"props":4293,"children":4294},{"class":120,"line":531},[4295],{"type":67,"tag":118,"props":4296,"children":4297},{"emptyLinePlaceholder":249},[4298],{"type":73,"value":252},{"type":67,"tag":118,"props":4300,"children":4301},{"class":120,"line":548},[4302,4307,4312,4317,4322,4326,4332,4336,4342,4346],{"type":67,"tag":118,"props":4303,"children":4304},{"style":125},[4305],{"type":73,"value":4306},"export",{"type":67,"tag":118,"props":4308,"children":4309},{"style":259},[4310],{"type":73,"value":4311}," async",{"type":67,"tag":118,"props":4313,"children":4314},{"style":259},[4315],{"type":73,"value":4316}," function",{"type":67,"tag":118,"props":4318,"children":4319},{"style":280},[4320],{"type":73,"value":4321}," POST",{"type":67,"tag":118,"props":4323,"children":4324},{"style":131},[4325],{"type":73,"value":287},{"type":67,"tag":118,"props":4327,"children":4329},{"style":4328},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[4330],{"type":73,"value":4331},"request",{"type":67,"tag":118,"props":4333,"children":4334},{"style":131},[4335],{"type":73,"value":307},{"type":67,"tag":118,"props":4337,"children":4339},{"style":4338},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[4340],{"type":73,"value":4341}," Request",{"type":67,"tag":118,"props":4343,"children":4344},{"style":131},[4345],{"type":73,"value":334},{"type":67,"tag":118,"props":4347,"children":4348},{"style":131},[4349],{"type":73,"value":4350}," {\n",{"type":67,"tag":118,"props":4352,"children":4353},{"class":120,"line":562},[4354,4359,4363,4368,4372,4377,4381,4386,4390,4394],{"type":67,"tag":118,"props":4355,"children":4356},{"style":259},[4357],{"type":73,"value":4358},"  const",{"type":67,"tag":118,"props":4360,"children":4361},{"style":131},[4362],{"type":73,"value":134},{"type":67,"tag":118,"props":4364,"children":4365},{"style":137},[4366],{"type":73,"value":4367}," messages",{"type":67,"tag":118,"props":4369,"children":4370},{"style":131},[4371],{"type":73,"value":145},{"type":67,"tag":118,"props":4373,"children":4374},{"style":131},[4375],{"type":73,"value":4376}," =",{"type":67,"tag":118,"props":4378,"children":4379},{"style":125},[4380],{"type":73,"value":277},{"type":67,"tag":118,"props":4382,"children":4383},{"style":137},[4384],{"type":73,"value":4385}," request",{"type":67,"tag":118,"props":4387,"children":4388},{"style":131},[4389],{"type":73,"value":446},{"type":67,"tag":118,"props":4391,"children":4392},{"style":280},[4393],{"type":73,"value":19},{"type":67,"tag":118,"props":4395,"children":4396},{"style":299},[4397],{"type":73,"value":2255},{"type":67,"tag":118,"props":4399,"children":4400},{"class":120,"line":570},[4401,4405,4410,4414,4418,4422],{"type":67,"tag":118,"props":4402,"children":4403},{"style":259},[4404],{"type":73,"value":4358},{"type":67,"tag":118,"props":4406,"children":4407},{"style":137},[4408],{"type":73,"value":4409}," stream",{"type":67,"tag":118,"props":4411,"children":4412},{"style":131},[4413],{"type":73,"value":4376},{"type":67,"tag":118,"props":4415,"children":4416},{"style":280},[4417],{"type":73,"value":140},{"type":67,"tag":118,"props":4419,"children":4420},{"style":299},[4421],{"type":73,"value":287},{"type":67,"tag":118,"props":4423,"children":4424},{"style":131},[4425],{"type":73,"value":292},{"type":67,"tag":118,"props":4427,"children":4428},{"class":120,"line":594},[4429,4434,4438,4442,4446,4450,4454,4458,4462],{"type":67,"tag":118,"props":4430,"children":4431},{"style":299},[4432],{"type":73,"value":4433},"    adapter",{"type":67,"tag":118,"props":4435,"children":4436},{"style":131},[4437],{"type":73,"value":307},{"type":67,"tag":118,"props":4439,"children":4440},{"style":280},[4441],{"type":73,"value":183},{"type":67,"tag":118,"props":4443,"children":4444},{"style":299},[4445],{"type":73,"value":287},{"type":67,"tag":118,"props":4447,"children":4448},{"style":131},[4449],{"type":73,"value":320},{"type":67,"tag":118,"props":4451,"children":4452},{"style":158},[4453],{"type":73,"value":325},{"type":67,"tag":118,"props":4455,"children":4456},{"style":131},[4457],{"type":73,"value":320},{"type":67,"tag":118,"props":4459,"children":4460},{"style":299},[4461],{"type":73,"value":334},{"type":67,"tag":118,"props":4463,"children":4464},{"style":131},[4465],{"type":73,"value":339},{"type":67,"tag":118,"props":4467,"children":4468},{"class":120,"line":1351},[4469,4474],{"type":67,"tag":118,"props":4470,"children":4471},{"style":137},[4472],{"type":73,"value":4473},"    messages",{"type":67,"tag":118,"props":4475,"children":4476},{"style":131},[4477],{"type":73,"value":339},{"type":67,"tag":118,"props":4479,"children":4480},{"class":120,"line":1380},[4481,4486,4490,4494],{"type":67,"tag":118,"props":4482,"children":4483},{"style":299},[4484],{"type":73,"value":4485},"    outputSchema",{"type":67,"tag":118,"props":4487,"children":4488},{"style":131},[4489],{"type":73,"value":307},{"type":67,"tag":118,"props":4491,"children":4492},{"style":137},[4493],{"type":73,"value":1452},{"type":67,"tag":118,"props":4495,"children":4496},{"style":131},[4497],{"type":73,"value":339},{"type":67,"tag":118,"props":4499,"children":4500},{"class":120,"line":1394},[4501,4506,4510,4514],{"type":67,"tag":118,"props":4502,"children":4503},{"style":299},[4504],{"type":73,"value":4505},"    stream",{"type":67,"tag":118,"props":4507,"children":4508},{"style":131},[4509],{"type":73,"value":307},{"type":67,"tag":118,"props":4511,"children":4512},{"style":3229},[4513],{"type":73,"value":3232},{"type":67,"tag":118,"props":4515,"children":4516},{"style":131},[4517],{"type":73,"value":339},{"type":67,"tag":118,"props":4519,"children":4520},{"class":120,"line":1416},[4521,4525],{"type":67,"tag":118,"props":4522,"children":4523},{"style":131},[4524],{"type":73,"value":537},{"type":67,"tag":118,"props":4526,"children":4527},{"style":299},[4528],{"type":73,"value":559},{"type":67,"tag":118,"props":4530,"children":4531},{"class":120,"line":1425},[4532,4537,4541,4545,4550],{"type":67,"tag":118,"props":4533,"children":4534},{"style":125},[4535],{"type":73,"value":4536},"  return",{"type":67,"tag":118,"props":4538,"children":4539},{"style":280},[4540],{"type":73,"value":4043},{"type":67,"tag":118,"props":4542,"children":4543},{"style":299},[4544],{"type":73,"value":287},{"type":67,"tag":118,"props":4546,"children":4547},{"style":137},[4548],{"type":73,"value":4549},"stream",{"type":67,"tag":118,"props":4551,"children":4552},{"style":299},[4553],{"type":73,"value":559},{"type":67,"tag":118,"props":4555,"children":4556},{"class":120,"line":1438},[4557],{"type":67,"tag":118,"props":4558,"children":4559},{"style":131},[4560],{"type":73,"value":3519},{"type":67,"tag":80,"props":4562,"children":4563},{},[4564],{"type":67,"tag":84,"props":4565,"children":4566},{},[4567],{"type":73,"value":4568},"Client:",{"type":67,"tag":108,"props":4570,"children":4574},{"className":4571,"code":4572,"language":4573,"meta":112,"style":112},"language-tsx shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { useChat, fetchServerSentEvents } from '@tanstack\u002Fai-react'\nimport { z } from 'zod'\n\nconst PersonSchema = z.object({\n  name: z.string(),\n  age: z.number(),\n  email: z.string().email(),\n})\n\nfunction PersonExtractor() {\n  const { sendMessage, isLoading, partial, final } = useChat({\n    connection: fetchServerSentEvents('\u002Fapi\u002Fextract-person'),\n    outputSchema: PersonSchema,\n  })\n\n  return (\n    \u003Cdiv>\n      \u003Cbutton\n        disabled={isLoading}\n        onClick={() => sendMessage('Extract: John Doe, 30, john@example.com')}\n      >\n        Extract\n      \u003C\u002Fbutton>\n      {\u002F* `partial` fills in field by field while streaming. *\u002F}\n      \u003Cp>Name: {partial.name ?? '…'}\u003C\u002Fp>\n      \u003Cp>Age: {partial.age ?? '…'}\u003C\u002Fp>\n      \u003Cp>Email: {partial.email ?? '…'}\u003C\u002Fp>\n      {final && \u003Cpre>Validated: {JSON.stringify(final, null, 2)}\u003C\u002Fpre>}\n    \u003C\u002Fdiv>\n  )\n}\n","tsx",[4575],{"type":67,"tag":92,"props":4576,"children":4577},{"__ignoreMap":112},[4578,4624,4659,4666,4701,4732,4763,4806,4817,4824,4845,4908,4949,4968,4979,4986,4998,5016,5029,5051,5098,5106,5114,5131,5148,5216,5280,5345,5433,5449,5457],{"type":67,"tag":118,"props":4579,"children":4580},{"class":120,"line":121},[4581,4585,4589,4594,4598,4603,4607,4611,4615,4620],{"type":67,"tag":118,"props":4582,"children":4583},{"style":125},[4584],{"type":73,"value":128},{"type":67,"tag":118,"props":4586,"children":4587},{"style":131},[4588],{"type":73,"value":134},{"type":67,"tag":118,"props":4590,"children":4591},{"style":137},[4592],{"type":73,"value":4593}," useChat",{"type":67,"tag":118,"props":4595,"children":4596},{"style":131},[4597],{"type":73,"value":389},{"type":67,"tag":118,"props":4599,"children":4600},{"style":137},[4601],{"type":73,"value":4602}," fetchServerSentEvents",{"type":67,"tag":118,"props":4604,"children":4605},{"style":131},[4606],{"type":73,"value":145},{"type":67,"tag":118,"props":4608,"children":4609},{"style":125},[4610],{"type":73,"value":150},{"type":67,"tag":118,"props":4612,"children":4613},{"style":131},[4614],{"type":73,"value":155},{"type":67,"tag":118,"props":4616,"children":4617},{"style":158},[4618],{"type":73,"value":4619},"@tanstack\u002Fai-react",{"type":67,"tag":118,"props":4621,"children":4622},{"style":131},[4623],{"type":73,"value":166},{"type":67,"tag":118,"props":4625,"children":4626},{"class":120,"line":169},[4627,4631,4635,4639,4643,4647,4651,4655],{"type":67,"tag":118,"props":4628,"children":4629},{"style":125},[4630],{"type":73,"value":128},{"type":67,"tag":118,"props":4632,"children":4633},{"style":131},[4634],{"type":73,"value":134},{"type":67,"tag":118,"props":4636,"children":4637},{"style":137},[4638],{"type":73,"value":221},{"type":67,"tag":118,"props":4640,"children":4641},{"style":131},[4642],{"type":73,"value":145},{"type":67,"tag":118,"props":4644,"children":4645},{"style":125},[4646],{"type":73,"value":150},{"type":67,"tag":118,"props":4648,"children":4649},{"style":131},[4650],{"type":73,"value":155},{"type":67,"tag":118,"props":4652,"children":4653},{"style":158},[4654],{"type":73,"value":238},{"type":67,"tag":118,"props":4656,"children":4657},{"style":131},[4658],{"type":73,"value":166},{"type":67,"tag":118,"props":4660,"children":4661},{"class":120,"line":207},[4662],{"type":67,"tag":118,"props":4663,"children":4664},{"emptyLinePlaceholder":249},[4665],{"type":73,"value":252},{"type":67,"tag":118,"props":4667,"children":4668},{"class":120,"line":245},[4669,4673,4677,4681,4685,4689,4693,4697],{"type":67,"tag":118,"props":4670,"children":4671},{"style":259},[4672],{"type":73,"value":262},{"type":67,"tag":118,"props":4674,"children":4675},{"style":137},[4676],{"type":73,"value":956},{"type":67,"tag":118,"props":4678,"children":4679},{"style":131},[4680],{"type":73,"value":272},{"type":67,"tag":118,"props":4682,"children":4683},{"style":137},[4684],{"type":73,"value":221},{"type":67,"tag":118,"props":4686,"children":4687},{"style":131},[4688],{"type":73,"value":446},{"type":67,"tag":118,"props":4690,"children":4691},{"style":280},[4692],{"type":73,"value":451},{"type":67,"tag":118,"props":4694,"children":4695},{"style":137},[4696],{"type":73,"value":287},{"type":67,"tag":118,"props":4698,"children":4699},{"style":131},[4700],{"type":73,"value":292},{"type":67,"tag":118,"props":4702,"children":4703},{"class":120,"line":255},[4704,4708,4712,4716,4720,4724,4728],{"type":67,"tag":118,"props":4705,"children":4706},{"style":299},[4707],{"type":73,"value":988},{"type":67,"tag":118,"props":4709,"children":4710},{"style":131},[4711],{"type":73,"value":307},{"type":67,"tag":118,"props":4713,"children":4714},{"style":137},[4715],{"type":73,"value":221},{"type":67,"tag":118,"props":4717,"children":4718},{"style":131},[4719],{"type":73,"value":446},{"type":67,"tag":118,"props":4721,"children":4722},{"style":280},[4723],{"type":73,"value":485},{"type":67,"tag":118,"props":4725,"children":4726},{"style":137},[4727],{"type":73,"value":490},{"type":67,"tag":118,"props":4729,"children":4730},{"style":131},[4731],{"type":73,"value":339},{"type":67,"tag":118,"props":4733,"children":4734},{"class":120,"line":295},[4735,4739,4743,4747,4751,4755,4759],{"type":67,"tag":118,"props":4736,"children":4737},{"style":299},[4738],{"type":73,"value":1069},{"type":67,"tag":118,"props":4740,"children":4741},{"style":131},[4742],{"type":73,"value":307},{"type":67,"tag":118,"props":4744,"children":4745},{"style":137},[4746],{"type":73,"value":221},{"type":67,"tag":118,"props":4748,"children":4749},{"style":131},[4750],{"type":73,"value":446},{"type":67,"tag":118,"props":4752,"children":4753},{"style":280},[4754],{"type":73,"value":520},{"type":67,"tag":118,"props":4756,"children":4757},{"style":137},[4758],{"type":73,"value":490},{"type":67,"tag":118,"props":4760,"children":4761},{"style":131},[4762],{"type":73,"value":339},{"type":67,"tag":118,"props":4764,"children":4765},{"class":120,"line":342},[4766,4770,4774,4778,4782,4786,4790,4794,4798,4802],{"type":67,"tag":118,"props":4767,"children":4768},{"style":299},[4769],{"type":73,"value":1146},{"type":67,"tag":118,"props":4771,"children":4772},{"style":131},[4773],{"type":73,"value":307},{"type":67,"tag":118,"props":4775,"children":4776},{"style":137},[4777],{"type":73,"value":221},{"type":67,"tag":118,"props":4779,"children":4780},{"style":131},[4781],{"type":73,"value":446},{"type":67,"tag":118,"props":4783,"children":4784},{"style":280},[4785],{"type":73,"value":485},{"type":67,"tag":118,"props":4787,"children":4788},{"style":137},[4789],{"type":73,"value":490},{"type":67,"tag":118,"props":4791,"children":4792},{"style":131},[4793],{"type":73,"value":446},{"type":67,"tag":118,"props":4795,"children":4796},{"style":280},[4797],{"type":73,"value":1175},{"type":67,"tag":118,"props":4799,"children":4800},{"style":137},[4801],{"type":73,"value":490},{"type":67,"tag":118,"props":4803,"children":4804},{"style":131},[4805],{"type":73,"value":339},{"type":67,"tag":118,"props":4807,"children":4808},{"class":120,"line":427},[4809,4813],{"type":67,"tag":118,"props":4810,"children":4811},{"style":131},[4812],{"type":73,"value":554},{"type":67,"tag":118,"props":4814,"children":4815},{"style":137},[4816],{"type":73,"value":559},{"type":67,"tag":118,"props":4818,"children":4819},{"class":120,"line":462},[4820],{"type":67,"tag":118,"props":4821,"children":4822},{"emptyLinePlaceholder":249},[4823],{"type":73,"value":252},{"type":67,"tag":118,"props":4825,"children":4826},{"class":120,"line":497},[4827,4832,4837,4841],{"type":67,"tag":118,"props":4828,"children":4829},{"style":259},[4830],{"type":73,"value":4831},"function",{"type":67,"tag":118,"props":4833,"children":4834},{"style":280},[4835],{"type":73,"value":4836}," PersonExtractor",{"type":67,"tag":118,"props":4838,"children":4839},{"style":131},[4840],{"type":73,"value":490},{"type":67,"tag":118,"props":4842,"children":4843},{"style":131},[4844],{"type":73,"value":4350},{"type":67,"tag":118,"props":4846,"children":4847},{"class":120,"line":531},[4848,4852,4856,4861,4865,4870,4874,4879,4883,4888,4892,4896,4900,4904],{"type":67,"tag":118,"props":4849,"children":4850},{"style":259},[4851],{"type":73,"value":4358},{"type":67,"tag":118,"props":4853,"children":4854},{"style":131},[4855],{"type":73,"value":134},{"type":67,"tag":118,"props":4857,"children":4858},{"style":137},[4859],{"type":73,"value":4860}," sendMessage",{"type":67,"tag":118,"props":4862,"children":4863},{"style":131},[4864],{"type":73,"value":389},{"type":67,"tag":118,"props":4866,"children":4867},{"style":137},[4868],{"type":73,"value":4869}," isLoading",{"type":67,"tag":118,"props":4871,"children":4872},{"style":131},[4873],{"type":73,"value":389},{"type":67,"tag":118,"props":4875,"children":4876},{"style":137},[4877],{"type":73,"value":4878}," partial",{"type":67,"tag":118,"props":4880,"children":4881},{"style":131},[4882],{"type":73,"value":389},{"type":67,"tag":118,"props":4884,"children":4885},{"style":137},[4886],{"type":73,"value":4887}," final",{"type":67,"tag":118,"props":4889,"children":4890},{"style":131},[4891],{"type":73,"value":145},{"type":67,"tag":118,"props":4893,"children":4894},{"style":131},[4895],{"type":73,"value":4376},{"type":67,"tag":118,"props":4897,"children":4898},{"style":280},[4899],{"type":73,"value":4593},{"type":67,"tag":118,"props":4901,"children":4902},{"style":299},[4903],{"type":73,"value":287},{"type":67,"tag":118,"props":4905,"children":4906},{"style":131},[4907],{"type":73,"value":292},{"type":67,"tag":118,"props":4909,"children":4910},{"class":120,"line":548},[4911,4916,4920,4924,4928,4932,4937,4941,4945],{"type":67,"tag":118,"props":4912,"children":4913},{"style":299},[4914],{"type":73,"value":4915},"    connection",{"type":67,"tag":118,"props":4917,"children":4918},{"style":131},[4919],{"type":73,"value":307},{"type":67,"tag":118,"props":4921,"children":4922},{"style":280},[4923],{"type":73,"value":4602},{"type":67,"tag":118,"props":4925,"children":4926},{"style":299},[4927],{"type":73,"value":287},{"type":67,"tag":118,"props":4929,"children":4930},{"style":131},[4931],{"type":73,"value":320},{"type":67,"tag":118,"props":4933,"children":4934},{"style":158},[4935],{"type":73,"value":4936},"\u002Fapi\u002Fextract-person",{"type":67,"tag":118,"props":4938,"children":4939},{"style":131},[4940],{"type":73,"value":320},{"type":67,"tag":118,"props":4942,"children":4943},{"style":299},[4944],{"type":73,"value":334},{"type":67,"tag":118,"props":4946,"children":4947},{"style":131},[4948],{"type":73,"value":339},{"type":67,"tag":118,"props":4950,"children":4951},{"class":120,"line":562},[4952,4956,4960,4964],{"type":67,"tag":118,"props":4953,"children":4954},{"style":299},[4955],{"type":73,"value":4485},{"type":67,"tag":118,"props":4957,"children":4958},{"style":131},[4959],{"type":73,"value":307},{"type":67,"tag":118,"props":4961,"children":4962},{"style":137},[4963],{"type":73,"value":1452},{"type":67,"tag":118,"props":4965,"children":4966},{"style":131},[4967],{"type":73,"value":339},{"type":67,"tag":118,"props":4969,"children":4970},{"class":120,"line":570},[4971,4975],{"type":67,"tag":118,"props":4972,"children":4973},{"style":131},[4974],{"type":73,"value":537},{"type":67,"tag":118,"props":4976,"children":4977},{"style":299},[4978],{"type":73,"value":559},{"type":67,"tag":118,"props":4980,"children":4981},{"class":120,"line":594},[4982],{"type":67,"tag":118,"props":4983,"children":4984},{"emptyLinePlaceholder":249},[4985],{"type":73,"value":252},{"type":67,"tag":118,"props":4987,"children":4988},{"class":120,"line":1351},[4989,4993],{"type":67,"tag":118,"props":4990,"children":4991},{"style":125},[4992],{"type":73,"value":4536},{"type":67,"tag":118,"props":4994,"children":4995},{"style":299},[4996],{"type":73,"value":4997}," (\n",{"type":67,"tag":118,"props":4999,"children":5000},{"class":120,"line":1380},[5001,5006,5011],{"type":67,"tag":118,"props":5002,"children":5003},{"style":131},[5004],{"type":73,"value":5005},"    \u003C",{"type":67,"tag":118,"props":5007,"children":5008},{"style":299},[5009],{"type":73,"value":5010},"div",{"type":67,"tag":118,"props":5012,"children":5013},{"style":131},[5014],{"type":73,"value":5015},">\n",{"type":67,"tag":118,"props":5017,"children":5018},{"class":120,"line":1394},[5019,5024],{"type":67,"tag":118,"props":5020,"children":5021},{"style":131},[5022],{"type":73,"value":5023},"      \u003C",{"type":67,"tag":118,"props":5025,"children":5026},{"style":299},[5027],{"type":73,"value":5028},"button\n",{"type":67,"tag":118,"props":5030,"children":5031},{"class":120,"line":1416},[5032,5037,5042,5047],{"type":67,"tag":118,"props":5033,"children":5034},{"style":259},[5035],{"type":73,"value":5036},"        disabled",{"type":67,"tag":118,"props":5038,"children":5039},{"style":131},[5040],{"type":73,"value":5041},"={",{"type":67,"tag":118,"props":5043,"children":5044},{"style":137},[5045],{"type":73,"value":5046},"isLoading",{"type":67,"tag":118,"props":5048,"children":5049},{"style":131},[5050],{"type":73,"value":3519},{"type":67,"tag":118,"props":5052,"children":5053},{"class":120,"line":1425},[5054,5059,5064,5069,5073,5077,5081,5086,5090,5094],{"type":67,"tag":118,"props":5055,"children":5056},{"style":259},[5057],{"type":73,"value":5058},"        onClick",{"type":67,"tag":118,"props":5060,"children":5061},{"style":131},[5062],{"type":73,"value":5063},"={()",{"type":67,"tag":118,"props":5065,"children":5066},{"style":259},[5067],{"type":73,"value":5068}," =>",{"type":67,"tag":118,"props":5070,"children":5071},{"style":280},[5072],{"type":73,"value":4860},{"type":67,"tag":118,"props":5074,"children":5075},{"style":137},[5076],{"type":73,"value":287},{"type":67,"tag":118,"props":5078,"children":5079},{"style":131},[5080],{"type":73,"value":320},{"type":67,"tag":118,"props":5082,"children":5083},{"style":158},[5084],{"type":73,"value":5085},"Extract: John Doe, 30, john@example.com",{"type":67,"tag":118,"props":5087,"children":5088},{"style":131},[5089],{"type":73,"value":320},{"type":67,"tag":118,"props":5091,"children":5092},{"style":137},[5093],{"type":73,"value":334},{"type":67,"tag":118,"props":5095,"children":5096},{"style":131},[5097],{"type":73,"value":3519},{"type":67,"tag":118,"props":5099,"children":5100},{"class":120,"line":1438},[5101],{"type":67,"tag":118,"props":5102,"children":5103},{"style":131},[5104],{"type":73,"value":5105},"      >\n",{"type":67,"tag":118,"props":5107,"children":5108},{"class":120,"line":1459},[5109],{"type":67,"tag":118,"props":5110,"children":5111},{"style":137},[5112],{"type":73,"value":5113},"        Extract\n",{"type":67,"tag":118,"props":5115,"children":5116},{"class":120,"line":1471},[5117,5122,5127],{"type":67,"tag":118,"props":5118,"children":5119},{"style":131},[5120],{"type":73,"value":5121},"      \u003C\u002F",{"type":67,"tag":118,"props":5123,"children":5124},{"style":299},[5125],{"type":73,"value":5126},"button",{"type":67,"tag":118,"props":5128,"children":5129},{"style":131},[5130],{"type":73,"value":5015},{"type":67,"tag":118,"props":5132,"children":5133},{"class":120,"line":1479},[5134,5139,5144],{"type":67,"tag":118,"props":5135,"children":5136},{"style":131},[5137],{"type":73,"value":5138},"      {",{"type":67,"tag":118,"props":5140,"children":5141},{"style":588},[5142],{"type":73,"value":5143},"\u002F* `partial` fills in field by field while streaming. *\u002F",{"type":67,"tag":118,"props":5145,"children":5146},{"style":131},[5147],{"type":73,"value":3519},{"type":67,"tag":118,"props":5149,"children":5150},{"class":120,"line":1516},[5151,5155,5159,5164,5169,5173,5177,5181,5185,5190,5194,5199,5203,5208,5212],{"type":67,"tag":118,"props":5152,"children":5153},{"style":131},[5154],{"type":73,"value":5023},{"type":67,"tag":118,"props":5156,"children":5157},{"style":299},[5158],{"type":73,"value":80},{"type":67,"tag":118,"props":5160,"children":5161},{"style":131},[5162],{"type":73,"value":5163},">",{"type":67,"tag":118,"props":5165,"children":5166},{"style":137},[5167],{"type":73,"value":5168},"Name: ",{"type":67,"tag":118,"props":5170,"children":5171},{"style":131},[5172],{"type":73,"value":362},{"type":67,"tag":118,"props":5174,"children":5175},{"style":137},[5176],{"type":73,"value":3968},{"type":67,"tag":118,"props":5178,"children":5179},{"style":131},[5180],{"type":73,"value":446},{"type":67,"tag":118,"props":5182,"children":5183},{"style":137},[5184],{"type":73,"value":585},{"type":67,"tag":118,"props":5186,"children":5187},{"style":131},[5188],{"type":73,"value":5189},"??",{"type":67,"tag":118,"props":5191,"children":5192},{"style":131},[5193],{"type":73,"value":155},{"type":67,"tag":118,"props":5195,"children":5196},{"style":158},[5197],{"type":73,"value":5198},"…",{"type":67,"tag":118,"props":5200,"children":5201},{"style":131},[5202],{"type":73,"value":320},{"type":67,"tag":118,"props":5204,"children":5205},{"style":131},[5206],{"type":73,"value":5207},"}\u003C\u002F",{"type":67,"tag":118,"props":5209,"children":5210},{"style":299},[5211],{"type":73,"value":80},{"type":67,"tag":118,"props":5213,"children":5214},{"style":131},[5215],{"type":73,"value":5015},{"type":67,"tag":118,"props":5217,"children":5218},{"class":120,"line":1550},[5219,5223,5227,5231,5236,5240,5244,5248,5252,5256,5260,5264,5268,5272,5276],{"type":67,"tag":118,"props":5220,"children":5221},{"style":131},[5222],{"type":73,"value":5023},{"type":67,"tag":118,"props":5224,"children":5225},{"style":299},[5226],{"type":73,"value":80},{"type":67,"tag":118,"props":5228,"children":5229},{"style":131},[5230],{"type":73,"value":5163},{"type":67,"tag":118,"props":5232,"children":5233},{"style":137},[5234],{"type":73,"value":5235},"Age: ",{"type":67,"tag":118,"props":5237,"children":5238},{"style":131},[5239],{"type":73,"value":362},{"type":67,"tag":118,"props":5241,"children":5242},{"style":137},[5243],{"type":73,"value":3968},{"type":67,"tag":118,"props":5245,"children":5246},{"style":131},[5247],{"type":73,"value":446},{"type":67,"tag":118,"props":5249,"children":5250},{"style":137},[5251],{"type":73,"value":608},{"type":67,"tag":118,"props":5253,"children":5254},{"style":131},[5255],{"type":73,"value":5189},{"type":67,"tag":118,"props":5257,"children":5258},{"style":131},[5259],{"type":73,"value":155},{"type":67,"tag":118,"props":5261,"children":5262},{"style":158},[5263],{"type":73,"value":5198},{"type":67,"tag":118,"props":5265,"children":5266},{"style":131},[5267],{"type":73,"value":320},{"type":67,"tag":118,"props":5269,"children":5270},{"style":131},[5271],{"type":73,"value":5207},{"type":67,"tag":118,"props":5273,"children":5274},{"style":299},[5275],{"type":73,"value":80},{"type":67,"tag":118,"props":5277,"children":5278},{"style":131},[5279],{"type":73,"value":5015},{"type":67,"tag":118,"props":5281,"children":5282},{"class":120,"line":2354},[5283,5287,5291,5295,5300,5304,5308,5312,5317,5321,5325,5329,5333,5337,5341],{"type":67,"tag":118,"props":5284,"children":5285},{"style":131},[5286],{"type":73,"value":5023},{"type":67,"tag":118,"props":5288,"children":5289},{"style":299},[5290],{"type":73,"value":80},{"type":67,"tag":118,"props":5292,"children":5293},{"style":131},[5294],{"type":73,"value":5163},{"type":67,"tag":118,"props":5296,"children":5297},{"style":137},[5298],{"type":73,"value":5299},"Email: ",{"type":67,"tag":118,"props":5301,"children":5302},{"style":131},[5303],{"type":73,"value":362},{"type":67,"tag":118,"props":5305,"children":5306},{"style":137},[5307],{"type":73,"value":3968},{"type":67,"tag":118,"props":5309,"children":5310},{"style":131},[5311],{"type":73,"value":446},{"type":67,"tag":118,"props":5313,"children":5314},{"style":137},[5315],{"type":73,"value":5316},"email ",{"type":67,"tag":118,"props":5318,"children":5319},{"style":131},[5320],{"type":73,"value":5189},{"type":67,"tag":118,"props":5322,"children":5323},{"style":131},[5324],{"type":73,"value":155},{"type":67,"tag":118,"props":5326,"children":5327},{"style":158},[5328],{"type":73,"value":5198},{"type":67,"tag":118,"props":5330,"children":5331},{"style":131},[5332],{"type":73,"value":320},{"type":67,"tag":118,"props":5334,"children":5335},{"style":131},[5336],{"type":73,"value":5207},{"type":67,"tag":118,"props":5338,"children":5339},{"style":299},[5340],{"type":73,"value":80},{"type":67,"tag":118,"props":5342,"children":5343},{"style":131},[5344],{"type":73,"value":5015},{"type":67,"tag":118,"props":5346,"children":5347},{"class":120,"line":2374},[5348,5352,5357,5362,5367,5371,5375,5380,5384,5388,5392,5397,5402,5406,5411,5416,5420,5424,5428],{"type":67,"tag":118,"props":5349,"children":5350},{"style":131},[5351],{"type":73,"value":5138},{"type":67,"tag":118,"props":5353,"children":5354},{"style":137},[5355],{"type":73,"value":5356},"final ",{"type":67,"tag":118,"props":5358,"children":5359},{"style":131},[5360],{"type":73,"value":5361},"&&",{"type":67,"tag":118,"props":5363,"children":5364},{"style":131},[5365],{"type":73,"value":5366}," \u003C",{"type":67,"tag":118,"props":5368,"children":5369},{"style":299},[5370],{"type":73,"value":108},{"type":67,"tag":118,"props":5372,"children":5373},{"style":131},[5374],{"type":73,"value":5163},{"type":67,"tag":118,"props":5376,"children":5377},{"style":137},[5378],{"type":73,"value":5379},"Validated: ",{"type":67,"tag":118,"props":5381,"children":5382},{"style":131},[5383],{"type":73,"value":362},{"type":67,"tag":118,"props":5385,"children":5386},{"style":137},[5387],{"type":73,"value":18},{"type":67,"tag":118,"props":5389,"children":5390},{"style":131},[5391],{"type":73,"value":446},{"type":67,"tag":118,"props":5393,"children":5394},{"style":280},[5395],{"type":73,"value":5396},"stringify",{"type":67,"tag":118,"props":5398,"children":5399},{"style":137},[5400],{"type":73,"value":5401},"(final",{"type":67,"tag":118,"props":5403,"children":5404},{"style":131},[5405],{"type":73,"value":389},{"type":67,"tag":118,"props":5407,"children":5408},{"style":131},[5409],{"type":73,"value":5410}," null,",{"type":67,"tag":118,"props":5412,"children":5413},{"style":2687},[5414],{"type":73,"value":5415}," 2",{"type":67,"tag":118,"props":5417,"children":5418},{"style":137},[5419],{"type":73,"value":334},{"type":67,"tag":118,"props":5421,"children":5422},{"style":131},[5423],{"type":73,"value":5207},{"type":67,"tag":118,"props":5425,"children":5426},{"style":299},[5427],{"type":73,"value":108},{"type":67,"tag":118,"props":5429,"children":5430},{"style":131},[5431],{"type":73,"value":5432},">}\n",{"type":67,"tag":118,"props":5434,"children":5435},{"class":120,"line":2386},[5436,5441,5445],{"type":67,"tag":118,"props":5437,"children":5438},{"style":131},[5439],{"type":73,"value":5440},"    \u003C\u002F",{"type":67,"tag":118,"props":5442,"children":5443},{"style":299},[5444],{"type":73,"value":5010},{"type":67,"tag":118,"props":5446,"children":5447},{"style":131},[5448],{"type":73,"value":5015},{"type":67,"tag":118,"props":5450,"children":5451},{"class":120,"line":2394},[5452],{"type":67,"tag":118,"props":5453,"children":5454},{"style":299},[5455],{"type":73,"value":5456},"  )\n",{"type":67,"tag":118,"props":5458,"children":5459},{"class":120,"line":2427},[5460],{"type":67,"tag":118,"props":5461,"children":5462},{"style":131},[5463],{"type":73,"value":3519},{"type":67,"tag":5465,"props":5466,"children":5467},"ul",{},[5468,5495,5519,5544],{"type":67,"tag":5469,"props":5470,"children":5471},"li",{},[5472,5477,5479,5485,5487,5493],{"type":67,"tag":92,"props":5473,"children":5475},{"className":5474},[],[5476],{"type":73,"value":3968},{"type":73,"value":5478}," is ",{"type":67,"tag":92,"props":5480,"children":5482},{"className":5481},[],[5483],{"type":73,"value":5484},"DeepPartial\u003Cz.infer\u003Ctypeof PersonSchema>>",{"type":73,"value":5486}," — every property optional, every nested array element optional. Updated from ",{"type":67,"tag":92,"props":5488,"children":5490},{"className":5489},[],[5491],{"type":73,"value":5492},"TEXT_MESSAGE_CONTENT",{"type":73,"value":5494}," deltas.",{"type":67,"tag":5469,"props":5496,"children":5497},{},[5498,5503,5504,5510,5512,5517],{"type":67,"tag":92,"props":5499,"children":5501},{"className":5500},[],[5502],{"type":73,"value":3976},{"type":73,"value":5478},{"type":67,"tag":92,"props":5505,"children":5507},{"className":5506},[],[5508],{"type":73,"value":5509},"z.infer\u003Ctypeof PersonSchema> | null",{"type":73,"value":5511}," — populated when ",{"type":67,"tag":92,"props":5513,"children":5515},{"className":5514},[],[5516],{"type":73,"value":3370},{"type":73,"value":5518}," arrives.",{"type":67,"tag":5469,"props":5520,"children":5521},{},[5522,5527,5529,5534,5536,5542],{"type":67,"tag":92,"props":5523,"children":5525},{"className":5524},[],[5526],{"type":73,"value":624},{"type":73,"value":5528}," is for client-side type inference only. ",{"type":67,"tag":84,"props":5530,"children":5531},{},[5532],{"type":73,"value":5533},"Validation runs on the server",{"type":73,"value":5535}," against the schema you pass to ",{"type":67,"tag":92,"props":5537,"children":5539},{"className":5538},[],[5540],{"type":73,"value":5541},"chat({ outputSchema })",{"type":73,"value":5543}," there.",{"type":67,"tag":5469,"props":5545,"children":5546},{},[5547,5549,5554,5556,5561,5563,5568],{"type":73,"value":5548},"Same shape works for non-streaming adapters: the fallback path emits one whole-JSON ",{"type":67,"tag":92,"props":5550,"children":5552},{"className":5551},[],[5553],{"type":73,"value":5492},{"type":73,"value":5555}," then the terminal event, so ",{"type":67,"tag":92,"props":5557,"children":5559},{"className":5558},[],[5560],{"type":73,"value":3968},{"type":73,"value":5562}," populates and ",{"type":67,"tag":92,"props":5564,"children":5566},{"className":5565},[],[5567],{"type":73,"value":3976},{"type":73,"value":5569}," snaps in the same render tick — same consumer code as the native-streaming providers, just without an intermediate field-by-field reveal.",{"type":67,"tag":820,"props":5571,"children":5573},{"id":5572},"pattern-5-multi-turn-structured-chat",[5574],{"type":73,"value":5575},"Pattern 5: Multi-turn structured chat",{"type":67,"tag":80,"props":5577,"children":5578},{},[5579,5581,5586,5588,5594,5596,5602],{"type":73,"value":5580},"Every assistant turn produced by ",{"type":67,"tag":92,"props":5582,"children":5584},{"className":5583},[],[5585],{"type":73,"value":765},{"type":73,"value":5587}," carries its own typed ",{"type":67,"tag":92,"props":5589,"children":5591},{"className":5590},[],[5592],{"type":73,"value":5593},"StructuredOutputPart",{"type":73,"value":5595}," on ",{"type":67,"tag":92,"props":5597,"children":5599},{"className":5598},[],[5600],{"type":73,"value":5601},"messages[i].parts",{"type":73,"value":5603},". Old turns stay renderable; new turns produce new parts; history is preserved without manual state plumbing. This is what makes the recipe-builder shape (\"now make it vegan\") work.",{"type":67,"tag":108,"props":5605,"children":5607},{"className":4571,"code":5606,"language":4573,"meta":112,"style":112},"import { useChat, fetchServerSentEvents } from '@tanstack\u002Fai-react'\nimport type { StructuredOutputPart } from '@tanstack\u002Fai-client'\nimport { z } from 'zod'\n\nconst RecipeSchema = z.object({\n  title: z.string(),\n  cuisine: z.string(),\n  servings: z.number(),\n  ingredients: z.array(z.object({ item: z.string(), amount: z.string() })),\n  steps: z.array(z.string()),\n})\ntype Recipe = z.infer\u003Ctypeof RecipeSchema>\ntype RecipePart = StructuredOutputPart\u003CRecipe>\n\nfunction RecipeBuilder() {\n  const { messages, sendMessage } = useChat({\n    outputSchema: RecipeSchema,\n    connection: fetchServerSentEvents('\u002Fapi\u002Frecipes'),\n  })\n\n  return (\n    \u003Cdiv>\n      {messages.map((m) => {\n        if (m.role === 'user') {\n          const text = m.parts\n            .filter((p) => p.type === 'text')\n            .map((p) => p.content)\n            .join('')\n          return \u003CUserBubble key={m.id} text={text} \u002F>\n        }\n        if (m.role === 'assistant') {\n          \u002F\u002F `data` is `Recipe` because the schema generic flows from\n          \u002F\u002F `useChat({ outputSchema })` through `messages` to the part.\n          const part = m.parts.find(\n            (p): p is RecipePart => p.type === 'structured-output',\n          )\n          if (!part) return null\n          return \u003CRecipeCard key={m.id} part={part} \u002F>\n        }\n        return null\n      })}\n      \u003Cbutton onClick={() => sendMessage('pasta for two')}>Cook\u003C\u002Fbutton>\n      \u003Cbutton onClick={() => sendMessage('now make it vegan')}>Modify\u003C\u002Fbutton>\n    \u003C\u002Fdiv>\n  )\n}\n\nfunction RecipeCard({ part }: { part: RecipePart }) {\n  \u002F\u002F `data` lands on complete, `partial` fills in while streaming.\n  \u002F\u002F Both are typed against the schema. No casts.\n  const recipe = part.data ?? part.partial ?? ({} as Partial\u003CRecipe>)\n  return \u003Ch3>{recipe.title ?? 'Plating up…'}\u003C\u002Fh3>\n}\n",[5608],{"type":67,"tag":92,"props":5609,"children":5610},{"__ignoreMap":112},[5611,5654,5696,5731,5738,5774,5806,5838,5870,5983,6028,6039,6082,6116,6123,6143,6186,6205,6245,6256,6263,6274,6289,6335,6384,6415,6481,6529,6554,6615,6623,6671,6679,6687,6729,6796,6804,6840,6896,6903,6915,6931,7003,7072,7087,7095,7103,7111,7163,7172,7181,7267,7331],{"type":67,"tag":118,"props":5612,"children":5613},{"class":120,"line":121},[5614,5618,5622,5626,5630,5634,5638,5642,5646,5650],{"type":67,"tag":118,"props":5615,"children":5616},{"style":125},[5617],{"type":73,"value":128},{"type":67,"tag":118,"props":5619,"children":5620},{"style":131},[5621],{"type":73,"value":134},{"type":67,"tag":118,"props":5623,"children":5624},{"style":137},[5625],{"type":73,"value":4593},{"type":67,"tag":118,"props":5627,"children":5628},{"style":131},[5629],{"type":73,"value":389},{"type":67,"tag":118,"props":5631,"children":5632},{"style":137},[5633],{"type":73,"value":4602},{"type":67,"tag":118,"props":5635,"children":5636},{"style":131},[5637],{"type":73,"value":145},{"type":67,"tag":118,"props":5639,"children":5640},{"style":125},[5641],{"type":73,"value":150},{"type":67,"tag":118,"props":5643,"children":5644},{"style":131},[5645],{"type":73,"value":155},{"type":67,"tag":118,"props":5647,"children":5648},{"style":158},[5649],{"type":73,"value":4619},{"type":67,"tag":118,"props":5651,"children":5652},{"style":131},[5653],{"type":73,"value":166},{"type":67,"tag":118,"props":5655,"children":5656},{"class":120,"line":169},[5657,5661,5666,5670,5675,5679,5683,5687,5692],{"type":67,"tag":118,"props":5658,"children":5659},{"style":125},[5660],{"type":73,"value":128},{"type":67,"tag":118,"props":5662,"children":5663},{"style":125},[5664],{"type":73,"value":5665}," type",{"type":67,"tag":118,"props":5667,"children":5668},{"style":131},[5669],{"type":73,"value":134},{"type":67,"tag":118,"props":5671,"children":5672},{"style":137},[5673],{"type":73,"value":5674}," StructuredOutputPart",{"type":67,"tag":118,"props":5676,"children":5677},{"style":131},[5678],{"type":73,"value":145},{"type":67,"tag":118,"props":5680,"children":5681},{"style":125},[5682],{"type":73,"value":150},{"type":67,"tag":118,"props":5684,"children":5685},{"style":131},[5686],{"type":73,"value":155},{"type":67,"tag":118,"props":5688,"children":5689},{"style":158},[5690],{"type":73,"value":5691},"@tanstack\u002Fai-client",{"type":67,"tag":118,"props":5693,"children":5694},{"style":131},[5695],{"type":73,"value":166},{"type":67,"tag":118,"props":5697,"children":5698},{"class":120,"line":207},[5699,5703,5707,5711,5715,5719,5723,5727],{"type":67,"tag":118,"props":5700,"children":5701},{"style":125},[5702],{"type":73,"value":128},{"type":67,"tag":118,"props":5704,"children":5705},{"style":131},[5706],{"type":73,"value":134},{"type":67,"tag":118,"props":5708,"children":5709},{"style":137},[5710],{"type":73,"value":221},{"type":67,"tag":118,"props":5712,"children":5713},{"style":131},[5714],{"type":73,"value":145},{"type":67,"tag":118,"props":5716,"children":5717},{"style":125},[5718],{"type":73,"value":150},{"type":67,"tag":118,"props":5720,"children":5721},{"style":131},[5722],{"type":73,"value":155},{"type":67,"tag":118,"props":5724,"children":5725},{"style":158},[5726],{"type":73,"value":238},{"type":67,"tag":118,"props":5728,"children":5729},{"style":131},[5730],{"type":73,"value":166},{"type":67,"tag":118,"props":5732,"children":5733},{"class":120,"line":245},[5734],{"type":67,"tag":118,"props":5735,"children":5736},{"emptyLinePlaceholder":249},[5737],{"type":73,"value":252},{"type":67,"tag":118,"props":5739,"children":5740},{"class":120,"line":255},[5741,5745,5750,5754,5758,5762,5766,5770],{"type":67,"tag":118,"props":5742,"children":5743},{"style":259},[5744],{"type":73,"value":262},{"type":67,"tag":118,"props":5746,"children":5747},{"style":137},[5748],{"type":73,"value":5749}," RecipeSchema ",{"type":67,"tag":118,"props":5751,"children":5752},{"style":131},[5753],{"type":73,"value":272},{"type":67,"tag":118,"props":5755,"children":5756},{"style":137},[5757],{"type":73,"value":221},{"type":67,"tag":118,"props":5759,"children":5760},{"style":131},[5761],{"type":73,"value":446},{"type":67,"tag":118,"props":5763,"children":5764},{"style":280},[5765],{"type":73,"value":451},{"type":67,"tag":118,"props":5767,"children":5768},{"style":137},[5769],{"type":73,"value":287},{"type":67,"tag":118,"props":5771,"children":5772},{"style":131},[5773],{"type":73,"value":292},{"type":67,"tag":118,"props":5775,"children":5776},{"class":120,"line":295},[5777,5782,5786,5790,5794,5798,5802],{"type":67,"tag":118,"props":5778,"children":5779},{"style":299},[5780],{"type":73,"value":5781},"  title",{"type":67,"tag":118,"props":5783,"children":5784},{"style":131},[5785],{"type":73,"value":307},{"type":67,"tag":118,"props":5787,"children":5788},{"style":137},[5789],{"type":73,"value":221},{"type":67,"tag":118,"props":5791,"children":5792},{"style":131},[5793],{"type":73,"value":446},{"type":67,"tag":118,"props":5795,"children":5796},{"style":280},[5797],{"type":73,"value":485},{"type":67,"tag":118,"props":5799,"children":5800},{"style":137},[5801],{"type":73,"value":490},{"type":67,"tag":118,"props":5803,"children":5804},{"style":131},[5805],{"type":73,"value":339},{"type":67,"tag":118,"props":5807,"children":5808},{"class":120,"line":342},[5809,5814,5818,5822,5826,5830,5834],{"type":67,"tag":118,"props":5810,"children":5811},{"style":299},[5812],{"type":73,"value":5813},"  cuisine",{"type":67,"tag":118,"props":5815,"children":5816},{"style":131},[5817],{"type":73,"value":307},{"type":67,"tag":118,"props":5819,"children":5820},{"style":137},[5821],{"type":73,"value":221},{"type":67,"tag":118,"props":5823,"children":5824},{"style":131},[5825],{"type":73,"value":446},{"type":67,"tag":118,"props":5827,"children":5828},{"style":280},[5829],{"type":73,"value":485},{"type":67,"tag":118,"props":5831,"children":5832},{"style":137},[5833],{"type":73,"value":490},{"type":67,"tag":118,"props":5835,"children":5836},{"style":131},[5837],{"type":73,"value":339},{"type":67,"tag":118,"props":5839,"children":5840},{"class":120,"line":427},[5841,5846,5850,5854,5858,5862,5866],{"type":67,"tag":118,"props":5842,"children":5843},{"style":299},[5844],{"type":73,"value":5845},"  servings",{"type":67,"tag":118,"props":5847,"children":5848},{"style":131},[5849],{"type":73,"value":307},{"type":67,"tag":118,"props":5851,"children":5852},{"style":137},[5853],{"type":73,"value":221},{"type":67,"tag":118,"props":5855,"children":5856},{"style":131},[5857],{"type":73,"value":446},{"type":67,"tag":118,"props":5859,"children":5860},{"style":280},[5861],{"type":73,"value":520},{"type":67,"tag":118,"props":5863,"children":5864},{"style":137},[5865],{"type":73,"value":490},{"type":67,"tag":118,"props":5867,"children":5868},{"style":131},[5869],{"type":73,"value":339},{"type":67,"tag":118,"props":5871,"children":5872},{"class":120,"line":462},[5873,5878,5882,5886,5890,5894,5899,5903,5907,5911,5915,5920,5924,5928,5932,5936,5940,5944,5949,5953,5957,5961,5965,5970,5974,5979],{"type":67,"tag":118,"props":5874,"children":5875},{"style":299},[5876],{"type":73,"value":5877},"  ingredients",{"type":67,"tag":118,"props":5879,"children":5880},{"style":131},[5881],{"type":73,"value":307},{"type":67,"tag":118,"props":5883,"children":5884},{"style":137},[5885],{"type":73,"value":221},{"type":67,"tag":118,"props":5887,"children":5888},{"style":131},[5889],{"type":73,"value":446},{"type":67,"tag":118,"props":5891,"children":5892},{"style":280},[5893],{"type":73,"value":2033},{"type":67,"tag":118,"props":5895,"children":5896},{"style":137},[5897],{"type":73,"value":5898},"(z",{"type":67,"tag":118,"props":5900,"children":5901},{"style":131},[5902],{"type":73,"value":446},{"type":67,"tag":118,"props":5904,"children":5905},{"style":280},[5906],{"type":73,"value":451},{"type":67,"tag":118,"props":5908,"children":5909},{"style":137},[5910],{"type":73,"value":287},{"type":67,"tag":118,"props":5912,"children":5913},{"style":131},[5914],{"type":73,"value":362},{"type":67,"tag":118,"props":5916,"children":5917},{"style":299},[5918],{"type":73,"value":5919}," item",{"type":67,"tag":118,"props":5921,"children":5922},{"style":131},[5923],{"type":73,"value":307},{"type":67,"tag":118,"props":5925,"children":5926},{"style":137},[5927],{"type":73,"value":221},{"type":67,"tag":118,"props":5929,"children":5930},{"style":131},[5931],{"type":73,"value":446},{"type":67,"tag":118,"props":5933,"children":5934},{"style":280},[5935],{"type":73,"value":485},{"type":67,"tag":118,"props":5937,"children":5938},{"style":137},[5939],{"type":73,"value":490},{"type":67,"tag":118,"props":5941,"children":5942},{"style":131},[5943],{"type":73,"value":389},{"type":67,"tag":118,"props":5945,"children":5946},{"style":299},[5947],{"type":73,"value":5948}," amount",{"type":67,"tag":118,"props":5950,"children":5951},{"style":131},[5952],{"type":73,"value":307},{"type":67,"tag":118,"props":5954,"children":5955},{"style":137},[5956],{"type":73,"value":221},{"type":67,"tag":118,"props":5958,"children":5959},{"style":131},[5960],{"type":73,"value":446},{"type":67,"tag":118,"props":5962,"children":5963},{"style":280},[5964],{"type":73,"value":485},{"type":67,"tag":118,"props":5966,"children":5967},{"style":137},[5968],{"type":73,"value":5969},"() ",{"type":67,"tag":118,"props":5971,"children":5972},{"style":131},[5973],{"type":73,"value":554},{"type":67,"tag":118,"props":5975,"children":5976},{"style":137},[5977],{"type":73,"value":5978},"))",{"type":67,"tag":118,"props":5980,"children":5981},{"style":131},[5982],{"type":73,"value":339},{"type":67,"tag":118,"props":5984,"children":5985},{"class":120,"line":497},[5986,5991,5995,5999,6003,6007,6011,6015,6019,6024],{"type":67,"tag":118,"props":5987,"children":5988},{"style":299},[5989],{"type":73,"value":5990},"  steps",{"type":67,"tag":118,"props":5992,"children":5993},{"style":131},[5994],{"type":73,"value":307},{"type":67,"tag":118,"props":5996,"children":5997},{"style":137},[5998],{"type":73,"value":221},{"type":67,"tag":118,"props":6000,"children":6001},{"style":131},[6002],{"type":73,"value":446},{"type":67,"tag":118,"props":6004,"children":6005},{"style":280},[6006],{"type":73,"value":2033},{"type":67,"tag":118,"props":6008,"children":6009},{"style":137},[6010],{"type":73,"value":5898},{"type":67,"tag":118,"props":6012,"children":6013},{"style":131},[6014],{"type":73,"value":446},{"type":67,"tag":118,"props":6016,"children":6017},{"style":280},[6018],{"type":73,"value":485},{"type":67,"tag":118,"props":6020,"children":6021},{"style":137},[6022],{"type":73,"value":6023},"())",{"type":67,"tag":118,"props":6025,"children":6026},{"style":131},[6027],{"type":73,"value":339},{"type":67,"tag":118,"props":6029,"children":6030},{"class":120,"line":531},[6031,6035],{"type":67,"tag":118,"props":6032,"children":6033},{"style":131},[6034],{"type":73,"value":554},{"type":67,"tag":118,"props":6036,"children":6037},{"style":137},[6038],{"type":73,"value":559},{"type":67,"tag":118,"props":6040,"children":6041},{"class":120,"line":548},[6042,6046,6051,6055,6059,6063,6068,6073,6078],{"type":67,"tag":118,"props":6043,"children":6044},{"style":259},[6045],{"type":73,"value":3320},{"type":67,"tag":118,"props":6047,"children":6048},{"style":4338},[6049],{"type":73,"value":6050}," Recipe",{"type":67,"tag":118,"props":6052,"children":6053},{"style":131},[6054],{"type":73,"value":4376},{"type":67,"tag":118,"props":6056,"children":6057},{"style":4338},[6058],{"type":73,"value":221},{"type":67,"tag":118,"props":6060,"children":6061},{"style":131},[6062],{"type":73,"value":446},{"type":67,"tag":118,"props":6064,"children":6065},{"style":4338},[6066],{"type":73,"value":6067},"infer",{"type":67,"tag":118,"props":6069,"children":6070},{"style":131},[6071],{"type":73,"value":6072},"\u003Ctypeof",{"type":67,"tag":118,"props":6074,"children":6075},{"style":137},[6076],{"type":73,"value":6077}," RecipeSchema",{"type":67,"tag":118,"props":6079,"children":6080},{"style":131},[6081],{"type":73,"value":5015},{"type":67,"tag":118,"props":6083,"children":6084},{"class":120,"line":562},[6085,6089,6094,6098,6102,6107,6112],{"type":67,"tag":118,"props":6086,"children":6087},{"style":259},[6088],{"type":73,"value":3320},{"type":67,"tag":118,"props":6090,"children":6091},{"style":4338},[6092],{"type":73,"value":6093}," RecipePart",{"type":67,"tag":118,"props":6095,"children":6096},{"style":131},[6097],{"type":73,"value":4376},{"type":67,"tag":118,"props":6099,"children":6100},{"style":4338},[6101],{"type":73,"value":5674},{"type":67,"tag":118,"props":6103,"children":6104},{"style":131},[6105],{"type":73,"value":6106},"\u003C",{"type":67,"tag":118,"props":6108,"children":6109},{"style":4338},[6110],{"type":73,"value":6111},"Recipe",{"type":67,"tag":118,"props":6113,"children":6114},{"style":131},[6115],{"type":73,"value":5015},{"type":67,"tag":118,"props":6117,"children":6118},{"class":120,"line":570},[6119],{"type":67,"tag":118,"props":6120,"children":6121},{"emptyLinePlaceholder":249},[6122],{"type":73,"value":252},{"type":67,"tag":118,"props":6124,"children":6125},{"class":120,"line":594},[6126,6130,6135,6139],{"type":67,"tag":118,"props":6127,"children":6128},{"style":259},[6129],{"type":73,"value":4831},{"type":67,"tag":118,"props":6131,"children":6132},{"style":280},[6133],{"type":73,"value":6134}," RecipeBuilder",{"type":67,"tag":118,"props":6136,"children":6137},{"style":131},[6138],{"type":73,"value":490},{"type":67,"tag":118,"props":6140,"children":6141},{"style":131},[6142],{"type":73,"value":4350},{"type":67,"tag":118,"props":6144,"children":6145},{"class":120,"line":1351},[6146,6150,6154,6158,6162,6166,6170,6174,6178,6182],{"type":67,"tag":118,"props":6147,"children":6148},{"style":259},[6149],{"type":73,"value":4358},{"type":67,"tag":118,"props":6151,"children":6152},{"style":131},[6153],{"type":73,"value":134},{"type":67,"tag":118,"props":6155,"children":6156},{"style":137},[6157],{"type":73,"value":4367},{"type":67,"tag":118,"props":6159,"children":6160},{"style":131},[6161],{"type":73,"value":389},{"type":67,"tag":118,"props":6163,"children":6164},{"style":137},[6165],{"type":73,"value":4860},{"type":67,"tag":118,"props":6167,"children":6168},{"style":131},[6169],{"type":73,"value":145},{"type":67,"tag":118,"props":6171,"children":6172},{"style":131},[6173],{"type":73,"value":4376},{"type":67,"tag":118,"props":6175,"children":6176},{"style":280},[6177],{"type":73,"value":4593},{"type":67,"tag":118,"props":6179,"children":6180},{"style":299},[6181],{"type":73,"value":287},{"type":67,"tag":118,"props":6183,"children":6184},{"style":131},[6185],{"type":73,"value":292},{"type":67,"tag":118,"props":6187,"children":6188},{"class":120,"line":1380},[6189,6193,6197,6201],{"type":67,"tag":118,"props":6190,"children":6191},{"style":299},[6192],{"type":73,"value":4485},{"type":67,"tag":118,"props":6194,"children":6195},{"style":131},[6196],{"type":73,"value":307},{"type":67,"tag":118,"props":6198,"children":6199},{"style":137},[6200],{"type":73,"value":6077},{"type":67,"tag":118,"props":6202,"children":6203},{"style":131},[6204],{"type":73,"value":339},{"type":67,"tag":118,"props":6206,"children":6207},{"class":120,"line":1394},[6208,6212,6216,6220,6224,6228,6233,6237,6241],{"type":67,"tag":118,"props":6209,"children":6210},{"style":299},[6211],{"type":73,"value":4915},{"type":67,"tag":118,"props":6213,"children":6214},{"style":131},[6215],{"type":73,"value":307},{"type":67,"tag":118,"props":6217,"children":6218},{"style":280},[6219],{"type":73,"value":4602},{"type":67,"tag":118,"props":6221,"children":6222},{"style":299},[6223],{"type":73,"value":287},{"type":67,"tag":118,"props":6225,"children":6226},{"style":131},[6227],{"type":73,"value":320},{"type":67,"tag":118,"props":6229,"children":6230},{"style":158},[6231],{"type":73,"value":6232},"\u002Fapi\u002Frecipes",{"type":67,"tag":118,"props":6234,"children":6235},{"style":131},[6236],{"type":73,"value":320},{"type":67,"tag":118,"props":6238,"children":6239},{"style":299},[6240],{"type":73,"value":334},{"type":67,"tag":118,"props":6242,"children":6243},{"style":131},[6244],{"type":73,"value":339},{"type":67,"tag":118,"props":6246,"children":6247},{"class":120,"line":1416},[6248,6252],{"type":67,"tag":118,"props":6249,"children":6250},{"style":131},[6251],{"type":73,"value":537},{"type":67,"tag":118,"props":6253,"children":6254},{"style":299},[6255],{"type":73,"value":559},{"type":67,"tag":118,"props":6257,"children":6258},{"class":120,"line":1425},[6259],{"type":67,"tag":118,"props":6260,"children":6261},{"emptyLinePlaceholder":249},[6262],{"type":73,"value":252},{"type":67,"tag":118,"props":6264,"children":6265},{"class":120,"line":1438},[6266,6270],{"type":67,"tag":118,"props":6267,"children":6268},{"style":125},[6269],{"type":73,"value":4536},{"type":67,"tag":118,"props":6271,"children":6272},{"style":299},[6273],{"type":73,"value":4997},{"type":67,"tag":118,"props":6275,"children":6276},{"class":120,"line":1459},[6277,6281,6285],{"type":67,"tag":118,"props":6278,"children":6279},{"style":131},[6280],{"type":73,"value":5005},{"type":67,"tag":118,"props":6282,"children":6283},{"style":299},[6284],{"type":73,"value":5010},{"type":67,"tag":118,"props":6286,"children":6287},{"style":131},[6288],{"type":73,"value":5015},{"type":67,"tag":118,"props":6290,"children":6291},{"class":120,"line":1471},[6292,6296,6301,6305,6310,6314,6318,6323,6327,6331],{"type":67,"tag":118,"props":6293,"children":6294},{"style":131},[6295],{"type":73,"value":5138},{"type":67,"tag":118,"props":6297,"children":6298},{"style":137},[6299],{"type":73,"value":6300},"messages",{"type":67,"tag":118,"props":6302,"children":6303},{"style":131},[6304],{"type":73,"value":446},{"type":67,"tag":118,"props":6306,"children":6307},{"style":280},[6308],{"type":73,"value":6309},"map",{"type":67,"tag":118,"props":6311,"children":6312},{"style":137},[6313],{"type":73,"value":287},{"type":67,"tag":118,"props":6315,"children":6316},{"style":131},[6317],{"type":73,"value":287},{"type":67,"tag":118,"props":6319,"children":6320},{"style":4328},[6321],{"type":73,"value":6322},"m",{"type":67,"tag":118,"props":6324,"children":6325},{"style":131},[6326],{"type":73,"value":334},{"type":67,"tag":118,"props":6328,"children":6329},{"style":259},[6330],{"type":73,"value":5068},{"type":67,"tag":118,"props":6332,"children":6333},{"style":131},[6334],{"type":73,"value":4350},{"type":67,"tag":118,"props":6336,"children":6337},{"class":120,"line":1479},[6338,6343,6347,6351,6355,6360,6364,6368,6372,6376,6380],{"type":67,"tag":118,"props":6339,"children":6340},{"style":125},[6341],{"type":73,"value":6342},"        if",{"type":67,"tag":118,"props":6344,"children":6345},{"style":299},[6346],{"type":73,"value":3271},{"type":67,"tag":118,"props":6348,"children":6349},{"style":137},[6350],{"type":73,"value":6322},{"type":67,"tag":118,"props":6352,"children":6353},{"style":131},[6354],{"type":73,"value":446},{"type":67,"tag":118,"props":6356,"children":6357},{"style":137},[6358],{"type":73,"value":6359},"role",{"type":67,"tag":118,"props":6361,"children":6362},{"style":131},[6363],{"type":73,"value":3325},{"type":67,"tag":118,"props":6365,"children":6366},{"style":131},[6367],{"type":73,"value":155},{"type":67,"tag":118,"props":6369,"children":6370},{"style":158},[6371],{"type":73,"value":380},{"type":67,"tag":118,"props":6373,"children":6374},{"style":131},[6375],{"type":73,"value":320},{"type":67,"tag":118,"props":6377,"children":6378},{"style":299},[6379],{"type":73,"value":3379},{"type":67,"tag":118,"props":6381,"children":6382},{"style":131},[6383],{"type":73,"value":292},{"type":67,"tag":118,"props":6385,"children":6386},{"class":120,"line":1516},[6387,6392,6397,6401,6406,6410],{"type":67,"tag":118,"props":6388,"children":6389},{"style":259},[6390],{"type":73,"value":6391},"          const",{"type":67,"tag":118,"props":6393,"children":6394},{"style":137},[6395],{"type":73,"value":6396}," text",{"type":67,"tag":118,"props":6398,"children":6399},{"style":131},[6400],{"type":73,"value":4376},{"type":67,"tag":118,"props":6402,"children":6403},{"style":137},[6404],{"type":73,"value":6405}," m",{"type":67,"tag":118,"props":6407,"children":6408},{"style":131},[6409],{"type":73,"value":446},{"type":67,"tag":118,"props":6411,"children":6412},{"style":137},[6413],{"type":73,"value":6414},"parts\n",{"type":67,"tag":118,"props":6416,"children":6417},{"class":120,"line":1550},[6418,6423,6428,6432,6436,6440,6444,6448,6453,6457,6461,6465,6469,6473,6477],{"type":67,"tag":118,"props":6419,"children":6420},{"style":131},[6421],{"type":73,"value":6422},"            .",{"type":67,"tag":118,"props":6424,"children":6425},{"style":280},[6426],{"type":73,"value":6427},"filter",{"type":67,"tag":118,"props":6429,"children":6430},{"style":299},[6431],{"type":73,"value":287},{"type":67,"tag":118,"props":6433,"children":6434},{"style":131},[6435],{"type":73,"value":287},{"type":67,"tag":118,"props":6437,"children":6438},{"style":4328},[6439],{"type":73,"value":80},{"type":67,"tag":118,"props":6441,"children":6442},{"style":131},[6443],{"type":73,"value":334},{"type":67,"tag":118,"props":6445,"children":6446},{"style":259},[6447],{"type":73,"value":5068},{"type":67,"tag":118,"props":6449,"children":6450},{"style":137},[6451],{"type":73,"value":6452}," p",{"type":67,"tag":118,"props":6454,"children":6455},{"style":131},[6456],{"type":73,"value":446},{"type":67,"tag":118,"props":6458,"children":6459},{"style":137},[6460],{"type":73,"value":3320},{"type":67,"tag":118,"props":6462,"children":6463},{"style":131},[6464],{"type":73,"value":3325},{"type":67,"tag":118,"props":6466,"children":6467},{"style":131},[6468],{"type":73,"value":155},{"type":67,"tag":118,"props":6470,"children":6471},{"style":158},[6472],{"type":73,"value":73},{"type":67,"tag":118,"props":6474,"children":6475},{"style":131},[6476],{"type":73,"value":320},{"type":67,"tag":118,"props":6478,"children":6479},{"style":299},[6480],{"type":73,"value":559},{"type":67,"tag":118,"props":6482,"children":6483},{"class":120,"line":2354},[6484,6488,6492,6496,6500,6504,6508,6512,6516,6520,6525],{"type":67,"tag":118,"props":6485,"children":6486},{"style":131},[6487],{"type":73,"value":6422},{"type":67,"tag":118,"props":6489,"children":6490},{"style":280},[6491],{"type":73,"value":6309},{"type":67,"tag":118,"props":6493,"children":6494},{"style":299},[6495],{"type":73,"value":287},{"type":67,"tag":118,"props":6497,"children":6498},{"style":131},[6499],{"type":73,"value":287},{"type":67,"tag":118,"props":6501,"children":6502},{"style":4328},[6503],{"type":73,"value":80},{"type":67,"tag":118,"props":6505,"children":6506},{"style":131},[6507],{"type":73,"value":334},{"type":67,"tag":118,"props":6509,"children":6510},{"style":259},[6511],{"type":73,"value":5068},{"type":67,"tag":118,"props":6513,"children":6514},{"style":137},[6515],{"type":73,"value":6452},{"type":67,"tag":118,"props":6517,"children":6518},{"style":131},[6519],{"type":73,"value":446},{"type":67,"tag":118,"props":6521,"children":6522},{"style":137},[6523],{"type":73,"value":6524},"content",{"type":67,"tag":118,"props":6526,"children":6527},{"style":299},[6528],{"type":73,"value":559},{"type":67,"tag":118,"props":6530,"children":6531},{"class":120,"line":2374},[6532,6536,6541,6545,6550],{"type":67,"tag":118,"props":6533,"children":6534},{"style":131},[6535],{"type":73,"value":6422},{"type":67,"tag":118,"props":6537,"children":6538},{"style":280},[6539],{"type":73,"value":6540},"join",{"type":67,"tag":118,"props":6542,"children":6543},{"style":299},[6544],{"type":73,"value":287},{"type":67,"tag":118,"props":6546,"children":6547},{"style":131},[6548],{"type":73,"value":6549},"''",{"type":67,"tag":118,"props":6551,"children":6552},{"style":299},[6553],{"type":73,"value":559},{"type":67,"tag":118,"props":6555,"children":6556},{"class":120,"line":2386},[6557,6562,6566,6571,6576,6580,6584,6588,6593,6598,6602,6606,6610],{"type":67,"tag":118,"props":6558,"children":6559},{"style":125},[6560],{"type":73,"value":6561},"          return",{"type":67,"tag":118,"props":6563,"children":6564},{"style":131},[6565],{"type":73,"value":5366},{"type":67,"tag":118,"props":6567,"children":6568},{"style":4338},[6569],{"type":73,"value":6570},"UserBubble",{"type":67,"tag":118,"props":6572,"children":6573},{"style":259},[6574],{"type":73,"value":6575}," key",{"type":67,"tag":118,"props":6577,"children":6578},{"style":131},[6579],{"type":73,"value":5041},{"type":67,"tag":118,"props":6581,"children":6582},{"style":137},[6583],{"type":73,"value":6322},{"type":67,"tag":118,"props":6585,"children":6586},{"style":131},[6587],{"type":73,"value":446},{"type":67,"tag":118,"props":6589,"children":6590},{"style":137},[6591],{"type":73,"value":6592},"id",{"type":67,"tag":118,"props":6594,"children":6595},{"style":131},[6596],{"type":73,"value":6597},"} ",{"type":67,"tag":118,"props":6599,"children":6600},{"style":259},[6601],{"type":73,"value":73},{"type":67,"tag":118,"props":6603,"children":6604},{"style":131},[6605],{"type":73,"value":5041},{"type":67,"tag":118,"props":6607,"children":6608},{"style":137},[6609],{"type":73,"value":73},{"type":67,"tag":118,"props":6611,"children":6612},{"style":131},[6613],{"type":73,"value":6614},"} \u002F>\n",{"type":67,"tag":118,"props":6616,"children":6617},{"class":120,"line":2394},[6618],{"type":67,"tag":118,"props":6619,"children":6620},{"style":131},[6621],{"type":73,"value":6622},"        }\n",{"type":67,"tag":118,"props":6624,"children":6625},{"class":120,"line":2427},[6626,6630,6634,6638,6642,6646,6650,6654,6659,6663,6667],{"type":67,"tag":118,"props":6627,"children":6628},{"style":125},[6629],{"type":73,"value":6342},{"type":67,"tag":118,"props":6631,"children":6632},{"style":299},[6633],{"type":73,"value":3271},{"type":67,"tag":118,"props":6635,"children":6636},{"style":137},[6637],{"type":73,"value":6322},{"type":67,"tag":118,"props":6639,"children":6640},{"style":131},[6641],{"type":73,"value":446},{"type":67,"tag":118,"props":6643,"children":6644},{"style":137},[6645],{"type":73,"value":6359},{"type":67,"tag":118,"props":6647,"children":6648},{"style":131},[6649],{"type":73,"value":3325},{"type":67,"tag":118,"props":6651,"children":6652},{"style":131},[6653],{"type":73,"value":155},{"type":67,"tag":118,"props":6655,"children":6656},{"style":158},[6657],{"type":73,"value":6658},"assistant",{"type":67,"tag":118,"props":6660,"children":6661},{"style":131},[6662],{"type":73,"value":320},{"type":67,"tag":118,"props":6664,"children":6665},{"style":299},[6666],{"type":73,"value":3379},{"type":67,"tag":118,"props":6668,"children":6669},{"style":131},[6670],{"type":73,"value":292},{"type":67,"tag":118,"props":6672,"children":6673},{"class":120,"line":2468},[6674],{"type":67,"tag":118,"props":6675,"children":6676},{"style":588},[6677],{"type":73,"value":6678},"          \u002F\u002F `data` is `Recipe` because the schema generic flows from\n",{"type":67,"tag":118,"props":6680,"children":6681},{"class":120,"line":2484},[6682],{"type":67,"tag":118,"props":6683,"children":6684},{"style":588},[6685],{"type":73,"value":6686},"          \u002F\u002F `useChat({ outputSchema })` through `messages` to the part.\n",{"type":67,"tag":118,"props":6688,"children":6689},{"class":120,"line":2492},[6690,6694,6699,6703,6707,6711,6716,6720,6725],{"type":67,"tag":118,"props":6691,"children":6692},{"style":259},[6693],{"type":73,"value":6391},{"type":67,"tag":118,"props":6695,"children":6696},{"style":137},[6697],{"type":73,"value":6698}," part",{"type":67,"tag":118,"props":6700,"children":6701},{"style":131},[6702],{"type":73,"value":4376},{"type":67,"tag":118,"props":6704,"children":6705},{"style":137},[6706],{"type":73,"value":6405},{"type":67,"tag":118,"props":6708,"children":6709},{"style":131},[6710],{"type":73,"value":446},{"type":67,"tag":118,"props":6712,"children":6713},{"style":137},[6714],{"type":73,"value":6715},"parts",{"type":67,"tag":118,"props":6717,"children":6718},{"style":131},[6719],{"type":73,"value":446},{"type":67,"tag":118,"props":6721,"children":6722},{"style":280},[6723],{"type":73,"value":6724},"find",{"type":67,"tag":118,"props":6726,"children":6727},{"style":299},[6728],{"type":73,"value":2038},{"type":67,"tag":118,"props":6730,"children":6731},{"class":120,"line":2520},[6732,6737,6741,6746,6750,6755,6759,6763,6767,6771,6775,6779,6783,6788,6792],{"type":67,"tag":118,"props":6733,"children":6734},{"style":131},[6735],{"type":73,"value":6736},"            (",{"type":67,"tag":118,"props":6738,"children":6739},{"style":4328},[6740],{"type":73,"value":80},{"type":67,"tag":118,"props":6742,"children":6743},{"style":131},[6744],{"type":73,"value":6745},"):",{"type":67,"tag":118,"props":6747,"children":6748},{"style":4328},[6749],{"type":73,"value":6452},{"type":67,"tag":118,"props":6751,"children":6752},{"style":131},[6753],{"type":73,"value":6754}," is",{"type":67,"tag":118,"props":6756,"children":6757},{"style":4338},[6758],{"type":73,"value":6093},{"type":67,"tag":118,"props":6760,"children":6761},{"style":259},[6762],{"type":73,"value":5068},{"type":67,"tag":118,"props":6764,"children":6765},{"style":137},[6766],{"type":73,"value":6452},{"type":67,"tag":118,"props":6768,"children":6769},{"style":131},[6770],{"type":73,"value":446},{"type":67,"tag":118,"props":6772,"children":6773},{"style":137},[6774],{"type":73,"value":3320},{"type":67,"tag":118,"props":6776,"children":6777},{"style":131},[6778],{"type":73,"value":3325},{"type":67,"tag":118,"props":6780,"children":6781},{"style":131},[6782],{"type":73,"value":155},{"type":67,"tag":118,"props":6784,"children":6785},{"style":158},[6786],{"type":73,"value":6787},"structured-output",{"type":67,"tag":118,"props":6789,"children":6790},{"style":131},[6791],{"type":73,"value":320},{"type":67,"tag":118,"props":6793,"children":6794},{"style":131},[6795],{"type":73,"value":339},{"type":67,"tag":118,"props":6797,"children":6798},{"class":120,"line":2549},[6799],{"type":67,"tag":118,"props":6800,"children":6801},{"style":299},[6802],{"type":73,"value":6803},"          )\n",{"type":67,"tag":118,"props":6805,"children":6806},{"class":120,"line":2557},[6807,6812,6816,6821,6826,6830,6835],{"type":67,"tag":118,"props":6808,"children":6809},{"style":125},[6810],{"type":73,"value":6811},"          if",{"type":67,"tag":118,"props":6813,"children":6814},{"style":299},[6815],{"type":73,"value":3271},{"type":67,"tag":118,"props":6817,"children":6818},{"style":131},[6819],{"type":73,"value":6820},"!",{"type":67,"tag":118,"props":6822,"children":6823},{"style":137},[6824],{"type":73,"value":6825},"part",{"type":67,"tag":118,"props":6827,"children":6828},{"style":299},[6829],{"type":73,"value":3379},{"type":67,"tag":118,"props":6831,"children":6832},{"style":125},[6833],{"type":73,"value":6834},"return",{"type":67,"tag":118,"props":6836,"children":6837},{"style":131},[6838],{"type":73,"value":6839}," null\n",{"type":67,"tag":118,"props":6841,"children":6842},{"class":120,"line":2569},[6843,6847,6851,6856,6860,6864,6868,6872,6876,6880,6884,6888,6892],{"type":67,"tag":118,"props":6844,"children":6845},{"style":125},[6846],{"type":73,"value":6561},{"type":67,"tag":118,"props":6848,"children":6849},{"style":131},[6850],{"type":73,"value":5366},{"type":67,"tag":118,"props":6852,"children":6853},{"style":4338},[6854],{"type":73,"value":6855},"RecipeCard",{"type":67,"tag":118,"props":6857,"children":6858},{"style":259},[6859],{"type":73,"value":6575},{"type":67,"tag":118,"props":6861,"children":6862},{"style":131},[6863],{"type":73,"value":5041},{"type":67,"tag":118,"props":6865,"children":6866},{"style":137},[6867],{"type":73,"value":6322},{"type":67,"tag":118,"props":6869,"children":6870},{"style":131},[6871],{"type":73,"value":446},{"type":67,"tag":118,"props":6873,"children":6874},{"style":137},[6875],{"type":73,"value":6592},{"type":67,"tag":118,"props":6877,"children":6878},{"style":131},[6879],{"type":73,"value":6597},{"type":67,"tag":118,"props":6881,"children":6882},{"style":259},[6883],{"type":73,"value":6825},{"type":67,"tag":118,"props":6885,"children":6886},{"style":131},[6887],{"type":73,"value":5041},{"type":67,"tag":118,"props":6889,"children":6890},{"style":137},[6891],{"type":73,"value":6825},{"type":67,"tag":118,"props":6893,"children":6894},{"style":131},[6895],{"type":73,"value":6614},{"type":67,"tag":118,"props":6897,"children":6898},{"class":120,"line":2590},[6899],{"type":67,"tag":118,"props":6900,"children":6901},{"style":131},[6902],{"type":73,"value":6622},{"type":67,"tag":118,"props":6904,"children":6905},{"class":120,"line":2602},[6906,6911],{"type":67,"tag":118,"props":6907,"children":6908},{"style":125},[6909],{"type":73,"value":6910},"        return",{"type":67,"tag":118,"props":6912,"children":6913},{"style":131},[6914],{"type":73,"value":6839},{"type":67,"tag":118,"props":6916,"children":6917},{"class":120,"line":2610},[6918,6923,6927],{"type":67,"tag":118,"props":6919,"children":6920},{"style":131},[6921],{"type":73,"value":6922},"      }",{"type":67,"tag":118,"props":6924,"children":6925},{"style":137},[6926],{"type":73,"value":334},{"type":67,"tag":118,"props":6928,"children":6929},{"style":131},[6930],{"type":73,"value":3519},{"type":67,"tag":118,"props":6932,"children":6933},{"class":120,"line":2619},[6934,6938,6942,6947,6951,6955,6959,6963,6967,6972,6976,6980,6985,6990,6995,6999],{"type":67,"tag":118,"props":6935,"children":6936},{"style":131},[6937],{"type":73,"value":5023},{"type":67,"tag":118,"props":6939,"children":6940},{"style":299},[6941],{"type":73,"value":5126},{"type":67,"tag":118,"props":6943,"children":6944},{"style":259},[6945],{"type":73,"value":6946}," onClick",{"type":67,"tag":118,"props":6948,"children":6949},{"style":131},[6950],{"type":73,"value":5063},{"type":67,"tag":118,"props":6952,"children":6953},{"style":259},[6954],{"type":73,"value":5068},{"type":67,"tag":118,"props":6956,"children":6957},{"style":280},[6958],{"type":73,"value":4860},{"type":67,"tag":118,"props":6960,"children":6961},{"style":137},[6962],{"type":73,"value":287},{"type":67,"tag":118,"props":6964,"children":6965},{"style":131},[6966],{"type":73,"value":320},{"type":67,"tag":118,"props":6968,"children":6969},{"style":158},[6970],{"type":73,"value":6971},"pasta for two",{"type":67,"tag":118,"props":6973,"children":6974},{"style":131},[6975],{"type":73,"value":320},{"type":67,"tag":118,"props":6977,"children":6978},{"style":137},[6979],{"type":73,"value":334},{"type":67,"tag":118,"props":6981,"children":6982},{"style":131},[6983],{"type":73,"value":6984},"}>",{"type":67,"tag":118,"props":6986,"children":6987},{"style":137},[6988],{"type":73,"value":6989},"Cook",{"type":67,"tag":118,"props":6991,"children":6992},{"style":131},[6993],{"type":73,"value":6994},"\u003C\u002F",{"type":67,"tag":118,"props":6996,"children":6997},{"style":299},[6998],{"type":73,"value":5126},{"type":67,"tag":118,"props":7000,"children":7001},{"style":131},[7002],{"type":73,"value":5015},{"type":67,"tag":118,"props":7004,"children":7005},{"class":120,"line":2658},[7006,7010,7014,7018,7022,7026,7030,7034,7038,7043,7047,7051,7055,7060,7064,7068],{"type":67,"tag":118,"props":7007,"children":7008},{"style":131},[7009],{"type":73,"value":5023},{"type":67,"tag":118,"props":7011,"children":7012},{"style":299},[7013],{"type":73,"value":5126},{"type":67,"tag":118,"props":7015,"children":7016},{"style":259},[7017],{"type":73,"value":6946},{"type":67,"tag":118,"props":7019,"children":7020},{"style":131},[7021],{"type":73,"value":5063},{"type":67,"tag":118,"props":7023,"children":7024},{"style":259},[7025],{"type":73,"value":5068},{"type":67,"tag":118,"props":7027,"children":7028},{"style":280},[7029],{"type":73,"value":4860},{"type":67,"tag":118,"props":7031,"children":7032},{"style":137},[7033],{"type":73,"value":287},{"type":67,"tag":118,"props":7035,"children":7036},{"style":131},[7037],{"type":73,"value":320},{"type":67,"tag":118,"props":7039,"children":7040},{"style":158},[7041],{"type":73,"value":7042},"now make it vegan",{"type":67,"tag":118,"props":7044,"children":7045},{"style":131},[7046],{"type":73,"value":320},{"type":67,"tag":118,"props":7048,"children":7049},{"style":137},[7050],{"type":73,"value":334},{"type":67,"tag":118,"props":7052,"children":7053},{"style":131},[7054],{"type":73,"value":6984},{"type":67,"tag":118,"props":7056,"children":7057},{"style":137},[7058],{"type":73,"value":7059},"Modify",{"type":67,"tag":118,"props":7061,"children":7062},{"style":131},[7063],{"type":73,"value":6994},{"type":67,"tag":118,"props":7065,"children":7066},{"style":299},[7067],{"type":73,"value":5126},{"type":67,"tag":118,"props":7069,"children":7070},{"style":131},[7071],{"type":73,"value":5015},{"type":67,"tag":118,"props":7073,"children":7074},{"class":120,"line":2706},[7075,7079,7083],{"type":67,"tag":118,"props":7076,"children":7077},{"style":131},[7078],{"type":73,"value":5440},{"type":67,"tag":118,"props":7080,"children":7081},{"style":299},[7082],{"type":73,"value":5010},{"type":67,"tag":118,"props":7084,"children":7085},{"style":131},[7086],{"type":73,"value":5015},{"type":67,"tag":118,"props":7088,"children":7090},{"class":120,"line":7089},45,[7091],{"type":67,"tag":118,"props":7092,"children":7093},{"style":299},[7094],{"type":73,"value":5456},{"type":67,"tag":118,"props":7096,"children":7098},{"class":120,"line":7097},46,[7099],{"type":67,"tag":118,"props":7100,"children":7101},{"style":131},[7102],{"type":73,"value":3519},{"type":67,"tag":118,"props":7104,"children":7106},{"class":120,"line":7105},47,[7107],{"type":67,"tag":118,"props":7108,"children":7109},{"emptyLinePlaceholder":249},[7110],{"type":73,"value":252},{"type":67,"tag":118,"props":7112,"children":7114},{"class":120,"line":7113},48,[7115,7119,7124,7129,7133,7138,7142,7146,7150,7154,7159],{"type":67,"tag":118,"props":7116,"children":7117},{"style":259},[7118],{"type":73,"value":4831},{"type":67,"tag":118,"props":7120,"children":7121},{"style":280},[7122],{"type":73,"value":7123}," RecipeCard",{"type":67,"tag":118,"props":7125,"children":7126},{"style":131},[7127],{"type":73,"value":7128},"({",{"type":67,"tag":118,"props":7130,"children":7131},{"style":4328},[7132],{"type":73,"value":6698},{"type":67,"tag":118,"props":7134,"children":7135},{"style":131},[7136],{"type":73,"value":7137}," }:",{"type":67,"tag":118,"props":7139,"children":7140},{"style":131},[7141],{"type":73,"value":134},{"type":67,"tag":118,"props":7143,"children":7144},{"style":299},[7145],{"type":73,"value":6698},{"type":67,"tag":118,"props":7147,"children":7148},{"style":131},[7149],{"type":73,"value":307},{"type":67,"tag":118,"props":7151,"children":7152},{"style":4338},[7153],{"type":73,"value":6093},{"type":67,"tag":118,"props":7155,"children":7156},{"style":131},[7157],{"type":73,"value":7158}," })",{"type":67,"tag":118,"props":7160,"children":7161},{"style":131},[7162],{"type":73,"value":4350},{"type":67,"tag":118,"props":7164,"children":7166},{"class":120,"line":7165},49,[7167],{"type":67,"tag":118,"props":7168,"children":7169},{"style":588},[7170],{"type":73,"value":7171},"  \u002F\u002F `data` lands on complete, `partial` fills in while streaming.\n",{"type":67,"tag":118,"props":7173,"children":7175},{"class":120,"line":7174},50,[7176],{"type":67,"tag":118,"props":7177,"children":7178},{"style":588},[7179],{"type":73,"value":7180},"  \u002F\u002F Both are typed against the schema. No casts.\n",{"type":67,"tag":118,"props":7182,"children":7184},{"class":120,"line":7183},51,[7185,7189,7194,7198,7202,7206,7211,7216,7220,7224,7228,7232,7236,7241,7246,7251,7255,7259,7263],{"type":67,"tag":118,"props":7186,"children":7187},{"style":259},[7188],{"type":73,"value":4358},{"type":67,"tag":118,"props":7190,"children":7191},{"style":137},[7192],{"type":73,"value":7193}," recipe",{"type":67,"tag":118,"props":7195,"children":7196},{"style":131},[7197],{"type":73,"value":4376},{"type":67,"tag":118,"props":7199,"children":7200},{"style":137},[7201],{"type":73,"value":6698},{"type":67,"tag":118,"props":7203,"children":7204},{"style":131},[7205],{"type":73,"value":446},{"type":67,"tag":118,"props":7207,"children":7208},{"style":137},[7209],{"type":73,"value":7210},"data",{"type":67,"tag":118,"props":7212,"children":7213},{"style":131},[7214],{"type":73,"value":7215}," ??",{"type":67,"tag":118,"props":7217,"children":7218},{"style":137},[7219],{"type":73,"value":6698},{"type":67,"tag":118,"props":7221,"children":7222},{"style":131},[7223],{"type":73,"value":446},{"type":67,"tag":118,"props":7225,"children":7226},{"style":137},[7227],{"type":73,"value":3968},{"type":67,"tag":118,"props":7229,"children":7230},{"style":131},[7231],{"type":73,"value":7215},{"type":67,"tag":118,"props":7233,"children":7234},{"style":299},[7235],{"type":73,"value":3271},{"type":67,"tag":118,"props":7237,"children":7238},{"style":131},[7239],{"type":73,"value":7240},"{}",{"type":67,"tag":118,"props":7242,"children":7243},{"style":125},[7244],{"type":73,"value":7245}," as",{"type":67,"tag":118,"props":7247,"children":7248},{"style":4338},[7249],{"type":73,"value":7250}," Partial",{"type":67,"tag":118,"props":7252,"children":7253},{"style":131},[7254],{"type":73,"value":6106},{"type":67,"tag":118,"props":7256,"children":7257},{"style":4338},[7258],{"type":73,"value":6111},{"type":67,"tag":118,"props":7260,"children":7261},{"style":131},[7262],{"type":73,"value":5163},{"type":67,"tag":118,"props":7264,"children":7265},{"style":299},[7266],{"type":73,"value":559},{"type":67,"tag":118,"props":7268,"children":7270},{"class":120,"line":7269},52,[7271,7275,7279,7283,7288,7293,7297,7302,7306,7310,7315,7319,7323,7327],{"type":67,"tag":118,"props":7272,"children":7273},{"style":125},[7274],{"type":73,"value":4536},{"type":67,"tag":118,"props":7276,"children":7277},{"style":131},[7278],{"type":73,"value":5366},{"type":67,"tag":118,"props":7280,"children":7281},{"style":299},[7282],{"type":73,"value":820},{"type":67,"tag":118,"props":7284,"children":7285},{"style":131},[7286],{"type":73,"value":7287},">{",{"type":67,"tag":118,"props":7289,"children":7290},{"style":137},[7291],{"type":73,"value":7292},"recipe",{"type":67,"tag":118,"props":7294,"children":7295},{"style":131},[7296],{"type":73,"value":446},{"type":67,"tag":118,"props":7298,"children":7299},{"style":137},[7300],{"type":73,"value":7301},"title ",{"type":67,"tag":118,"props":7303,"children":7304},{"style":131},[7305],{"type":73,"value":5189},{"type":67,"tag":118,"props":7307,"children":7308},{"style":131},[7309],{"type":73,"value":155},{"type":67,"tag":118,"props":7311,"children":7312},{"style":158},[7313],{"type":73,"value":7314},"Plating up…",{"type":67,"tag":118,"props":7316,"children":7317},{"style":131},[7318],{"type":73,"value":320},{"type":67,"tag":118,"props":7320,"children":7321},{"style":131},[7322],{"type":73,"value":5207},{"type":67,"tag":118,"props":7324,"children":7325},{"style":299},[7326],{"type":73,"value":820},{"type":67,"tag":118,"props":7328,"children":7329},{"style":131},[7330],{"type":73,"value":5015},{"type":67,"tag":118,"props":7332,"children":7334},{"class":120,"line":7333},53,[7335],{"type":67,"tag":118,"props":7336,"children":7337},{"style":131},[7338],{"type":73,"value":3519},{"type":67,"tag":80,"props":7340,"children":7341},{},[7342],{"type":73,"value":7343},"Key behaviors:",{"type":67,"tag":5465,"props":7345,"children":7346},{},[7347,7380,7495,7564],{"type":67,"tag":5469,"props":7348,"children":7349},{},[7350,7355,7357,7363,7365,7370,7372,7378],{"type":67,"tag":84,"props":7351,"children":7352},{},[7353],{"type":73,"value":7354},"Per-turn parts.",{"type":73,"value":7356}," Each ",{"type":67,"tag":92,"props":7358,"children":7360},{"className":7359},[],[7361],{"type":73,"value":7362},"sendMessage()",{"type":73,"value":7364}," produces a new assistant message with its own ",{"type":67,"tag":92,"props":7366,"children":7368},{"className":7367},[],[7369],{"type":73,"value":5593},{"type":73,"value":7371},". The previous turn's part is untouched — ",{"type":67,"tag":92,"props":7373,"children":7375},{"className":7374},[],[7376],{"type":73,"value":7377},"messages.map(...)",{"type":73,"value":7379}," renders the whole history.",{"type":67,"tag":5469,"props":7381,"children":7382},{},[7383,7388,7390,7396,7398,7403,7405,7411,7413,7419,7421,7427,7429,7435,7437,7443,7444,7450,7452,7464,7466,7472,7474,7479,7481,7487,7489,7494],{"type":67,"tag":84,"props":7384,"children":7385},{},[7386],{"type":73,"value":7387},"Typed by schema.",{"type":73,"value":7389}," ",{"type":67,"tag":92,"props":7391,"children":7393},{"className":7392},[],[7394],{"type":73,"value":7395},"messages[i].parts.find(p => p.type === 'structured-output').data",{"type":73,"value":7397}," is typed as ",{"type":67,"tag":92,"props":7399,"children":7401},{"className":7400},[],[7402],{"type":73,"value":6111},{"type":73,"value":7404}," (no cast, no ",{"type":67,"tag":92,"props":7406,"children":7408},{"className":7407},[],[7409],{"type":73,"value":7410},"unknown",{"type":73,"value":7412},"). Works because ",{"type":67,"tag":92,"props":7414,"children":7416},{"className":7415},[],[7417],{"type":73,"value":7418},"useChat\u003CTSchema>",{"type":73,"value":7420}," threads ",{"type":67,"tag":92,"props":7422,"children":7424},{"className":7423},[],[7425],{"type":73,"value":7426},"InferSchemaType\u003CTSchema>",{"type":73,"value":7428}," down through ",{"type":67,"tag":92,"props":7430,"children":7432},{"className":7431},[],[7433],{"type":73,"value":7434},"UIMessage\u003CTTools, TData>",{"type":73,"value":7436}," → ",{"type":67,"tag":92,"props":7438,"children":7440},{"className":7439},[],[7441],{"type":73,"value":7442},"MessagePart\u003CTTools, TData>",{"type":73,"value":7436},{"type":67,"tag":92,"props":7445,"children":7447},{"className":7446},[],[7448],{"type":73,"value":7449},"StructuredOutputPart\u003CTData>",{"type":73,"value":7451},". ",{"type":67,"tag":84,"props":7453,"children":7454},{},[7455,7457,7462],{"type":73,"value":7456},"In ",{"type":67,"tag":92,"props":7458,"children":7460},{"className":7459},[],[7461],{"type":73,"value":161},{"type":73,"value":7463}," core",{"type":73,"value":7465}," the message types are single-generic (",{"type":67,"tag":92,"props":7467,"children":7469},{"className":7468},[],[7470],{"type":73,"value":7471},"UIMessage\u003CTData>",{"type":73,"value":7473},"); the tools generic lives in ",{"type":67,"tag":92,"props":7475,"children":7477},{"className":7476},[],[7478],{"type":73,"value":5691},{"type":73,"value":7480}," and the framework hook packages — import from your framework package or ",{"type":67,"tag":92,"props":7482,"children":7484},{"className":7483},[],[7485],{"type":73,"value":7486},"ai-client",{"type":73,"value":7488},", not from ",{"type":67,"tag":92,"props":7490,"children":7492},{"className":7491},[],[7493],{"type":73,"value":161},{"type":73,"value":446},{"type":67,"tag":5469,"props":7496,"children":7497},{},[7498,7514,7516,7521,7523,7528,7530,7535,7537,7542,7544,7549,7550,7555,7556,7562],{"type":67,"tag":84,"props":7499,"children":7500},{},[7501,7506,7507,7512],{"type":67,"tag":92,"props":7502,"children":7504},{"className":7503},[],[7505],{"type":73,"value":3968},{"type":73,"value":3875},{"type":67,"tag":92,"props":7508,"children":7510},{"className":7509},[],[7511],{"type":73,"value":3976},{"type":73,"value":7513}," are derived.",{"type":73,"value":7515}," The hook-level ",{"type":67,"tag":92,"props":7517,"children":7519},{"className":7518},[],[7520],{"type":73,"value":3968},{"type":73,"value":7522}," and ",{"type":67,"tag":92,"props":7524,"children":7526},{"className":7525},[],[7527],{"type":73,"value":3976},{"type":73,"value":7529}," are NOT singleton state — they're derived from the latest assistant message's part (the one after the most recent user message). Between ",{"type":67,"tag":92,"props":7531,"children":7533},{"className":7532},[],[7534],{"type":73,"value":7362},{"type":73,"value":7536}," and the first chunk, ",{"type":67,"tag":92,"props":7538,"children":7540},{"className":7539},[],[7541],{"type":73,"value":3968},{"type":73,"value":7543}," reads ",{"type":67,"tag":92,"props":7545,"children":7547},{"className":7546},[],[7548],{"type":73,"value":7240},{"type":73,"value":7522},{"type":67,"tag":92,"props":7551,"children":7553},{"className":7552},[],[7554],{"type":73,"value":3976},{"type":73,"value":7543},{"type":67,"tag":92,"props":7557,"children":7559},{"className":7558},[],[7560],{"type":73,"value":7561},"null",{"type":73,"value":7563}," because no new assistant turn exists yet.",{"type":67,"tag":5469,"props":7565,"children":7566},{},[7567,7572,7574,7579,7581,7587],{"type":67,"tag":84,"props":7568,"children":7569},{},[7570],{"type":73,"value":7571},"Round-trip preserves history.",{"type":73,"value":7573}," When the client sends turn N+1, each prior assistant turn's ",{"type":67,"tag":92,"props":7575,"children":7577},{"className":7576},[],[7578],{"type":73,"value":6787},{"type":73,"value":7580}," part is serialized back as ",{"type":67,"tag":92,"props":7582,"children":7584},{"className":7583},[],[7585],{"type":73,"value":7586},"{ role: 'assistant', content: \u003Cpart.raw> }",{"type":73,"value":7588}," so the model sees its own prior structured response. Streaming \u002F errored parts are dropped from the round-trip.",{"type":67,"tag":101,"props":7590,"children":7592},{"id":7591},"common-mistakes",[7593],{"type":73,"value":7594},"Common Mistakes",{"type":67,"tag":820,"props":7596,"children":7598},{"id":7597},"high-filtering-textparts-out-of-usechat-renderers-when-using-outputschema",[7599,7601,7607,7609,7614,7616],{"type":73,"value":7600},"HIGH: Filtering ",{"type":67,"tag":92,"props":7602,"children":7604},{"className":7603},[],[7605],{"type":73,"value":7606},"TextPart",{"type":73,"value":7608},"s out of ",{"type":67,"tag":92,"props":7610,"children":7612},{"className":7611},[],[7613],{"type":73,"value":97},{"type":73,"value":7615}," renderers when using ",{"type":67,"tag":92,"props":7617,"children":7619},{"className":7618},[],[7620],{"type":73,"value":624},{"type":67,"tag":80,"props":7622,"children":7623},{},[7624,7626,7631],{"type":73,"value":7625},"Earlier versions of the library routed structured-output JSON deltas through ",{"type":67,"tag":92,"props":7627,"children":7629},{"className":7628},[],[7630],{"type":73,"value":7606},{"type":73,"value":7632},", so renderers had to filter them out:",{"type":67,"tag":108,"props":7634,"children":7636},{"className":4571,"code":7635,"language":4573,"meta":112,"style":112},"\u002F\u002F OBSOLETE — this guard was needed only because JSON used to land in a TextPart\nconst last = messages.at(-1)\nlast?.parts.map((part) => {\n  if (part.type === 'text') return null \u002F\u002F ❌ hides the structured JSON\n  \u002F\u002F ...\n})\n",[7637],{"type":67,"tag":92,"props":7638,"children":7639},{"__ignoreMap":112},[7640,7648,7695,7743,7800,7808],{"type":67,"tag":118,"props":7641,"children":7642},{"class":120,"line":121},[7643],{"type":67,"tag":118,"props":7644,"children":7645},{"style":588},[7646],{"type":73,"value":7647},"\u002F\u002F OBSOLETE — this guard was needed only because JSON used to land in a TextPart\n",{"type":67,"tag":118,"props":7649,"children":7650},{"class":120,"line":169},[7651,7655,7660,7664,7668,7672,7677,7681,7686,7691],{"type":67,"tag":118,"props":7652,"children":7653},{"style":259},[7654],{"type":73,"value":262},{"type":67,"tag":118,"props":7656,"children":7657},{"style":137},[7658],{"type":73,"value":7659}," last ",{"type":67,"tag":118,"props":7661,"children":7662},{"style":131},[7663],{"type":73,"value":272},{"type":67,"tag":118,"props":7665,"children":7666},{"style":137},[7667],{"type":73,"value":4367},{"type":67,"tag":118,"props":7669,"children":7670},{"style":131},[7671],{"type":73,"value":446},{"type":67,"tag":118,"props":7673,"children":7674},{"style":280},[7675],{"type":73,"value":7676},"at",{"type":67,"tag":118,"props":7678,"children":7679},{"style":137},[7680],{"type":73,"value":287},{"type":67,"tag":118,"props":7682,"children":7683},{"style":131},[7684],{"type":73,"value":7685},"-",{"type":67,"tag":118,"props":7687,"children":7688},{"style":2687},[7689],{"type":73,"value":7690},"1",{"type":67,"tag":118,"props":7692,"children":7693},{"style":137},[7694],{"type":73,"value":559},{"type":67,"tag":118,"props":7696,"children":7697},{"class":120,"line":207},[7698,7703,7707,7711,7715,7719,7723,7727,7731,7735,7739],{"type":67,"tag":118,"props":7699,"children":7700},{"style":137},[7701],{"type":73,"value":7702},"last",{"type":67,"tag":118,"props":7704,"children":7705},{"style":131},[7706],{"type":73,"value":2737},{"type":67,"tag":118,"props":7708,"children":7709},{"style":137},[7710],{"type":73,"value":6715},{"type":67,"tag":118,"props":7712,"children":7713},{"style":131},[7714],{"type":73,"value":446},{"type":67,"tag":118,"props":7716,"children":7717},{"style":280},[7718],{"type":73,"value":6309},{"type":67,"tag":118,"props":7720,"children":7721},{"style":137},[7722],{"type":73,"value":287},{"type":67,"tag":118,"props":7724,"children":7725},{"style":131},[7726],{"type":73,"value":287},{"type":67,"tag":118,"props":7728,"children":7729},{"style":4328},[7730],{"type":73,"value":6825},{"type":67,"tag":118,"props":7732,"children":7733},{"style":131},[7734],{"type":73,"value":334},{"type":67,"tag":118,"props":7736,"children":7737},{"style":259},[7738],{"type":73,"value":5068},{"type":67,"tag":118,"props":7740,"children":7741},{"style":131},[7742],{"type":73,"value":4350},{"type":67,"tag":118,"props":7744,"children":7745},{"class":120,"line":245},[7746,7750,7754,7758,7762,7766,7770,7774,7778,7782,7786,7790,7795],{"type":67,"tag":118,"props":7747,"children":7748},{"style":125},[7749],{"type":73,"value":3302},{"type":67,"tag":118,"props":7751,"children":7752},{"style":299},[7753],{"type":73,"value":3271},{"type":67,"tag":118,"props":7755,"children":7756},{"style":137},[7757],{"type":73,"value":6825},{"type":67,"tag":118,"props":7759,"children":7760},{"style":131},[7761],{"type":73,"value":446},{"type":67,"tag":118,"props":7763,"children":7764},{"style":137},[7765],{"type":73,"value":3320},{"type":67,"tag":118,"props":7767,"children":7768},{"style":131},[7769],{"type":73,"value":3325},{"type":67,"tag":118,"props":7771,"children":7772},{"style":131},[7773],{"type":73,"value":155},{"type":67,"tag":118,"props":7775,"children":7776},{"style":158},[7777],{"type":73,"value":73},{"type":67,"tag":118,"props":7779,"children":7780},{"style":131},[7781],{"type":73,"value":320},{"type":67,"tag":118,"props":7783,"children":7784},{"style":299},[7785],{"type":73,"value":3379},{"type":67,"tag":118,"props":7787,"children":7788},{"style":125},[7789],{"type":73,"value":6834},{"type":67,"tag":118,"props":7791,"children":7792},{"style":131},[7793],{"type":73,"value":7794}," null",{"type":67,"tag":118,"props":7796,"children":7797},{"style":588},[7798],{"type":73,"value":7799}," \u002F\u002F ❌ hides the structured JSON\n",{"type":67,"tag":118,"props":7801,"children":7802},{"class":120,"line":255},[7803],{"type":67,"tag":118,"props":7804,"children":7805},{"style":588},[7806],{"type":73,"value":7807},"  \u002F\u002F ...\n",{"type":67,"tag":118,"props":7809,"children":7810},{"class":120,"line":295},[7811,7815],{"type":67,"tag":118,"props":7812,"children":7813},{"style":131},[7814],{"type":73,"value":554},{"type":67,"tag":118,"props":7816,"children":7817},{"style":137},[7818],{"type":73,"value":559},{"type":67,"tag":80,"props":7820,"children":7821},{},[7822,7824,7829,7831,7836,7838,7843,7845,7850,7852,7858,7860,7865,7866,7871,7872,7878,7880,7886,7888,7893],{"type":73,"value":7823},"That hack is ",{"type":67,"tag":84,"props":7825,"children":7826},{},[7827],{"type":73,"value":7828},"gone",{"type":73,"value":7830},". With ",{"type":67,"tag":92,"props":7832,"children":7834},{"className":7833},[],[7835],{"type":73,"value":624},{"type":73,"value":7837}," set, ",{"type":67,"tag":92,"props":7839,"children":7841},{"className":7840},[],[7842],{"type":73,"value":5492},{"type":73,"value":7844}," deltas now route into a dedicated ",{"type":67,"tag":92,"props":7846,"children":7848},{"className":7847},[],[7849],{"type":73,"value":5593},{"type":73,"value":7851}," (with ",{"type":67,"tag":92,"props":7853,"children":7855},{"className":7854},[],[7856],{"type":73,"value":7857},"raw",{"type":73,"value":7859},", ",{"type":67,"tag":92,"props":7861,"children":7863},{"className":7862},[],[7864],{"type":73,"value":3968},{"type":73,"value":7859},{"type":67,"tag":92,"props":7867,"children":7869},{"className":7868},[],[7870],{"type":73,"value":7210},{"type":73,"value":7859},{"type":67,"tag":92,"props":7873,"children":7875},{"className":7874},[],[7876],{"type":73,"value":7877},"status",{"type":73,"value":7879},", optional ",{"type":67,"tag":92,"props":7881,"children":7883},{"className":7882},[],[7884],{"type":73,"value":7885},"errorMessage",{"type":73,"value":7887},"). Render the structured part directly; let real ",{"type":67,"tag":92,"props":7889,"children":7891},{"className":7890},[],[7892],{"type":73,"value":7606},{"type":73,"value":7894},"s through.",{"type":67,"tag":108,"props":7896,"children":7898},{"className":4571,"code":7897,"language":4573,"meta":112,"style":112},"\u002F\u002F CORRECT — find the structured-output part directly; let actual TextParts render\nlast?.parts.map((part, i) => {\n  if (part.type === 'thinking')\n    return \u003CReasoningView key={i} text={part.content} \u002F>\n  if (part.type === 'tool-call') return \u003CToolCallView key={i} part={part} \u002F>\n  if (part.type === 'structured-output')\n    return \u003CRecipeCard key={i} part={part} \u002F>\n  if (part.type === 'text') return \u003Cp key={i}>{part.content}\u003C\u002Fp> \u002F\u002F ← real text, not JSON\n  return null\n})\n",[7899],{"type":67,"tag":92,"props":7900,"children":7901},{"__ignoreMap":112},[7902,7910,7966,8010,8068,8157,8200,8247,8348,8359],{"type":67,"tag":118,"props":7903,"children":7904},{"class":120,"line":121},[7905],{"type":67,"tag":118,"props":7906,"children":7907},{"style":588},[7908],{"type":73,"value":7909},"\u002F\u002F CORRECT — find the structured-output part directly; let actual TextParts render\n",{"type":67,"tag":118,"props":7911,"children":7912},{"class":120,"line":169},[7913,7917,7921,7925,7929,7933,7937,7941,7945,7949,7954,7958,7962],{"type":67,"tag":118,"props":7914,"children":7915},{"style":137},[7916],{"type":73,"value":7702},{"type":67,"tag":118,"props":7918,"children":7919},{"style":131},[7920],{"type":73,"value":2737},{"type":67,"tag":118,"props":7922,"children":7923},{"style":137},[7924],{"type":73,"value":6715},{"type":67,"tag":118,"props":7926,"children":7927},{"style":131},[7928],{"type":73,"value":446},{"type":67,"tag":118,"props":7930,"children":7931},{"style":280},[7932],{"type":73,"value":6309},{"type":67,"tag":118,"props":7934,"children":7935},{"style":137},[7936],{"type":73,"value":287},{"type":67,"tag":118,"props":7938,"children":7939},{"style":131},[7940],{"type":73,"value":287},{"type":67,"tag":118,"props":7942,"children":7943},{"style":4328},[7944],{"type":73,"value":6825},{"type":67,"tag":118,"props":7946,"children":7947},{"style":131},[7948],{"type":73,"value":389},{"type":67,"tag":118,"props":7950,"children":7951},{"style":4328},[7952],{"type":73,"value":7953}," i",{"type":67,"tag":118,"props":7955,"children":7956},{"style":131},[7957],{"type":73,"value":334},{"type":67,"tag":118,"props":7959,"children":7960},{"style":259},[7961],{"type":73,"value":5068},{"type":67,"tag":118,"props":7963,"children":7964},{"style":131},[7965],{"type":73,"value":4350},{"type":67,"tag":118,"props":7967,"children":7968},{"class":120,"line":207},[7969,7973,7977,7981,7985,7989,7993,7997,8002,8006],{"type":67,"tag":118,"props":7970,"children":7971},{"style":125},[7972],{"type":73,"value":3302},{"type":67,"tag":118,"props":7974,"children":7975},{"style":299},[7976],{"type":73,"value":3271},{"type":67,"tag":118,"props":7978,"children":7979},{"style":137},[7980],{"type":73,"value":6825},{"type":67,"tag":118,"props":7982,"children":7983},{"style":131},[7984],{"type":73,"value":446},{"type":67,"tag":118,"props":7986,"children":7987},{"style":137},[7988],{"type":73,"value":3320},{"type":67,"tag":118,"props":7990,"children":7991},{"style":131},[7992],{"type":73,"value":3325},{"type":67,"tag":118,"props":7994,"children":7995},{"style":131},[7996],{"type":73,"value":155},{"type":67,"tag":118,"props":7998,"children":7999},{"style":158},[8000],{"type":73,"value":8001},"thinking",{"type":67,"tag":118,"props":8003,"children":8004},{"style":131},[8005],{"type":73,"value":320},{"type":67,"tag":118,"props":8007,"children":8008},{"style":299},[8009],{"type":73,"value":559},{"type":67,"tag":118,"props":8011,"children":8012},{"class":120,"line":245},[8013,8018,8022,8027,8031,8035,8040,8044,8048,8052,8056,8060,8064],{"type":67,"tag":118,"props":8014,"children":8015},{"style":125},[8016],{"type":73,"value":8017},"    return",{"type":67,"tag":118,"props":8019,"children":8020},{"style":131},[8021],{"type":73,"value":5366},{"type":67,"tag":118,"props":8023,"children":8024},{"style":4338},[8025],{"type":73,"value":8026},"ReasoningView",{"type":67,"tag":118,"props":8028,"children":8029},{"style":259},[8030],{"type":73,"value":6575},{"type":67,"tag":118,"props":8032,"children":8033},{"style":131},[8034],{"type":73,"value":5041},{"type":67,"tag":118,"props":8036,"children":8037},{"style":137},[8038],{"type":73,"value":8039},"i",{"type":67,"tag":118,"props":8041,"children":8042},{"style":131},[8043],{"type":73,"value":6597},{"type":67,"tag":118,"props":8045,"children":8046},{"style":259},[8047],{"type":73,"value":73},{"type":67,"tag":118,"props":8049,"children":8050},{"style":131},[8051],{"type":73,"value":5041},{"type":67,"tag":118,"props":8053,"children":8054},{"style":137},[8055],{"type":73,"value":6825},{"type":67,"tag":118,"props":8057,"children":8058},{"style":131},[8059],{"type":73,"value":446},{"type":67,"tag":118,"props":8061,"children":8062},{"style":137},[8063],{"type":73,"value":6524},{"type":67,"tag":118,"props":8065,"children":8066},{"style":131},[8067],{"type":73,"value":6614},{"type":67,"tag":118,"props":8069,"children":8070},{"class":120,"line":255},[8071,8075,8079,8083,8087,8091,8095,8099,8104,8108,8112,8116,8120,8125,8129,8133,8137,8141,8145,8149,8153],{"type":67,"tag":118,"props":8072,"children":8073},{"style":125},[8074],{"type":73,"value":3302},{"type":67,"tag":118,"props":8076,"children":8077},{"style":299},[8078],{"type":73,"value":3271},{"type":67,"tag":118,"props":8080,"children":8081},{"style":137},[8082],{"type":73,"value":6825},{"type":67,"tag":118,"props":8084,"children":8085},{"style":131},[8086],{"type":73,"value":446},{"type":67,"tag":118,"props":8088,"children":8089},{"style":137},[8090],{"type":73,"value":3320},{"type":67,"tag":118,"props":8092,"children":8093},{"style":131},[8094],{"type":73,"value":3325},{"type":67,"tag":118,"props":8096,"children":8097},{"style":131},[8098],{"type":73,"value":155},{"type":67,"tag":118,"props":8100,"children":8101},{"style":158},[8102],{"type":73,"value":8103},"tool-call",{"type":67,"tag":118,"props":8105,"children":8106},{"style":131},[8107],{"type":73,"value":320},{"type":67,"tag":118,"props":8109,"children":8110},{"style":299},[8111],{"type":73,"value":3379},{"type":67,"tag":118,"props":8113,"children":8114},{"style":125},[8115],{"type":73,"value":6834},{"type":67,"tag":118,"props":8117,"children":8118},{"style":131},[8119],{"type":73,"value":5366},{"type":67,"tag":118,"props":8121,"children":8122},{"style":4338},[8123],{"type":73,"value":8124},"ToolCallView",{"type":67,"tag":118,"props":8126,"children":8127},{"style":259},[8128],{"type":73,"value":6575},{"type":67,"tag":118,"props":8130,"children":8131},{"style":131},[8132],{"type":73,"value":5041},{"type":67,"tag":118,"props":8134,"children":8135},{"style":137},[8136],{"type":73,"value":8039},{"type":67,"tag":118,"props":8138,"children":8139},{"style":131},[8140],{"type":73,"value":6597},{"type":67,"tag":118,"props":8142,"children":8143},{"style":259},[8144],{"type":73,"value":6825},{"type":67,"tag":118,"props":8146,"children":8147},{"style":131},[8148],{"type":73,"value":5041},{"type":67,"tag":118,"props":8150,"children":8151},{"style":137},[8152],{"type":73,"value":6825},{"type":67,"tag":118,"props":8154,"children":8155},{"style":131},[8156],{"type":73,"value":6614},{"type":67,"tag":118,"props":8158,"children":8159},{"class":120,"line":295},[8160,8164,8168,8172,8176,8180,8184,8188,8192,8196],{"type":67,"tag":118,"props":8161,"children":8162},{"style":125},[8163],{"type":73,"value":3302},{"type":67,"tag":118,"props":8165,"children":8166},{"style":299},[8167],{"type":73,"value":3271},{"type":67,"tag":118,"props":8169,"children":8170},{"style":137},[8171],{"type":73,"value":6825},{"type":67,"tag":118,"props":8173,"children":8174},{"style":131},[8175],{"type":73,"value":446},{"type":67,"tag":118,"props":8177,"children":8178},{"style":137},[8179],{"type":73,"value":3320},{"type":67,"tag":118,"props":8181,"children":8182},{"style":131},[8183],{"type":73,"value":3325},{"type":67,"tag":118,"props":8185,"children":8186},{"style":131},[8187],{"type":73,"value":155},{"type":67,"tag":118,"props":8189,"children":8190},{"style":158},[8191],{"type":73,"value":6787},{"type":67,"tag":118,"props":8193,"children":8194},{"style":131},[8195],{"type":73,"value":320},{"type":67,"tag":118,"props":8197,"children":8198},{"style":299},[8199],{"type":73,"value":559},{"type":67,"tag":118,"props":8201,"children":8202},{"class":120,"line":342},[8203,8207,8211,8215,8219,8223,8227,8231,8235,8239,8243],{"type":67,"tag":118,"props":8204,"children":8205},{"style":125},[8206],{"type":73,"value":8017},{"type":67,"tag":118,"props":8208,"children":8209},{"style":131},[8210],{"type":73,"value":5366},{"type":67,"tag":118,"props":8212,"children":8213},{"style":4338},[8214],{"type":73,"value":6855},{"type":67,"tag":118,"props":8216,"children":8217},{"style":259},[8218],{"type":73,"value":6575},{"type":67,"tag":118,"props":8220,"children":8221},{"style":131},[8222],{"type":73,"value":5041},{"type":67,"tag":118,"props":8224,"children":8225},{"style":137},[8226],{"type":73,"value":8039},{"type":67,"tag":118,"props":8228,"children":8229},{"style":131},[8230],{"type":73,"value":6597},{"type":67,"tag":118,"props":8232,"children":8233},{"style":259},[8234],{"type":73,"value":6825},{"type":67,"tag":118,"props":8236,"children":8237},{"style":131},[8238],{"type":73,"value":5041},{"type":67,"tag":118,"props":8240,"children":8241},{"style":137},[8242],{"type":73,"value":6825},{"type":67,"tag":118,"props":8244,"children":8245},{"style":131},[8246],{"type":73,"value":6614},{"type":67,"tag":118,"props":8248,"children":8249},{"class":120,"line":427},[8250,8254,8258,8262,8266,8270,8274,8278,8282,8286,8290,8294,8298,8302,8306,8310,8314,8319,8323,8327,8331,8335,8339,8343],{"type":67,"tag":118,"props":8251,"children":8252},{"style":125},[8253],{"type":73,"value":3302},{"type":67,"tag":118,"props":8255,"children":8256},{"style":299},[8257],{"type":73,"value":3271},{"type":67,"tag":118,"props":8259,"children":8260},{"style":137},[8261],{"type":73,"value":6825},{"type":67,"tag":118,"props":8263,"children":8264},{"style":131},[8265],{"type":73,"value":446},{"type":67,"tag":118,"props":8267,"children":8268},{"style":137},[8269],{"type":73,"value":3320},{"type":67,"tag":118,"props":8271,"children":8272},{"style":131},[8273],{"type":73,"value":3325},{"type":67,"tag":118,"props":8275,"children":8276},{"style":131},[8277],{"type":73,"value":155},{"type":67,"tag":118,"props":8279,"children":8280},{"style":158},[8281],{"type":73,"value":73},{"type":67,"tag":118,"props":8283,"children":8284},{"style":131},[8285],{"type":73,"value":320},{"type":67,"tag":118,"props":8287,"children":8288},{"style":299},[8289],{"type":73,"value":3379},{"type":67,"tag":118,"props":8291,"children":8292},{"style":125},[8293],{"type":73,"value":6834},{"type":67,"tag":118,"props":8295,"children":8296},{"style":131},[8297],{"type":73,"value":5366},{"type":67,"tag":118,"props":8299,"children":8300},{"style":299},[8301],{"type":73,"value":80},{"type":67,"tag":118,"props":8303,"children":8304},{"style":259},[8305],{"type":73,"value":6575},{"type":67,"tag":118,"props":8307,"children":8308},{"style":131},[8309],{"type":73,"value":5041},{"type":67,"tag":118,"props":8311,"children":8312},{"style":137},[8313],{"type":73,"value":8039},{"type":67,"tag":118,"props":8315,"children":8316},{"style":131},[8317],{"type":73,"value":8318},"}>{",{"type":67,"tag":118,"props":8320,"children":8321},{"style":137},[8322],{"type":73,"value":6825},{"type":67,"tag":118,"props":8324,"children":8325},{"style":131},[8326],{"type":73,"value":446},{"type":67,"tag":118,"props":8328,"children":8329},{"style":137},[8330],{"type":73,"value":6524},{"type":67,"tag":118,"props":8332,"children":8333},{"style":131},[8334],{"type":73,"value":5207},{"type":67,"tag":118,"props":8336,"children":8337},{"style":299},[8338],{"type":73,"value":80},{"type":67,"tag":118,"props":8340,"children":8341},{"style":131},[8342],{"type":73,"value":5163},{"type":67,"tag":118,"props":8344,"children":8345},{"style":588},[8346],{"type":73,"value":8347}," \u002F\u002F ← real text, not JSON\n",{"type":67,"tag":118,"props":8349,"children":8350},{"class":120,"line":462},[8351,8355],{"type":67,"tag":118,"props":8352,"children":8353},{"style":125},[8354],{"type":73,"value":4536},{"type":67,"tag":118,"props":8356,"children":8357},{"style":131},[8358],{"type":73,"value":6839},{"type":67,"tag":118,"props":8360,"children":8361},{"class":120,"line":497},[8362,8366],{"type":67,"tag":118,"props":8363,"children":8364},{"style":131},[8365],{"type":73,"value":554},{"type":67,"tag":118,"props":8367,"children":8368},{"style":137},[8369],{"type":73,"value":559},{"type":67,"tag":80,"props":8371,"children":8372},{},[8373,8375,8381],{"type":73,"value":8374},"If you still have an ",{"type":67,"tag":92,"props":8376,"children":8378},{"className":8377},[],[8379],{"type":73,"value":8380},"if (part.type === 'text') return null",{"type":73,"value":8382}," line in a structured-output renderer specifically for \"hiding the JSON,\" delete it.",{"type":67,"tag":80,"props":8384,"children":8385},{},[8386],{"type":73,"value":8387},"Source: PR #577 — structured-output became a typed UIMessage part.",{"type":67,"tag":820,"props":8389,"children":8391},{"id":8390},"high-treating-partial-final-as-sticky-state-across-turns",[8392,8394,8399,8400,8405],{"type":73,"value":8393},"HIGH: Treating ",{"type":67,"tag":92,"props":8395,"children":8397},{"className":8396},[],[8398],{"type":73,"value":3968},{"type":73,"value":3875},{"type":67,"tag":92,"props":8401,"children":8403},{"className":8402},[],[8404],{"type":73,"value":3976},{"type":73,"value":8406}," as sticky state across turns",{"type":67,"tag":80,"props":8408,"children":8409},{},[8410,8415,8416,8421,8423,8434],{"type":67,"tag":92,"props":8411,"children":8413},{"className":8412},[],[8414],{"type":73,"value":3968},{"type":73,"value":7522},{"type":67,"tag":92,"props":8417,"children":8419},{"className":8418},[],[8420],{"type":73,"value":3976},{"type":73,"value":8422}," are ",{"type":67,"tag":84,"props":8424,"children":8425},{},[8426,8428,8433],{"type":73,"value":8427},"derived from the latest assistant message's ",{"type":67,"tag":92,"props":8429,"children":8431},{"className":8430},[],[8432],{"type":73,"value":6787},{"type":73,"value":6698},{"type":73,"value":8435},", not a sticky hook-level slot. In a multi-turn chat:",{"type":67,"tag":5465,"props":8437,"children":8438},{},[8439,8475],{"type":67,"tag":5469,"props":8440,"children":8441},{},[8442,8444,8449,8450,8455,8456,8461,8462,8467,8468,8473],{"type":73,"value":8443},"Between ",{"type":67,"tag":92,"props":8445,"children":8447},{"className":8446},[],[8448],{"type":73,"value":7362},{"type":73,"value":7536},{"type":67,"tag":92,"props":8451,"children":8453},{"className":8452},[],[8454],{"type":73,"value":3968},{"type":73,"value":7543},{"type":67,"tag":92,"props":8457,"children":8459},{"className":8458},[],[8460],{"type":73,"value":7240},{"type":73,"value":7522},{"type":67,"tag":92,"props":8463,"children":8465},{"className":8464},[],[8466],{"type":73,"value":3976},{"type":73,"value":7543},{"type":67,"tag":92,"props":8469,"children":8471},{"className":8470},[],[8472],{"type":73,"value":7561},{"type":73,"value":8474}," (no assistant message after the latest user yet).",{"type":67,"tag":5469,"props":8476,"children":8477},{},[8478,8480,8486,8488,8493,8494,8499],{"type":73,"value":8479},"Once the latest turn completes, ",{"type":67,"tag":92,"props":8481,"children":8483},{"className":8482},[],[8484],{"type":73,"value":8485},"partial === final",{"type":73,"value":8487},". Earlier turns' data is NOT in ",{"type":67,"tag":92,"props":8489,"children":8491},{"className":8490},[],[8492],{"type":73,"value":3968},{"type":73,"value":3875},{"type":67,"tag":92,"props":8495,"children":8497},{"className":8496},[],[8498],{"type":73,"value":3976},{"type":73,"value":8500}," — it lives on the prior assistant messages' parts.",{"type":67,"tag":80,"props":8502,"children":8503},{},[8504,8506,8511,8513,8518,8519,8524,8526,8531],{"type":73,"value":8505},"To render history, walk ",{"type":67,"tag":92,"props":8507,"children":8509},{"className":8508},[],[8510],{"type":73,"value":6300},{"type":73,"value":8512}," directly (see Pattern 5). Use ",{"type":67,"tag":92,"props":8514,"children":8516},{"className":8515},[],[8517],{"type":73,"value":3968},{"type":73,"value":3875},{"type":67,"tag":92,"props":8520,"children":8522},{"className":8521},[],[8523],{"type":73,"value":3976},{"type":73,"value":8525}," for a sticky summary of the ",{"type":67,"tag":84,"props":8527,"children":8528},{},[8529],{"type":73,"value":8530},"most recent",{"type":73,"value":8532}," turn only.",{"type":67,"tag":108,"props":8534,"children":8536},{"className":4571,"code":8535,"language":4573,"meta":112,"style":112},"\u002F\u002F WRONG — `final` only reflects the latest turn; earlier recipes vanish from this view\n{final && \u003CRecipeCard recipe={final} \u002F>}\n\n\u002F\u002F CORRECT for history — walk messages, render every assistant's structured-output part\n{messages.map((m) =>\n  m.role === 'assistant'\n    ? m.parts.find((p) => p.type === 'structured-output')\n      ? \u003CRecipeCard key={m.id} part={...} \u002F>\n      : null\n    : null\n)}\n",[8537],{"type":67,"tag":92,"props":8538,"children":8539},{"__ignoreMap":112},[8540,8548,8588,8595,8603,8643,8675,8755,8804,8816,8828],{"type":67,"tag":118,"props":8541,"children":8542},{"class":120,"line":121},[8543],{"type":67,"tag":118,"props":8544,"children":8545},{"style":588},[8546],{"type":73,"value":8547},"\u002F\u002F WRONG — `final` only reflects the latest turn; earlier recipes vanish from this view\n",{"type":67,"tag":118,"props":8549,"children":8550},{"class":120,"line":169},[8551,8555,8559,8563,8567,8571,8575,8579,8583],{"type":67,"tag":118,"props":8552,"children":8553},{"style":131},[8554],{"type":73,"value":362},{"type":67,"tag":118,"props":8556,"children":8557},{"style":137},[8558],{"type":73,"value":3976},{"type":67,"tag":118,"props":8560,"children":8561},{"style":131},[8562],{"type":73,"value":3343},{"type":67,"tag":118,"props":8564,"children":8565},{"style":131},[8566],{"type":73,"value":5366},{"type":67,"tag":118,"props":8568,"children":8569},{"style":4338},[8570],{"type":73,"value":6855},{"type":67,"tag":118,"props":8572,"children":8573},{"style":259},[8574],{"type":73,"value":7193},{"type":67,"tag":118,"props":8576,"children":8577},{"style":131},[8578],{"type":73,"value":5041},{"type":67,"tag":118,"props":8580,"children":8581},{"style":137},[8582],{"type":73,"value":3976},{"type":67,"tag":118,"props":8584,"children":8585},{"style":131},[8586],{"type":73,"value":8587},"} \u002F>}\n",{"type":67,"tag":118,"props":8589,"children":8590},{"class":120,"line":207},[8591],{"type":67,"tag":118,"props":8592,"children":8593},{"emptyLinePlaceholder":249},[8594],{"type":73,"value":252},{"type":67,"tag":118,"props":8596,"children":8597},{"class":120,"line":245},[8598],{"type":67,"tag":118,"props":8599,"children":8600},{"style":588},[8601],{"type":73,"value":8602},"\u002F\u002F CORRECT for history — walk messages, render every assistant's structured-output part\n",{"type":67,"tag":118,"props":8604,"children":8605},{"class":120,"line":255},[8606,8610,8614,8618,8622,8626,8630,8634,8638],{"type":67,"tag":118,"props":8607,"children":8608},{"style":131},[8609],{"type":73,"value":362},{"type":67,"tag":118,"props":8611,"children":8612},{"style":137},[8613],{"type":73,"value":6300},{"type":67,"tag":118,"props":8615,"children":8616},{"style":131},[8617],{"type":73,"value":446},{"type":67,"tag":118,"props":8619,"children":8620},{"style":280},[8621],{"type":73,"value":6309},{"type":67,"tag":118,"props":8623,"children":8624},{"style":299},[8625],{"type":73,"value":287},{"type":67,"tag":118,"props":8627,"children":8628},{"style":131},[8629],{"type":73,"value":287},{"type":67,"tag":118,"props":8631,"children":8632},{"style":4328},[8633],{"type":73,"value":6322},{"type":67,"tag":118,"props":8635,"children":8636},{"style":131},[8637],{"type":73,"value":334},{"type":67,"tag":118,"props":8639,"children":8640},{"style":259},[8641],{"type":73,"value":8642}," =>\n",{"type":67,"tag":118,"props":8644,"children":8645},{"class":120,"line":295},[8646,8651,8655,8659,8663,8667,8671],{"type":67,"tag":118,"props":8647,"children":8648},{"style":137},[8649],{"type":73,"value":8650},"  m",{"type":67,"tag":118,"props":8652,"children":8653},{"style":131},[8654],{"type":73,"value":446},{"type":67,"tag":118,"props":8656,"children":8657},{"style":137},[8658],{"type":73,"value":6359},{"type":67,"tag":118,"props":8660,"children":8661},{"style":131},[8662],{"type":73,"value":3325},{"type":67,"tag":118,"props":8664,"children":8665},{"style":131},[8666],{"type":73,"value":155},{"type":67,"tag":118,"props":8668,"children":8669},{"style":158},[8670],{"type":73,"value":6658},{"type":67,"tag":118,"props":8672,"children":8673},{"style":131},[8674],{"type":73,"value":166},{"type":67,"tag":118,"props":8676,"children":8677},{"class":120,"line":342},[8678,8683,8687,8691,8695,8699,8703,8707,8711,8715,8719,8723,8727,8731,8735,8739,8743,8747,8751],{"type":67,"tag":118,"props":8679,"children":8680},{"style":131},[8681],{"type":73,"value":8682},"    ?",{"type":67,"tag":118,"props":8684,"children":8685},{"style":137},[8686],{"type":73,"value":6405},{"type":67,"tag":118,"props":8688,"children":8689},{"style":131},[8690],{"type":73,"value":446},{"type":67,"tag":118,"props":8692,"children":8693},{"style":137},[8694],{"type":73,"value":6715},{"type":67,"tag":118,"props":8696,"children":8697},{"style":131},[8698],{"type":73,"value":446},{"type":67,"tag":118,"props":8700,"children":8701},{"style":280},[8702],{"type":73,"value":6724},{"type":67,"tag":118,"props":8704,"children":8705},{"style":299},[8706],{"type":73,"value":287},{"type":67,"tag":118,"props":8708,"children":8709},{"style":131},[8710],{"type":73,"value":287},{"type":67,"tag":118,"props":8712,"children":8713},{"style":4328},[8714],{"type":73,"value":80},{"type":67,"tag":118,"props":8716,"children":8717},{"style":131},[8718],{"type":73,"value":334},{"type":67,"tag":118,"props":8720,"children":8721},{"style":259},[8722],{"type":73,"value":5068},{"type":67,"tag":118,"props":8724,"children":8725},{"style":137},[8726],{"type":73,"value":6452},{"type":67,"tag":118,"props":8728,"children":8729},{"style":131},[8730],{"type":73,"value":446},{"type":67,"tag":118,"props":8732,"children":8733},{"style":137},[8734],{"type":73,"value":3320},{"type":67,"tag":118,"props":8736,"children":8737},{"style":131},[8738],{"type":73,"value":3325},{"type":67,"tag":118,"props":8740,"children":8741},{"style":131},[8742],{"type":73,"value":155},{"type":67,"tag":118,"props":8744,"children":8745},{"style":158},[8746],{"type":73,"value":6787},{"type":67,"tag":118,"props":8748,"children":8749},{"style":131},[8750],{"type":73,"value":320},{"type":67,"tag":118,"props":8752,"children":8753},{"style":299},[8754],{"type":73,"value":559},{"type":67,"tag":118,"props":8756,"children":8757},{"class":120,"line":427},[8758,8763,8767,8771,8775,8779,8783,8787,8791,8795,8799],{"type":67,"tag":118,"props":8759,"children":8760},{"style":131},[8761],{"type":73,"value":8762},"      ?",{"type":67,"tag":118,"props":8764,"children":8765},{"style":131},[8766],{"type":73,"value":5366},{"type":67,"tag":118,"props":8768,"children":8769},{"style":4338},[8770],{"type":73,"value":6855},{"type":67,"tag":118,"props":8772,"children":8773},{"style":259},[8774],{"type":73,"value":6575},{"type":67,"tag":118,"props":8776,"children":8777},{"style":131},[8778],{"type":73,"value":5041},{"type":67,"tag":118,"props":8780,"children":8781},{"style":137},[8782],{"type":73,"value":6322},{"type":67,"tag":118,"props":8784,"children":8785},{"style":131},[8786],{"type":73,"value":446},{"type":67,"tag":118,"props":8788,"children":8789},{"style":137},[8790],{"type":73,"value":6592},{"type":67,"tag":118,"props":8792,"children":8793},{"style":131},[8794],{"type":73,"value":6597},{"type":67,"tag":118,"props":8796,"children":8797},{"style":259},[8798],{"type":73,"value":6825},{"type":67,"tag":118,"props":8800,"children":8801},{"style":131},[8802],{"type":73,"value":8803},"={...} \u002F>\n",{"type":67,"tag":118,"props":8805,"children":8806},{"class":120,"line":462},[8807,8812],{"type":67,"tag":118,"props":8808,"children":8809},{"style":131},[8810],{"type":73,"value":8811},"      :",{"type":67,"tag":118,"props":8813,"children":8814},{"style":131},[8815],{"type":73,"value":6839},{"type":67,"tag":118,"props":8817,"children":8818},{"class":120,"line":497},[8819,8824],{"type":67,"tag":118,"props":8820,"children":8821},{"style":131},[8822],{"type":73,"value":8823},"    :",{"type":67,"tag":118,"props":8825,"children":8826},{"style":131},[8827],{"type":73,"value":6839},{"type":67,"tag":118,"props":8829,"children":8830},{"class":120,"line":531},[8831,8835],{"type":67,"tag":118,"props":8832,"children":8833},{"style":299},[8834],{"type":73,"value":334},{"type":67,"tag":118,"props":8836,"children":8837},{"style":131},[8838],{"type":73,"value":3519},{"type":67,"tag":80,"props":8840,"children":8841},{},[8842],{"type":73,"value":8843},"Source: PR #577 — partial\u002Ffinal derive from the latest assistant turn's part.",{"type":67,"tag":820,"props":8845,"children":8847},{"id":8846},"high-parsing-streaming-json-deltas-yourself",[8848],{"type":73,"value":8849},"HIGH: Parsing streaming JSON deltas yourself",{"type":67,"tag":80,"props":8851,"children":8852},{},[8853,8855,8860,8862,8867,8869,8874,8876,8881],{"type":73,"value":8854},"When iterating ",{"type":67,"tag":92,"props":8856,"children":8858},{"className":8857},[],[8859],{"type":73,"value":3545},{"type":73,"value":8861}," directly (Pattern 3), the ",{"type":67,"tag":92,"props":8863,"children":8865},{"className":8864},[],[8866],{"type":73,"value":5492},{"type":73,"value":8868}," chunks contain ",{"type":67,"tag":8870,"props":8871,"children":8872},"em",{},[8873],{"type":73,"value":3968},{"type":73,"value":8875}," JSON fragments — they are not valid JSON until the stream completes. Always read the validated object from the terminal ",{"type":67,"tag":92,"props":8877,"children":8879},{"className":8878},[],[8880],{"type":73,"value":3370},{"type":73,"value":8882}," event. Validation runs once, on the complete payload.",{"type":67,"tag":108,"props":8884,"children":8886},{"className":110,"code":8885,"language":15,"meta":112,"style":112},"\u002F\u002F WRONG -- partial JSON, throws SyntaxError mid-stream, no schema validation\nfor await (const chunk of stream) {\n  if (chunk.type === 'TEXT_MESSAGE_CONTENT') {\n    const obj = JSON.parse(chunk.delta) \u002F\u002F ❌ partial, invalid\n  }\n}\n\n\u002F\u002F CORRECT -- trust the terminal event\nfor await (const chunk of stream) {\n  if (chunk.type === 'CUSTOM' && chunk.name === 'structured-output.complete') {\n    const result = chunk.value.object \u002F\u002F ✅ typed and validated\n  }\n}\n",[8887],{"type":67,"tag":92,"props":8888,"children":8889},{"__ignoreMap":112},[8890,8898,8933,8980,9037,9044,9051,9058,9066,9101,9180,9221,9228],{"type":67,"tag":118,"props":8891,"children":8892},{"class":120,"line":121},[8893],{"type":67,"tag":118,"props":8894,"children":8895},{"style":588},[8896],{"type":73,"value":8897},"\u002F\u002F WRONG -- partial JSON, throws SyntaxError mid-stream, no schema validation\n",{"type":67,"tag":118,"props":8899,"children":8900},{"class":120,"line":169},[8901,8905,8909,8913,8917,8921,8925,8929],{"type":67,"tag":118,"props":8902,"children":8903},{"style":125},[8904],{"type":73,"value":3262},{"type":67,"tag":118,"props":8906,"children":8907},{"style":125},[8908],{"type":73,"value":277},{"type":67,"tag":118,"props":8910,"children":8911},{"style":137},[8912],{"type":73,"value":3271},{"type":67,"tag":118,"props":8914,"children":8915},{"style":259},[8916],{"type":73,"value":262},{"type":67,"tag":118,"props":8918,"children":8919},{"style":137},[8920],{"type":73,"value":3280},{"type":67,"tag":118,"props":8922,"children":8923},{"style":131},[8924],{"type":73,"value":3285},{"type":67,"tag":118,"props":8926,"children":8927},{"style":137},[8928],{"type":73,"value":3290},{"type":67,"tag":118,"props":8930,"children":8931},{"style":131},[8932],{"type":73,"value":292},{"type":67,"tag":118,"props":8934,"children":8935},{"class":120,"line":207},[8936,8940,8944,8948,8952,8956,8960,8964,8968,8972,8976],{"type":67,"tag":118,"props":8937,"children":8938},{"style":125},[8939],{"type":73,"value":3302},{"type":67,"tag":118,"props":8941,"children":8942},{"style":299},[8943],{"type":73,"value":3271},{"type":67,"tag":118,"props":8945,"children":8946},{"style":137},[8947],{"type":73,"value":3311},{"type":67,"tag":118,"props":8949,"children":8950},{"style":131},[8951],{"type":73,"value":446},{"type":67,"tag":118,"props":8953,"children":8954},{"style":137},[8955],{"type":73,"value":3320},{"type":67,"tag":118,"props":8957,"children":8958},{"style":131},[8959],{"type":73,"value":3325},{"type":67,"tag":118,"props":8961,"children":8962},{"style":131},[8963],{"type":73,"value":155},{"type":67,"tag":118,"props":8965,"children":8966},{"style":158},[8967],{"type":73,"value":5492},{"type":67,"tag":118,"props":8969,"children":8970},{"style":131},[8971],{"type":73,"value":320},{"type":67,"tag":118,"props":8973,"children":8974},{"style":299},[8975],{"type":73,"value":3379},{"type":67,"tag":118,"props":8977,"children":8978},{"style":131},[8979],{"type":73,"value":292},{"type":67,"tag":118,"props":8981,"children":8982},{"class":120,"line":245},[8983,8988,8993,8997,9002,9006,9011,9015,9019,9023,9028,9032],{"type":67,"tag":118,"props":8984,"children":8985},{"style":259},[8986],{"type":73,"value":8987},"    const",{"type":67,"tag":118,"props":8989,"children":8990},{"style":137},[8991],{"type":73,"value":8992}," obj",{"type":67,"tag":118,"props":8994,"children":8995},{"style":131},[8996],{"type":73,"value":4376},{"type":67,"tag":118,"props":8998,"children":8999},{"style":137},[9000],{"type":73,"value":9001}," JSON",{"type":67,"tag":118,"props":9003,"children":9004},{"style":131},[9005],{"type":73,"value":446},{"type":67,"tag":118,"props":9007,"children":9008},{"style":280},[9009],{"type":73,"value":9010},"parse",{"type":67,"tag":118,"props":9012,"children":9013},{"style":299},[9014],{"type":73,"value":287},{"type":67,"tag":118,"props":9016,"children":9017},{"style":137},[9018],{"type":73,"value":3311},{"type":67,"tag":118,"props":9020,"children":9021},{"style":131},[9022],{"type":73,"value":446},{"type":67,"tag":118,"props":9024,"children":9025},{"style":137},[9026],{"type":73,"value":9027},"delta",{"type":67,"tag":118,"props":9029,"children":9030},{"style":299},[9031],{"type":73,"value":3379},{"type":67,"tag":118,"props":9033,"children":9034},{"style":588},[9035],{"type":73,"value":9036},"\u002F\u002F ❌ partial, invalid\n",{"type":67,"tag":118,"props":9038,"children":9039},{"class":120,"line":255},[9040],{"type":67,"tag":118,"props":9041,"children":9042},{"style":131},[9043],{"type":73,"value":3511},{"type":67,"tag":118,"props":9045,"children":9046},{"class":120,"line":295},[9047],{"type":67,"tag":118,"props":9048,"children":9049},{"style":131},[9050],{"type":73,"value":3519},{"type":67,"tag":118,"props":9052,"children":9053},{"class":120,"line":342},[9054],{"type":67,"tag":118,"props":9055,"children":9056},{"emptyLinePlaceholder":249},[9057],{"type":73,"value":252},{"type":67,"tag":118,"props":9059,"children":9060},{"class":120,"line":427},[9061],{"type":67,"tag":118,"props":9062,"children":9063},{"style":588},[9064],{"type":73,"value":9065},"\u002F\u002F CORRECT -- trust the terminal event\n",{"type":67,"tag":118,"props":9067,"children":9068},{"class":120,"line":462},[9069,9073,9077,9081,9085,9089,9093,9097],{"type":67,"tag":118,"props":9070,"children":9071},{"style":125},[9072],{"type":73,"value":3262},{"type":67,"tag":118,"props":9074,"children":9075},{"style":125},[9076],{"type":73,"value":277},{"type":67,"tag":118,"props":9078,"children":9079},{"style":137},[9080],{"type":73,"value":3271},{"type":67,"tag":118,"props":9082,"children":9083},{"style":259},[9084],{"type":73,"value":262},{"type":67,"tag":118,"props":9086,"children":9087},{"style":137},[9088],{"type":73,"value":3280},{"type":67,"tag":118,"props":9090,"children":9091},{"style":131},[9092],{"type":73,"value":3285},{"type":67,"tag":118,"props":9094,"children":9095},{"style":137},[9096],{"type":73,"value":3290},{"type":67,"tag":118,"props":9098,"children":9099},{"style":131},[9100],{"type":73,"value":292},{"type":67,"tag":118,"props":9102,"children":9103},{"class":120,"line":497},[9104,9108,9112,9116,9120,9124,9128,9132,9136,9140,9144,9148,9152,9156,9160,9164,9168,9172,9176],{"type":67,"tag":118,"props":9105,"children":9106},{"style":125},[9107],{"type":73,"value":3302},{"type":67,"tag":118,"props":9109,"children":9110},{"style":299},[9111],{"type":73,"value":3271},{"type":67,"tag":118,"props":9113,"children":9114},{"style":137},[9115],{"type":73,"value":3311},{"type":67,"tag":118,"props":9117,"children":9118},{"style":131},[9119],{"type":73,"value":446},{"type":67,"tag":118,"props":9121,"children":9122},{"style":137},[9123],{"type":73,"value":3320},{"type":67,"tag":118,"props":9125,"children":9126},{"style":131},[9127],{"type":73,"value":3325},{"type":67,"tag":118,"props":9129,"children":9130},{"style":131},[9131],{"type":73,"value":155},{"type":67,"tag":118,"props":9133,"children":9134},{"style":158},[9135],{"type":73,"value":3334},{"type":67,"tag":118,"props":9137,"children":9138},{"style":131},[9139],{"type":73,"value":320},{"type":67,"tag":118,"props":9141,"children":9142},{"style":131},[9143],{"type":73,"value":3343},{"type":67,"tag":118,"props":9145,"children":9146},{"style":137},[9147],{"type":73,"value":3348},{"type":67,"tag":118,"props":9149,"children":9150},{"style":131},[9151],{"type":73,"value":446},{"type":67,"tag":118,"props":9153,"children":9154},{"style":137},[9155],{"type":73,"value":3357},{"type":67,"tag":118,"props":9157,"children":9158},{"style":131},[9159],{"type":73,"value":3325},{"type":67,"tag":118,"props":9161,"children":9162},{"style":131},[9163],{"type":73,"value":155},{"type":67,"tag":118,"props":9165,"children":9166},{"style":158},[9167],{"type":73,"value":3370},{"type":67,"tag":118,"props":9169,"children":9170},{"style":131},[9171],{"type":73,"value":320},{"type":67,"tag":118,"props":9173,"children":9174},{"style":299},[9175],{"type":73,"value":3379},{"type":67,"tag":118,"props":9177,"children":9178},{"style":131},[9179],{"type":73,"value":292},{"type":67,"tag":118,"props":9181,"children":9182},{"class":120,"line":531},[9183,9187,9192,9196,9200,9204,9208,9212,9216],{"type":67,"tag":118,"props":9184,"children":9185},{"style":259},[9186],{"type":73,"value":8987},{"type":67,"tag":118,"props":9188,"children":9189},{"style":137},[9190],{"type":73,"value":9191}," result",{"type":67,"tag":118,"props":9193,"children":9194},{"style":131},[9195],{"type":73,"value":4376},{"type":67,"tag":118,"props":9197,"children":9198},{"style":137},[9199],{"type":73,"value":3348},{"type":67,"tag":118,"props":9201,"children":9202},{"style":131},[9203],{"type":73,"value":446},{"type":67,"tag":118,"props":9205,"children":9206},{"style":137},[9207],{"type":73,"value":3416},{"type":67,"tag":118,"props":9209,"children":9210},{"style":131},[9211],{"type":73,"value":446},{"type":67,"tag":118,"props":9213,"children":9214},{"style":137},[9215],{"type":73,"value":451},{"type":67,"tag":118,"props":9217,"children":9218},{"style":588},[9219],{"type":73,"value":9220}," \u002F\u002F ✅ typed and validated\n",{"type":67,"tag":118,"props":9222,"children":9223},{"class":120,"line":548},[9224],{"type":67,"tag":118,"props":9225,"children":9226},{"style":131},[9227],{"type":73,"value":3511},{"type":67,"tag":118,"props":9229,"children":9230},{"class":120,"line":562},[9231],{"type":67,"tag":118,"props":9232,"children":9233},{"style":131},[9234],{"type":73,"value":3519},{"type":67,"tag":80,"props":9236,"children":9237},{},[9238,9240,9245,9247,9252],{"type":73,"value":9239},"If you need progressive parsed state in a non-React environment, use a partial-JSON parser on the accumulated raw string at render time — but do NOT treat the result as schema-validated; only the terminal event is. In ",{"type":67,"tag":92,"props":9241,"children":9243},{"className":9242},[],[9244],{"type":73,"value":97},{"type":73,"value":9246},", this is already done for you (",{"type":67,"tag":92,"props":9248,"children":9250},{"className":9249},[],[9251],{"type":73,"value":3968},{"type":73,"value":9253}," field on Pattern 4).",{"type":67,"tag":80,"props":9255,"children":9256},{},[9257],{"type":73,"value":9258},"Source: maintainer interview",{"type":67,"tag":820,"props":9260,"children":9262},{"id":9261},"high-trying-to-implement-provider-specific-structured-output-strategies",[9263],{"type":73,"value":9264},"HIGH: Trying to implement provider-specific structured output strategies",{"type":67,"tag":80,"props":9266,"children":9267},{},[9268,9270,9276,9278,9283],{"type":73,"value":9269},"The adapter already handles provider differences (OpenAI uses ",{"type":67,"tag":92,"props":9271,"children":9273},{"className":9272},[],[9274],{"type":73,"value":9275},"response_format",{"type":73,"value":9277},", Anthropic uses tool-based extraction, Gemini uses ",{"type":67,"tag":92,"props":9279,"children":9281},{"className":9280},[],[9282],{"type":73,"value":3705},{"type":73,"value":9284},"). Never configure this yourself.",{"type":67,"tag":108,"props":9286,"children":9288},{"className":110,"code":9287,"language":15,"meta":112,"style":112},"\u002F\u002F WRONG -- do not set provider-specific response format\nchat({\n  adapter,\n  messages,\n  modelOptions: {\n    responseFormat: { type: 'json_schema', json_schema: mySchema },\n  },\n})\n\n\u002F\u002F CORRECT -- just pass outputSchema, the adapter handles the rest\nchat({\n  adapter,\n  messages,\n  outputSchema: z.object({ name: z.string(), age: z.number() }),\n})\n",[9289],{"type":67,"tag":92,"props":9290,"children":9291},{"__ignoreMap":112},[9292,9300,9316,9327,9338,9354,9414,9422,9433,9440,9448,9463,9474,9485,9582],{"type":67,"tag":118,"props":9293,"children":9294},{"class":120,"line":121},[9295],{"type":67,"tag":118,"props":9296,"children":9297},{"style":588},[9298],{"type":73,"value":9299},"\u002F\u002F WRONG -- do not set provider-specific response format\n",{"type":67,"tag":118,"props":9301,"children":9302},{"class":120,"line":169},[9303,9308,9312],{"type":67,"tag":118,"props":9304,"children":9305},{"style":280},[9306],{"type":73,"value":9307},"chat",{"type":67,"tag":118,"props":9309,"children":9310},{"style":137},[9311],{"type":73,"value":287},{"type":67,"tag":118,"props":9313,"children":9314},{"style":131},[9315],{"type":73,"value":292},{"type":67,"tag":118,"props":9317,"children":9318},{"class":120,"line":207},[9319,9323],{"type":67,"tag":118,"props":9320,"children":9321},{"style":137},[9322],{"type":73,"value":302},{"type":67,"tag":118,"props":9324,"children":9325},{"style":131},[9326],{"type":73,"value":339},{"type":67,"tag":118,"props":9328,"children":9329},{"class":120,"line":245},[9330,9334],{"type":67,"tag":118,"props":9331,"children":9332},{"style":137},[9333],{"type":73,"value":348},{"type":67,"tag":118,"props":9335,"children":9336},{"style":131},[9337],{"type":73,"value":339},{"type":67,"tag":118,"props":9339,"children":9340},{"class":120,"line":255},[9341,9346,9350],{"type":67,"tag":118,"props":9342,"children":9343},{"style":299},[9344],{"type":73,"value":9345},"  modelOptions",{"type":67,"tag":118,"props":9347,"children":9348},{"style":131},[9349],{"type":73,"value":307},{"type":67,"tag":118,"props":9351,"children":9352},{"style":131},[9353],{"type":73,"value":4350},{"type":67,"tag":118,"props":9355,"children":9356},{"class":120,"line":295},[9357,9362,9366,9370,9374,9378,9382,9387,9391,9395,9400,9404,9409],{"type":67,"tag":118,"props":9358,"children":9359},{"style":299},[9360],{"type":73,"value":9361},"    responseFormat",{"type":67,"tag":118,"props":9363,"children":9364},{"style":131},[9365],{"type":73,"value":307},{"type":67,"tag":118,"props":9367,"children":9368},{"style":131},[9369],{"type":73,"value":134},{"type":67,"tag":118,"props":9371,"children":9372},{"style":299},[9373],{"type":73,"value":5665},{"type":67,"tag":118,"props":9375,"children":9376},{"style":131},[9377],{"type":73,"value":307},{"type":67,"tag":118,"props":9379,"children":9380},{"style":131},[9381],{"type":73,"value":155},{"type":67,"tag":118,"props":9383,"children":9384},{"style":158},[9385],{"type":73,"value":9386},"json_schema",{"type":67,"tag":118,"props":9388,"children":9389},{"style":131},[9390],{"type":73,"value":320},{"type":67,"tag":118,"props":9392,"children":9393},{"style":131},[9394],{"type":73,"value":389},{"type":67,"tag":118,"props":9396,"children":9397},{"style":299},[9398],{"type":73,"value":9399}," json_schema",{"type":67,"tag":118,"props":9401,"children":9402},{"style":131},[9403],{"type":73,"value":307},{"type":67,"tag":118,"props":9405,"children":9406},{"style":137},[9407],{"type":73,"value":9408}," mySchema ",{"type":67,"tag":118,"props":9410,"children":9411},{"style":131},[9412],{"type":73,"value":9413},"},\n",{"type":67,"tag":118,"props":9415,"children":9416},{"class":120,"line":342},[9417],{"type":67,"tag":118,"props":9418,"children":9419},{"style":131},[9420],{"type":73,"value":9421},"  },\n",{"type":67,"tag":118,"props":9423,"children":9424},{"class":120,"line":427},[9425,9429],{"type":67,"tag":118,"props":9426,"children":9427},{"style":131},[9428],{"type":73,"value":554},{"type":67,"tag":118,"props":9430,"children":9431},{"style":137},[9432],{"type":73,"value":559},{"type":67,"tag":118,"props":9434,"children":9435},{"class":120,"line":462},[9436],{"type":67,"tag":118,"props":9437,"children":9438},{"emptyLinePlaceholder":249},[9439],{"type":73,"value":252},{"type":67,"tag":118,"props":9441,"children":9442},{"class":120,"line":497},[9443],{"type":67,"tag":118,"props":9444,"children":9445},{"style":588},[9446],{"type":73,"value":9447},"\u002F\u002F CORRECT -- just pass outputSchema, the adapter handles the rest\n",{"type":67,"tag":118,"props":9449,"children":9450},{"class":120,"line":531},[9451,9455,9459],{"type":67,"tag":118,"props":9452,"children":9453},{"style":280},[9454],{"type":73,"value":9307},{"type":67,"tag":118,"props":9456,"children":9457},{"style":137},[9458],{"type":73,"value":287},{"type":67,"tag":118,"props":9460,"children":9461},{"style":131},[9462],{"type":73,"value":292},{"type":67,"tag":118,"props":9464,"children":9465},{"class":120,"line":548},[9466,9470],{"type":67,"tag":118,"props":9467,"children":9468},{"style":137},[9469],{"type":73,"value":302},{"type":67,"tag":118,"props":9471,"children":9472},{"style":131},[9473],{"type":73,"value":339},{"type":67,"tag":118,"props":9475,"children":9476},{"class":120,"line":562},[9477,9481],{"type":67,"tag":118,"props":9478,"children":9479},{"style":137},[9480],{"type":73,"value":348},{"type":67,"tag":118,"props":9482,"children":9483},{"style":131},[9484],{"type":73,"value":339},{"type":67,"tag":118,"props":9486,"children":9487},{"class":120,"line":570},[9488,9492,9496,9500,9504,9508,9512,9516,9521,9525,9529,9533,9537,9541,9545,9550,9554,9558,9562,9566,9570,9574,9578],{"type":67,"tag":118,"props":9489,"children":9490},{"style":299},[9491],{"type":73,"value":433},{"type":67,"tag":118,"props":9493,"children":9494},{"style":131},[9495],{"type":73,"value":307},{"type":67,"tag":118,"props":9497,"children":9498},{"style":137},[9499],{"type":73,"value":221},{"type":67,"tag":118,"props":9501,"children":9502},{"style":131},[9503],{"type":73,"value":446},{"type":67,"tag":118,"props":9505,"children":9506},{"style":280},[9507],{"type":73,"value":451},{"type":67,"tag":118,"props":9509,"children":9510},{"style":137},[9511],{"type":73,"value":287},{"type":67,"tag":118,"props":9513,"children":9514},{"style":131},[9515],{"type":73,"value":362},{"type":67,"tag":118,"props":9517,"children":9518},{"style":299},[9519],{"type":73,"value":9520}," name",{"type":67,"tag":118,"props":9522,"children":9523},{"style":131},[9524],{"type":73,"value":307},{"type":67,"tag":118,"props":9526,"children":9527},{"style":137},[9528],{"type":73,"value":221},{"type":67,"tag":118,"props":9530,"children":9531},{"style":131},[9532],{"type":73,"value":446},{"type":67,"tag":118,"props":9534,"children":9535},{"style":280},[9536],{"type":73,"value":485},{"type":67,"tag":118,"props":9538,"children":9539},{"style":137},[9540],{"type":73,"value":490},{"type":67,"tag":118,"props":9542,"children":9543},{"style":131},[9544],{"type":73,"value":389},{"type":67,"tag":118,"props":9546,"children":9547},{"style":299},[9548],{"type":73,"value":9549}," age",{"type":67,"tag":118,"props":9551,"children":9552},{"style":131},[9553],{"type":73,"value":307},{"type":67,"tag":118,"props":9555,"children":9556},{"style":137},[9557],{"type":73,"value":221},{"type":67,"tag":118,"props":9559,"children":9560},{"style":131},[9561],{"type":73,"value":446},{"type":67,"tag":118,"props":9563,"children":9564},{"style":280},[9565],{"type":73,"value":520},{"type":67,"tag":118,"props":9567,"children":9568},{"style":137},[9569],{"type":73,"value":5969},{"type":67,"tag":118,"props":9571,"children":9572},{"style":131},[9573],{"type":73,"value":554},{"type":67,"tag":118,"props":9575,"children":9576},{"style":137},[9577],{"type":73,"value":334},{"type":67,"tag":118,"props":9579,"children":9580},{"style":131},[9581],{"type":73,"value":339},{"type":67,"tag":118,"props":9583,"children":9584},{"class":120,"line":594},[9585,9589],{"type":67,"tag":118,"props":9586,"children":9587},{"style":131},[9588],{"type":73,"value":554},{"type":67,"tag":118,"props":9590,"children":9591},{"style":137},[9592],{"type":73,"value":559},{"type":67,"tag":80,"props":9594,"children":9595},{},[9596,9598,9603,9604,9609],{"type":73,"value":9597},"There is no scenario where you need to know the provider's strategy. Just pass ",{"type":67,"tag":92,"props":9599,"children":9601},{"className":9600},[],[9602],{"type":73,"value":624},{"type":73,"value":3955},{"type":67,"tag":92,"props":9605,"children":9607},{"className":9606},[],[9608],{"type":73,"value":632},{"type":73,"value":446},{"type":67,"tag":80,"props":9611,"children":9612},{},[9613],{"type":73,"value":9258},{"type":67,"tag":820,"props":9615,"children":9617},{"id":9616},"high-passing-raw-objects-instead-of-using-the-projects-schema-library",[9618],{"type":73,"value":9619},"HIGH: Passing raw objects instead of using the project's schema library",{"type":67,"tag":80,"props":9621,"children":9622},{},[9623],{"type":73,"value":9624},"Agents often generate raw JSON Schema objects or plain TypeScript types instead\nof using the schema validation library already in the project (Zod, ArkType,\nValibot). Always check what the project uses and match it.",{"type":67,"tag":108,"props":9626,"children":9628},{"className":110,"code":9627,"language":15,"meta":112,"style":112},"\u002F\u002F WRONG -- raw object, no runtime validation, no type inference\nchat({\n  adapter,\n  messages,\n  outputSchema: {\n    type: 'object',\n    properties: {\n      name: { type: 'string' },\n      age: { type: 'number' },\n    },\n    required: ['name', 'age'],\n    additionalProperties: false,\n  },\n})\n\n\u002F\u002F CORRECT -- use the project's schema library (e.g. Zod)\nimport { z } from 'zod'\n\nchat({\n  adapter,\n  messages,\n  outputSchema: z.object({\n    name: z.string(),\n    age: z.number(),\n  }),\n})\n",[9629],{"type":67,"tag":92,"props":9630,"children":9631},{"__ignoreMap":112},[9632,9640,9655,9666,9677,9692,9720,9736,9775,9815,9822,9874,9895,9902,9913,9920,9928,9963,9970,9985,9996,10007,10038,10069,10100,10115],{"type":67,"tag":118,"props":9633,"children":9634},{"class":120,"line":121},[9635],{"type":67,"tag":118,"props":9636,"children":9637},{"style":588},[9638],{"type":73,"value":9639},"\u002F\u002F WRONG -- raw object, no runtime validation, no type inference\n",{"type":67,"tag":118,"props":9641,"children":9642},{"class":120,"line":169},[9643,9647,9651],{"type":67,"tag":118,"props":9644,"children":9645},{"style":280},[9646],{"type":73,"value":9307},{"type":67,"tag":118,"props":9648,"children":9649},{"style":137},[9650],{"type":73,"value":287},{"type":67,"tag":118,"props":9652,"children":9653},{"style":131},[9654],{"type":73,"value":292},{"type":67,"tag":118,"props":9656,"children":9657},{"class":120,"line":207},[9658,9662],{"type":67,"tag":118,"props":9659,"children":9660},{"style":137},[9661],{"type":73,"value":302},{"type":67,"tag":118,"props":9663,"children":9664},{"style":131},[9665],{"type":73,"value":339},{"type":67,"tag":118,"props":9667,"children":9668},{"class":120,"line":245},[9669,9673],{"type":67,"tag":118,"props":9670,"children":9671},{"style":137},[9672],{"type":73,"value":348},{"type":67,"tag":118,"props":9674,"children":9675},{"style":131},[9676],{"type":73,"value":339},{"type":67,"tag":118,"props":9678,"children":9679},{"class":120,"line":255},[9680,9684,9688],{"type":67,"tag":118,"props":9681,"children":9682},{"style":299},[9683],{"type":73,"value":433},{"type":67,"tag":118,"props":9685,"children":9686},{"style":131},[9687],{"type":73,"value":307},{"type":67,"tag":118,"props":9689,"children":9690},{"style":131},[9691],{"type":73,"value":4350},{"type":67,"tag":118,"props":9693,"children":9694},{"class":120,"line":295},[9695,9700,9704,9708,9712,9716],{"type":67,"tag":118,"props":9696,"children":9697},{"style":299},[9698],{"type":73,"value":9699},"    type",{"type":67,"tag":118,"props":9701,"children":9702},{"style":131},[9703],{"type":73,"value":307},{"type":67,"tag":118,"props":9705,"children":9706},{"style":131},[9707],{"type":73,"value":155},{"type":67,"tag":118,"props":9709,"children":9710},{"style":158},[9711],{"type":73,"value":451},{"type":67,"tag":118,"props":9713,"children":9714},{"style":131},[9715],{"type":73,"value":320},{"type":67,"tag":118,"props":9717,"children":9718},{"style":131},[9719],{"type":73,"value":339},{"type":67,"tag":118,"props":9721,"children":9722},{"class":120,"line":342},[9723,9728,9732],{"type":67,"tag":118,"props":9724,"children":9725},{"style":299},[9726],{"type":73,"value":9727},"    properties",{"type":67,"tag":118,"props":9729,"children":9730},{"style":131},[9731],{"type":73,"value":307},{"type":67,"tag":118,"props":9733,"children":9734},{"style":131},[9735],{"type":73,"value":4350},{"type":67,"tag":118,"props":9737,"children":9738},{"class":120,"line":427},[9739,9743,9747,9751,9755,9759,9763,9767,9771],{"type":67,"tag":118,"props":9740,"children":9741},{"style":299},[9742],{"type":73,"value":2070},{"type":67,"tag":118,"props":9744,"children":9745},{"style":131},[9746],{"type":73,"value":307},{"type":67,"tag":118,"props":9748,"children":9749},{"style":131},[9750],{"type":73,"value":134},{"type":67,"tag":118,"props":9752,"children":9753},{"style":299},[9754],{"type":73,"value":5665},{"type":67,"tag":118,"props":9756,"children":9757},{"style":131},[9758],{"type":73,"value":307},{"type":67,"tag":118,"props":9760,"children":9761},{"style":131},[9762],{"type":73,"value":155},{"type":67,"tag":118,"props":9764,"children":9765},{"style":158},[9766],{"type":73,"value":485},{"type":67,"tag":118,"props":9768,"children":9769},{"style":131},[9770],{"type":73,"value":320},{"type":67,"tag":118,"props":9772,"children":9773},{"style":131},[9774],{"type":73,"value":3184},{"type":67,"tag":118,"props":9776,"children":9777},{"class":120,"line":462},[9778,9783,9787,9791,9795,9799,9803,9807,9811],{"type":67,"tag":118,"props":9779,"children":9780},{"style":299},[9781],{"type":73,"value":9782},"      age",{"type":67,"tag":118,"props":9784,"children":9785},{"style":131},[9786],{"type":73,"value":307},{"type":67,"tag":118,"props":9788,"children":9789},{"style":131},[9790],{"type":73,"value":134},{"type":67,"tag":118,"props":9792,"children":9793},{"style":299},[9794],{"type":73,"value":5665},{"type":67,"tag":118,"props":9796,"children":9797},{"style":131},[9798],{"type":73,"value":307},{"type":67,"tag":118,"props":9800,"children":9801},{"style":131},[9802],{"type":73,"value":155},{"type":67,"tag":118,"props":9804,"children":9805},{"style":158},[9806],{"type":73,"value":520},{"type":67,"tag":118,"props":9808,"children":9809},{"style":131},[9810],{"type":73,"value":320},{"type":67,"tag":118,"props":9812,"children":9813},{"style":131},[9814],{"type":73,"value":3184},{"type":67,"tag":118,"props":9816,"children":9817},{"class":120,"line":497},[9818],{"type":67,"tag":118,"props":9819,"children":9820},{"style":131},[9821],{"type":73,"value":1422},{"type":67,"tag":118,"props":9823,"children":9824},{"class":120,"line":531},[9825,9830,9834,9838,9842,9846,9850,9854,9858,9862,9866,9870],{"type":67,"tag":118,"props":9826,"children":9827},{"style":299},[9828],{"type":73,"value":9829},"    required",{"type":67,"tag":118,"props":9831,"children":9832},{"style":131},[9833],{"type":73,"value":307},{"type":67,"tag":118,"props":9835,"children":9836},{"style":137},[9837],{"type":73,"value":357},{"type":67,"tag":118,"props":9839,"children":9840},{"style":131},[9841],{"type":73,"value":320},{"type":67,"tag":118,"props":9843,"children":9844},{"style":158},[9845],{"type":73,"value":3357},{"type":67,"tag":118,"props":9847,"children":9848},{"style":131},[9849],{"type":73,"value":320},{"type":67,"tag":118,"props":9851,"children":9852},{"style":131},[9853],{"type":73,"value":389},{"type":67,"tag":118,"props":9855,"children":9856},{"style":131},[9857],{"type":73,"value":155},{"type":67,"tag":118,"props":9859,"children":9860},{"style":158},[9861],{"type":73,"value":3469},{"type":67,"tag":118,"props":9863,"children":9864},{"style":131},[9865],{"type":73,"value":320},{"type":67,"tag":118,"props":9867,"children":9868},{"style":137},[9869],{"type":73,"value":420},{"type":67,"tag":118,"props":9871,"children":9872},{"style":131},[9873],{"type":73,"value":339},{"type":67,"tag":118,"props":9875,"children":9876},{"class":120,"line":548},[9877,9882,9886,9891],{"type":67,"tag":118,"props":9878,"children":9879},{"style":299},[9880],{"type":73,"value":9881},"    additionalProperties",{"type":67,"tag":118,"props":9883,"children":9884},{"style":131},[9885],{"type":73,"value":307},{"type":67,"tag":118,"props":9887,"children":9888},{"style":3229},[9889],{"type":73,"value":9890}," false",{"type":67,"tag":118,"props":9892,"children":9893},{"style":131},[9894],{"type":73,"value":339},{"type":67,"tag":118,"props":9896,"children":9897},{"class":120,"line":562},[9898],{"type":67,"tag":118,"props":9899,"children":9900},{"style":131},[9901],{"type":73,"value":9421},{"type":67,"tag":118,"props":9903,"children":9904},{"class":120,"line":570},[9905,9909],{"type":67,"tag":118,"props":9906,"children":9907},{"style":131},[9908],{"type":73,"value":554},{"type":67,"tag":118,"props":9910,"children":9911},{"style":137},[9912],{"type":73,"value":559},{"type":67,"tag":118,"props":9914,"children":9915},{"class":120,"line":594},[9916],{"type":67,"tag":118,"props":9917,"children":9918},{"emptyLinePlaceholder":249},[9919],{"type":73,"value":252},{"type":67,"tag":118,"props":9921,"children":9922},{"class":120,"line":1351},[9923],{"type":67,"tag":118,"props":9924,"children":9925},{"style":588},[9926],{"type":73,"value":9927},"\u002F\u002F CORRECT -- use the project's schema library (e.g. Zod)\n",{"type":67,"tag":118,"props":9929,"children":9930},{"class":120,"line":1380},[9931,9935,9939,9943,9947,9951,9955,9959],{"type":67,"tag":118,"props":9932,"children":9933},{"style":125},[9934],{"type":73,"value":128},{"type":67,"tag":118,"props":9936,"children":9937},{"style":131},[9938],{"type":73,"value":134},{"type":67,"tag":118,"props":9940,"children":9941},{"style":137},[9942],{"type":73,"value":221},{"type":67,"tag":118,"props":9944,"children":9945},{"style":131},[9946],{"type":73,"value":145},{"type":67,"tag":118,"props":9948,"children":9949},{"style":125},[9950],{"type":73,"value":150},{"type":67,"tag":118,"props":9952,"children":9953},{"style":131},[9954],{"type":73,"value":155},{"type":67,"tag":118,"props":9956,"children":9957},{"style":158},[9958],{"type":73,"value":238},{"type":67,"tag":118,"props":9960,"children":9961},{"style":131},[9962],{"type":73,"value":166},{"type":67,"tag":118,"props":9964,"children":9965},{"class":120,"line":1394},[9966],{"type":67,"tag":118,"props":9967,"children":9968},{"emptyLinePlaceholder":249},[9969],{"type":73,"value":252},{"type":67,"tag":118,"props":9971,"children":9972},{"class":120,"line":1416},[9973,9977,9981],{"type":67,"tag":118,"props":9974,"children":9975},{"style":280},[9976],{"type":73,"value":9307},{"type":67,"tag":118,"props":9978,"children":9979},{"style":137},[9980],{"type":73,"value":287},{"type":67,"tag":118,"props":9982,"children":9983},{"style":131},[9984],{"type":73,"value":292},{"type":67,"tag":118,"props":9986,"children":9987},{"class":120,"line":1425},[9988,9992],{"type":67,"tag":118,"props":9989,"children":9990},{"style":137},[9991],{"type":73,"value":302},{"type":67,"tag":118,"props":9993,"children":9994},{"style":131},[9995],{"type":73,"value":339},{"type":67,"tag":118,"props":9997,"children":9998},{"class":120,"line":1438},[9999,10003],{"type":67,"tag":118,"props":10000,"children":10001},{"style":137},[10002],{"type":73,"value":348},{"type":67,"tag":118,"props":10004,"children":10005},{"style":131},[10006],{"type":73,"value":339},{"type":67,"tag":118,"props":10008,"children":10009},{"class":120,"line":1459},[10010,10014,10018,10022,10026,10030,10034],{"type":67,"tag":118,"props":10011,"children":10012},{"style":299},[10013],{"type":73,"value":433},{"type":67,"tag":118,"props":10015,"children":10016},{"style":131},[10017],{"type":73,"value":307},{"type":67,"tag":118,"props":10019,"children":10020},{"style":137},[10021],{"type":73,"value":221},{"type":67,"tag":118,"props":10023,"children":10024},{"style":131},[10025],{"type":73,"value":446},{"type":67,"tag":118,"props":10027,"children":10028},{"style":280},[10029],{"type":73,"value":451},{"type":67,"tag":118,"props":10031,"children":10032},{"style":137},[10033],{"type":73,"value":287},{"type":67,"tag":118,"props":10035,"children":10036},{"style":131},[10037],{"type":73,"value":292},{"type":67,"tag":118,"props":10039,"children":10040},{"class":120,"line":1471},[10041,10045,10049,10053,10057,10061,10065],{"type":67,"tag":118,"props":10042,"children":10043},{"style":299},[10044],{"type":73,"value":468},{"type":67,"tag":118,"props":10046,"children":10047},{"style":131},[10048],{"type":73,"value":307},{"type":67,"tag":118,"props":10050,"children":10051},{"style":137},[10052],{"type":73,"value":221},{"type":67,"tag":118,"props":10054,"children":10055},{"style":131},[10056],{"type":73,"value":446},{"type":67,"tag":118,"props":10058,"children":10059},{"style":280},[10060],{"type":73,"value":485},{"type":67,"tag":118,"props":10062,"children":10063},{"style":137},[10064],{"type":73,"value":490},{"type":67,"tag":118,"props":10066,"children":10067},{"style":131},[10068],{"type":73,"value":339},{"type":67,"tag":118,"props":10070,"children":10071},{"class":120,"line":1479},[10072,10076,10080,10084,10088,10092,10096],{"type":67,"tag":118,"props":10073,"children":10074},{"style":299},[10075],{"type":73,"value":503},{"type":67,"tag":118,"props":10077,"children":10078},{"style":131},[10079],{"type":73,"value":307},{"type":67,"tag":118,"props":10081,"children":10082},{"style":137},[10083],{"type":73,"value":221},{"type":67,"tag":118,"props":10085,"children":10086},{"style":131},[10087],{"type":73,"value":446},{"type":67,"tag":118,"props":10089,"children":10090},{"style":280},[10091],{"type":73,"value":520},{"type":67,"tag":118,"props":10093,"children":10094},{"style":137},[10095],{"type":73,"value":490},{"type":67,"tag":118,"props":10097,"children":10098},{"style":131},[10099],{"type":73,"value":339},{"type":67,"tag":118,"props":10101,"children":10102},{"class":120,"line":1516},[10103,10107,10111],{"type":67,"tag":118,"props":10104,"children":10105},{"style":131},[10106],{"type":73,"value":537},{"type":67,"tag":118,"props":10108,"children":10109},{"style":137},[10110],{"type":73,"value":334},{"type":67,"tag":118,"props":10112,"children":10113},{"style":131},[10114],{"type":73,"value":339},{"type":67,"tag":118,"props":10116,"children":10117},{"class":120,"line":1550},[10118,10122],{"type":67,"tag":118,"props":10119,"children":10120},{"style":131},[10121],{"type":73,"value":554},{"type":67,"tag":118,"props":10123,"children":10124},{"style":137},[10125],{"type":73,"value":559},{"type":67,"tag":80,"props":10127,"children":10128},{},[10129,10131,10137,10139,10144,10145,10151,10153,10159],{"type":73,"value":10130},"Using the project's schema library gives you runtime validation, TypeScript\ntype inference on the result, and correct JSON Schema conversion automatically.\nCheck ",{"type":67,"tag":92,"props":10132,"children":10134},{"className":10133},[],[10135],{"type":73,"value":10136},"package.json",{"type":73,"value":10138}," for ",{"type":67,"tag":92,"props":10140,"children":10142},{"className":10141},[],[10143],{"type":73,"value":238},{"type":73,"value":7859},{"type":67,"tag":92,"props":10146,"children":10148},{"className":10147},[],[10149],{"type":73,"value":10150},"arktype",{"type":73,"value":10152},", or ",{"type":67,"tag":92,"props":10154,"children":10156},{"className":10155},[],[10157],{"type":73,"value":10158},"valibot",{"type":73,"value":10160}," and use whichever is\nalready installed.",{"type":67,"tag":80,"props":10162,"children":10163},{},[10164],{"type":73,"value":9258},{"type":67,"tag":101,"props":10166,"children":10168},{"id":10167},"middleware-coverage",[10169],{"type":73,"value":10170},"Middleware coverage",{"type":67,"tag":80,"props":10172,"children":10173},{},[10174,10176,10181,10183,10189,10191,10197,10199,10205,10207,10212],{"type":73,"value":10175},"The final structured-output adapter call runs through the same middleware\npipeline as the agent loop. ",{"type":67,"tag":92,"props":10177,"children":10179},{"className":10178},[],[10180],{"type":73,"value":3984},{"type":73,"value":10182}," observes chunks attributed to\n",{"type":67,"tag":92,"props":10184,"children":10186},{"className":10185},[],[10187],{"type":73,"value":10188},"ctx.phase === 'structuredOutput'",{"type":73,"value":10190},"; ",{"type":67,"tag":92,"props":10192,"children":10194},{"className":10193},[],[10195],{"type":73,"value":10196},"onUsage",{"type":73,"value":10198}," fires for the final call's\ntokens; ",{"type":67,"tag":92,"props":10200,"children":10202},{"className":10201},[],[10203],{"type":73,"value":10204},"onFinish",{"type":73,"value":10206}," fires once at the end of the whole ",{"type":67,"tag":92,"props":10208,"children":10210},{"className":10209},[],[10211],{"type":73,"value":632},{"type":73,"value":10213}," invocation,\nafter the structured-output result is available.",{"type":67,"tag":80,"props":10215,"children":10216},{},[10217,10219,10225,10227,10234],{"type":73,"value":10218},"For schema-aware middleware (e.g., transforming the JSON Schema before the\nprovider call, stripping system prompts), use the dedicated\n",{"type":67,"tag":92,"props":10220,"children":10222},{"className":10221},[],[10223],{"type":73,"value":10224},"onStructuredOutputConfig",{"type":73,"value":10226}," hook. See ",{"type":67,"tag":10228,"props":10229,"children":10231},"a",{"href":10230},"..\u002Fmiddleware\u002FSKILL.md",[10232],{"type":73,"value":10233},"middleware skill",{"type":73,"value":446},{"type":67,"tag":101,"props":10236,"children":10238},{"id":10237},"cross-references",[10239],{"type":73,"value":10240},"Cross-References",{"type":67,"tag":5465,"props":10242,"children":10243},{},[10244,10263,10274,10308],{"type":67,"tag":5469,"props":10245,"children":10246},{},[10247,10249,10254,10256,10261],{"type":73,"value":10248},"See also: ",{"type":67,"tag":84,"props":10250,"children":10251},{},[10252],{"type":73,"value":10253},"ai-core\u002Fchat-experience\u002FSKILL.md",{"type":73,"value":10255}," — Base ",{"type":67,"tag":92,"props":10257,"children":10259},{"className":10258},[],[10260],{"type":73,"value":97},{"type":73,"value":10262}," surface; the structured-output additions documented here layer on top.",{"type":67,"tag":5469,"props":10264,"children":10265},{},[10266,10267,10272],{"type":73,"value":10248},{"type":67,"tag":84,"props":10268,"children":10269},{},[10270],{"type":73,"value":10271},"ai-core\u002Fadapter-configuration\u002FSKILL.md",{"type":73,"value":10273}," — Adapter handles structured-output strategy transparently.",{"type":67,"tag":5469,"props":10275,"children":10276},{},[10277,10278,10283,10285,10290,10292,10297,10299,10307],{"type":73,"value":10248},{"type":67,"tag":84,"props":10279,"children":10280},{},[10281],{"type":73,"value":10282},"ai-core\u002Ftool-calling\u002FSKILL.md",{"type":73,"value":10284}," — Combine ",{"type":67,"tag":92,"props":10286,"children":10288},{"className":10287},[],[10289],{"type":73,"value":810},{"type":73,"value":10291}," with ",{"type":67,"tag":92,"props":10293,"children":10295},{"className":10294},[],[10296],{"type":73,"value":624},{"type":73,"value":10298}," for an agent loop that runs tools first and returns a typed object. Tool-approval and client-tool flows compose with structured runs without extra wiring; see ",{"type":67,"tag":10228,"props":10300,"children":10304},{"href":10301,"rel":10302},"https:\u002F\u002Fgithub.com\u002FTanStack\u002Fai\u002Fblob\u002Fmain\u002Fdocs\u002Fstructured-outputs\u002Fwith-tools.md",[10303],"nofollow",[10305],{"type":73,"value":10306},"docs\u002Fstructured-outputs\u002Fwith-tools.md",{"type":73,"value":446},{"type":67,"tag":5469,"props":10309,"children":10310},{},[10311,10312,10317,10318,10323,10325,10330],{"type":73,"value":10248},{"type":67,"tag":84,"props":10313,"children":10314},{},[10315],{"type":73,"value":10316},"ai-core\u002Fmiddleware\u002FSKILL.md",{"type":73,"value":3663},{"type":67,"tag":92,"props":10319,"children":10321},{"className":10320},[],[10322],{"type":73,"value":10224},{"type":73,"value":10324}," hook and the ",{"type":67,"tag":92,"props":10326,"children":10328},{"className":10327},[],[10329],{"type":73,"value":3825},{"type":73,"value":10331}," phase for observing\u002Ftransforming the final structured-output call.",{"type":67,"tag":10333,"props":10334,"children":10335},"style",{},[10336],{"type":73,"value":10337},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"items":10339,"total":10481},[10340,10356,10368,10380,10395,10407,10417,10427,10440,10450,10461,10471],{"slug":10341,"name":10341,"fn":10342,"description":10343,"org":10344,"tags":10345,"stars":10353,"repoUrl":10354,"updatedAt":10355},"aggregation","perform data aggregation in TanStack Table","Aggregate TanStack Table columns independently of grouping, including grand totals, caller-selected row totals, multiple keyed aggregations, custom context-based definitions, grouped merges, manual values, and worker constraints.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10346,10349,10352],{"name":10347,"slug":10348,"type":16},"Data Analysis","data-analysis",{"name":10350,"slug":10351,"type":16},"Frontend","frontend",{"name":10,"slug":9,"type":16},28175,"https:\u002F\u002Fgithub.com\u002FTanStack\u002Ftable","2026-07-30T05:25:59.429787",{"slug":10357,"name":10357,"fn":10358,"description":10359,"org":10360,"tags":10361,"stars":10353,"repoUrl":10354,"updatedAt":10367},"api-not-found","diagnose TanStack Table API errors","Diagnose missing TanStack Table v9 exports, options, state slices, and instance methods. Load before inventing an API when code sees a type error, undefined feature method, absent object key, adapter mismatch, or v8-shaped example.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10362,10365,10366],{"name":10363,"slug":10364,"type":16},"Debugging","debugging",{"name":10350,"slug":10351,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:26:05.418735",{"slug":10369,"name":10369,"fn":10370,"description":10371,"org":10372,"tags":10373,"stars":10353,"repoUrl":10354,"updatedAt":10379},"cell-selection","select rectangular cell ranges in tables","Select rectangular cell ranges with cellSelectionFeature: two-corner range state keyed by row and column id, mousedown\u002Fmouseenter handlers, selection edges, render-order resolution under pinning, and autoResetCellSelection. Load when ranges widen unexpectedly after sorting or column reordering, when a drag re-renders the whole table, or when building copy-to-clipboard from a selection.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10374,10375,10376],{"name":10347,"slug":10348,"type":16},{"name":10,"slug":9,"type":16},{"name":10377,"slug":10378,"type":16},"UI Components","ui-components","2026-07-30T05:25:38.403427",{"slug":10381,"name":10381,"fn":10382,"description":10383,"org":10384,"tags":10385,"stars":10353,"repoUrl":10354,"updatedAt":10394},"client-vs-server","manage TanStack Table data pipelines","Choose client or server ownership for filtering, grouping, sorting, expanding, and pagination in TanStack Table v9. Load for manual* flags, mixed pipelines, server counts, or deciding which dataset each row-model stage receives.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10386,10389,10390,10393],{"name":10387,"slug":10388,"type":16},"Data Pipeline","data-pipeline",{"name":10350,"slug":10351,"type":16},{"name":10391,"slug":10392,"type":16},"Performance","performance",{"name":10,"slug":9,"type":16},"2026-07-30T05:25:45.400104",{"slug":10396,"name":10396,"fn":10397,"description":10398,"org":10399,"tags":10400,"stars":10353,"repoUrl":10354,"updatedAt":10406},"column-faceting","build faceted filter UIs","Build faceted filter UIs with columnFacetingFeature, facetedRowModel, facetedUniqueValues, and facetedMinMaxValues. Load for facet counts, numeric ranges, own-filter exclusion, or server-page facet completeness.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10401,10404,10405],{"name":10402,"slug":10403,"type":16},"Data Visualization","data-visualization",{"name":10350,"slug":10351,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:25:41.397257",{"slug":10408,"name":10408,"fn":10409,"description":10410,"org":10411,"tags":10412,"stars":10353,"repoUrl":10354,"updatedAt":10416},"column-filtering","implement column filtering in TanStack Table","Filter columns with columnFilteringFeature, filteredRowModel, filterFns, filterMeta, nested-row direction, and manualFiltering. Load for accessor compatibility, controlled filter updaters, fuzzy metadata, or client\u002Fserver ownership.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10413,10414,10415],{"name":10347,"slug":10348,"type":16},{"name":10350,"slug":10351,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:25:53.391632",{"slug":10418,"name":10418,"fn":10419,"description":10420,"org":10421,"tags":10422,"stars":10353,"repoUrl":10354,"updatedAt":10426},"column-ordering","manage TanStack Table column ordering","Control TanStack Table v9 leaf columnOrder with stable IDs while accounting for pinning regions, visibility, and groupedColumnMode precedence. Load for drag-and-drop columns or rendered order that differs from state.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10423,10424,10425],{"name":10350,"slug":10351,"type":16},{"name":10,"slug":9,"type":16},{"name":10377,"slug":10378,"type":16},"2026-07-30T05:26:03.37801",{"slug":10428,"name":10428,"fn":10429,"description":10430,"org":10431,"tags":10432,"stars":10353,"repoUrl":10354,"updatedAt":10439},"column-pinning","configure column pinning in TanStack Table","Pin columns into logical start, center, and end regions with columnPinningFeature and renderer-owned sticky CSS. Load for RTL offsets, z-index, backgrounds, overflow, widths, gaps, or overlaps.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10433,10436,10437,10438],{"name":10434,"slug":10435,"type":16},"CSS","css",{"name":10350,"slug":10351,"type":16},{"name":10,"slug":9,"type":16},{"name":10377,"slug":10378,"type":16},"2026-07-30T05:25:55.377366",{"slug":10441,"name":10441,"fn":10442,"description":10443,"org":10444,"tags":10445,"stars":10353,"repoUrl":10354,"updatedAt":10449},"column-resizing","implement column resizing in TanStack Table","Wire columnResizingFeature, header.getResizeHandler, resize mode and direction, pointer or touch events, and performant CSS-variable updates. Load when resize state changes but widths do not, or large tables resize slowly.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10446,10447,10448],{"name":10350,"slug":10351,"type":16},{"name":10,"slug":9,"type":16},{"name":10377,"slug":10378,"type":16},"2026-07-30T05:25:51.400011",{"slug":10451,"name":10451,"fn":10452,"description":10453,"org":10454,"tags":10455,"stars":10353,"repoUrl":10354,"updatedAt":10460},"column-sizing","configure column sizing in TanStack Table","Use columnSizingFeature numeric size, minSize, maxSize, getSize, getStart, getAfter, and total-size APIs in table, grid, or flex CSS. Load for auto or percentage misconceptions and sizing\u002Fpinning layout mismatch.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10456,10457,10458,10459],{"name":10434,"slug":10435,"type":16},{"name":10350,"slug":10351,"type":16},{"name":10,"slug":9,"type":16},{"name":10377,"slug":10378,"type":16},"2026-07-30T05:25:48.703799",{"slug":10462,"name":10462,"fn":10463,"description":10464,"org":10465,"tags":10466,"stars":10353,"repoUrl":10354,"updatedAt":10470},"column-visibility","manage column visibility in TanStack Table","Hide columns with columnVisibilityFeature while rendering visibility-aware header, column, and cell collections. Load when hidden columns remain in the DOM, false-versus-absent state is confused, or enableHiding is misunderstood.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10467,10468,10469],{"name":10350,"slug":10351,"type":16},{"name":10,"slug":9,"type":16},{"name":10377,"slug":10378,"type":16},"2026-07-30T05:25:47.367943",{"slug":10472,"name":10472,"fn":10473,"description":10474,"org":10475,"tags":10476,"stars":10353,"repoUrl":10354,"updatedAt":10480},"core","build data grids with TanStack Table","Use TanStack Table v9 as a headless data-grid state and row-processing engine. Load for first-table architecture, stable data and columns, row numbering with getDisplayIndex, semantic rendering, framework adapter choice, or deciding what Table owns versus the renderer.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10477,10478,10479],{"name":10347,"slug":10348,"type":16},{"name":10350,"slug":10351,"type":16},{"name":10377,"slug":10378,"type":16},"2026-07-30T05:25:52.366295",125,{"items":10483,"total":2354},[10484,10500,10515,10530,10543,10555,10569],{"slug":10485,"name":10485,"fn":10486,"description":10487,"org":10488,"tags":10489,"stars":24,"repoUrl":25,"updatedAt":10499},"ai-code-mode","execute sandboxed TypeScript code with LLMs","LLM-generated TypeScript execution in sandboxed environments: createCodeModeTool() with isolate drivers (createNodeIsolateDriver, createQuickJSIsolateDriver, createCloudflareIsolateDriver), codeModeWithSkills() for persistent skill libraries, trust strategies, skill storage (FileSystem, LocalStorage, InMemory, Mongo), client-side execution progress via code_mode:* custom events in useChat.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10490,10491,10494,10497,10498],{"name":21,"slug":22,"type":16},{"name":10492,"slug":10493,"type":16},"Code Execution","code-execution",{"name":10495,"slug":10496,"type":16},"Sandboxing","sandboxing",{"name":10,"slug":9,"type":16},{"name":14,"slug":15,"type":16},"2026-07-16T06:04:13.597905",{"slug":10501,"name":10501,"fn":10502,"description":10503,"org":10504,"tags":10505,"stars":24,"repoUrl":25,"updatedAt":10514},"ai-core","configure TanStack AI agent features","Entry point for TanStack AI skills. Routes to chat-experience, tool-calling, media-generation, structured-outputs, adapter-configuration, ag-ui-protocol, middleware, locks, custom-backend-integration, and debug-logging, plus the skills shipped by companion packages (@tanstack\u002Fai-persistence, @tanstack\u002Fai-code-mode). Use chat() not streamText(), openaiText() not createOpenAI(), toServerSentEventsResponse() not manual SSE, middleware hooks not onEnd callbacks.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10506,10509,10511],{"name":10507,"slug":10508,"type":16},"Agents","agents",{"name":10510,"slug":30,"type":16},"AI",{"name":10512,"slug":10513,"type":16},"Middleware","middleware","2026-07-30T05:26:10.404565",{"slug":10516,"name":10517,"fn":10518,"description":10519,"org":10520,"tags":10521,"stars":24,"repoUrl":25,"updatedAt":10529},"ai-coreadapter-configuration","ai-core\u002Fadapter-configuration","configure AI provider adapters","Provider adapter selection and configuration: openaiText, anthropicText, geminiText, ollamaText, grokText, groqText, openRouterText, bedrockText, openaiCompatible. Per-model type safety with modelOptions, reasoning\u002Fthinking configuration, runtime adapter switching, extendAdapter() for custom models, createModel(). Generic OpenAI-compatible providers (DeepSeek, Together, Fireworks, etc.) via openaiCompatible({ baseURL, apiKey, models }) from @tanstack\u002Fai-openai\u002Fcompatible. API key env vars: OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_API_KEY\u002FGEMINI_API_KEY, XAI_API_KEY, GROQ_API_KEY, OPENROUTER_API_KEY, OLLAMA_HOST, BEDROCK_API_KEY (or AWS_BEARER_TOKEN_BEDROCK).\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10522,10523,10526,10528],{"name":21,"slug":22,"type":16},{"name":10524,"slug":10525,"type":16},"Configuration","configuration",{"name":10527,"slug":37,"type":16},"LLM",{"name":10,"slug":9,"type":16},"2026-07-16T06:04:17.82075",{"slug":10531,"name":10532,"fn":10533,"description":10534,"org":10535,"tags":10536,"stars":24,"repoUrl":25,"updatedAt":10542},"ai-coreag-ui-protocol","ai-core\u002Fag-ui-protocol","implement TanStack AI streaming protocol","Server-side AG-UI streaming protocol implementation: StreamChunk event types (RUN_STARTED, TEXT_MESSAGE_START\u002FCONTENT\u002FEND, TOOL_CALL_START\u002FARGS\u002FEND, RUN_FINISHED, RUN_ERROR, STEP_STARTED\u002FSTEP_FINISHED, STATE_SNAPSHOT\u002FDELTA, CUSTOM), toServerSentEventsStream() for SSE format, toHttpStream() for NDJSON format. For backends serving AG-UI events without client packages.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10537,10540,10541],{"name":10538,"slug":10539,"type":16},"API Development","api-development",{"name":10527,"slug":37,"type":16},{"name":10,"slug":9,"type":16},"2026-07-16T06:04:10.093367",{"slug":10544,"name":10545,"fn":10546,"description":10547,"org":10548,"tags":10549,"stars":24,"repoUrl":25,"updatedAt":10554},"ai-corechat-experience","ai-core\u002Fchat-experience","implement chat experiences with TanStack AI","End-to-end chat implementation: server endpoint with chat() and toServerSentEventsResponse(), client-side useChat hook with fetchServerSentEvents(), message rendering with UIMessage parts, multimodal content, thinking\u002Freasoning display. Covers streaming states, connection adapters, and message format conversions. NOT Vercel AI SDK — uses chat() not streamText().\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10550,10551,10552,10553],{"name":10538,"slug":10539,"type":16},{"name":10350,"slug":10351,"type":16},{"name":10527,"slug":37,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:26:11.505241",{"slug":10556,"name":10557,"fn":10558,"description":10559,"org":10560,"tags":10561,"stars":24,"repoUrl":25,"updatedAt":10568},"ai-coreclient-persistence","ai-core\u002Fclient-persistence","implement browser chat persistence for TanStack AI","Browser chat persistence on useChat \u002F ChatClient: localStoragePersistence, sessionStoragePersistence, indexedDBPersistence. Client-authoritative (adapter, full transcript) vs server-authoritative (persistence: true, no client cache). Reload restore, pending interrupts, mid-stream rejoin with delivery durability. Use for SPA reload durability — NOT server history alone. No extra package: the adapters ship in the framework packages.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10562,10563,10564,10567],{"name":10510,"slug":30,"type":16},{"name":10350,"slug":10351,"type":16},{"name":10565,"slug":10566,"type":16},"Persistence","persistence",{"name":10,"slug":9,"type":16},"2026-07-30T05:53:35.503176",{"slug":10570,"name":10571,"fn":10572,"description":10573,"org":10574,"tags":10575,"stars":24,"repoUrl":25,"updatedAt":10582},"ai-corecustom-backend-integration","ai-core\u002Fcustom-backend-integration","integrate custom backends with TanStack AI","Connect useChat to a non-TanStack-AI backend through custom connection adapters. ConnectConnectionAdapter (single async iterable) vs SubscribeConnectionAdapter (separate subscribe\u002Fsend). Customize fetchServerSentEvents() and fetchHttpStream() with auth headers, custom URLs, and request options. Import from framework package, not @tanstack\u002Fai-client.\n",{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[10576,10577,10578,10581],{"name":10510,"slug":30,"type":16},{"name":10538,"slug":10539,"type":16},{"name":10579,"slug":10580,"type":16},"Backend","backend",{"name":10,"slug":9,"type":16},"2026-07-17T06:06:39.855351"]