[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-tanstack-ai-coreadapter-configuration":3,"mdc-5m2op-key":52,"related-org-tanstack-ai-coreadapter-configuration":7150,"related-repo-tanstack-ai-coreadapter-configuration":7294},{"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-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},"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},"Configuration","configuration","tag",{"name":18,"slug":19,"type":16},"LLM","llm",{"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.82075",null,269,[30,31,22,32,33,34,35,36,19,37,38,39,40,41,42,9,43,44,45,46],"ai","ai-agents","anthropic","chatbot","function-calling","gemini","generative-ai","multimodal","openai","react","solidjs","streaming","svelte","tool-calling","typescript","typescript-sdk","vue",{"repoUrl":25,"stars":24,"forks":28,"topics":48,"description":49},[30,31,22,32,33,34,35,36,19,37,38,39,40,41,42,9,43,44,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\u002Fadapter-configuration","---\nname: ai-core\u002Fadapter-configuration\ndescription: >\n  Provider adapter selection and configuration: openaiText, anthropicText,\n  geminiText, ollamaText, grokText, groqText, openRouterText, bedrockText,\n  openaiCompatible. Per-model type safety with modelOptions, reasoning\u002Fthinking configuration,\n  runtime adapter switching, extendAdapter() for custom models, createModel().\n  Generic OpenAI-compatible providers (DeepSeek, Together, Fireworks, etc.) via\n  openaiCompatible({ baseURL, apiKey, models }) from @tanstack\u002Fai-openai\u002Fcompatible.\n  API key env vars: OPENAI_API_KEY, ANTHROPIC_API_KEY, GOOGLE_API_KEY\u002FGEMINI_API_KEY,\n  XAI_API_KEY, GROQ_API_KEY, OPENROUTER_API_KEY, OLLAMA_HOST,\n  BEDROCK_API_KEY (or AWS_BEARER_TOKEN_BEDROCK).\ntype: sub-skill\nlibrary: tanstack-ai\nlibrary_version: '0.10.0'\nsources:\n  - 'TanStack\u002Fai:docs\u002Fadapters\u002Fopenai.md'\n  - 'TanStack\u002Fai:docs\u002Fadapters\u002Fanthropic.md'\n  - 'TanStack\u002Fai:docs\u002Fadapters\u002Fgemini.md'\n  - 'TanStack\u002Fai:docs\u002Fadapters\u002Follama.md'\n  - 'TanStack\u002Fai:docs\u002Fadvanced\u002Fper-model-type-safety.md'\n  - 'TanStack\u002Fai:docs\u002Fadvanced\u002Fruntime-adapter-switching.md'\n  - 'TanStack\u002Fai:docs\u002Fadvanced\u002Fextend-adapter.md'\n---\n\n# Adapter Configuration\n\n> **Dependency:** This skill builds on ai-core. Read it first for critical rules.\n\n> **Before implementing:** Ask the user which provider and model they want.\n> Then fetch the latest available models from the provider's source code\n> (check the adapter's model metadata file, e.g. `packages\u002Fai-openai\u002Fsrc\u002Fmodel-meta.ts`)\n> or from the provider's API\u002Fdocs to recommend the most current model.\n> The model lists in this skill and its reference files may be outdated.\n> Always verify against the source before recommending a specific model.\n\n## Setup\n\nCreate an adapter and use it with `chat()`:\n\n```typescript\nimport { chat, toServerSentEventsResponse } from '@tanstack\u002Fai'\nimport { openaiText } from '@tanstack\u002Fai-openai'\n\nconst stream = chat({\n  adapter: openaiText('gpt-5.2'),\n  messages,\n  modelOptions: {\n    temperature: 0.7,\n    max_output_tokens: 1000,\n  },\n})\n\nreturn toServerSentEventsResponse(stream)\n```\n\nThe adapter factory function takes the model name as a string literal and an\noptional config object (API key, base URL, etc.). The model name is passed\ninto the factory, not into `chat()`.\n\nSampling options (`temperature`, token limits, `top_p`\u002F`topP`, etc.) live\ninside `modelOptions` using each provider's native key — they are **not**\ntop-level options on `chat()`. See the per-provider table in\n[Configuring Sampling](#5-configuring-sampling) below.\n\n## Core Patterns\n\n### 1. Adapter Selection\n\nEach provider has a dedicated package with tree-shakeable adapter factories.\nThe text adapter is the primary one for chat\u002Fcompletions:\n\n| Provider          | Package                          | Factory                                     | Env Var                                           |\n| ----------------- | -------------------------------- | ------------------------------------------- | ------------------------------------------------- |\n| OpenAI            | `@tanstack\u002Fai-openai`            | `openaiText`                                | `OPENAI_API_KEY`                                  |\n| Anthropic         | `@tanstack\u002Fai-anthropic`         | `anthropicText`                             | `ANTHROPIC_API_KEY`                               |\n| Gemini            | `@tanstack\u002Fai-gemini`            | `geminiText`                                | `GOOGLE_API_KEY` or `GEMINI_API_KEY`              |\n| Grok (xAI)        | `@tanstack\u002Fai-grok`              | `grokText`                                  | `XAI_API_KEY`                                     |\n| Groq              | `@tanstack\u002Fai-groq`              | `groqText`                                  | `GROQ_API_KEY`                                    |\n| OpenRouter        | `@tanstack\u002Fai-openrouter`        | `openRouterText`                            | `OPENROUTER_API_KEY`                              |\n| Ollama            | `@tanstack\u002Fai-ollama`            | `ollamaText`                                | `OLLAMA_HOST` (default: `http:\u002F\u002Flocalhost:11434`) |\n| Bedrock           | `@tanstack\u002Fai-bedrock`           | `bedrockText`                               | `BEDROCK_API_KEY` or `AWS_BEARER_TOKEN_BEDROCK`   |\n| OpenAI-compatible | `@tanstack\u002Fai-openai\u002Fcompatible` | `openaiCompatible` \u002F `openaiCompatibleText` | provider-specific (passed via `apiKey`)           |\n\n```typescript\n\u002F\u002F Each factory takes model as first arg, optional config as second\nimport { openaiText } from '@tanstack\u002Fai-openai'\nimport { anthropicText } from '@tanstack\u002Fai-anthropic'\nimport { geminiText } from '@tanstack\u002Fai-gemini'\nimport { grokText } from '@tanstack\u002Fai-grok'\nimport { groqText } from '@tanstack\u002Fai-groq'\nimport { openRouterText } from '@tanstack\u002Fai-openrouter'\nimport { ollamaText } from '@tanstack\u002Fai-ollama'\nimport { bedrockText } from '@tanstack\u002Fai-bedrock'\n\n\u002F\u002F Model string is passed to the factory, NOT to chat()\nconst adapter = openaiText('gpt-5.2')\nconst adapter2 = anthropicText('claude-sonnet-4-6')\nconst adapter3 = geminiText('gemini-2.5-pro')\nconst adapter4 = grokText('grok-4')\nconst adapter5 = groqText('llama-3.3-70b-versatile')\nconst adapter6 = openRouterText('anthropic\u002Fclaude-sonnet-4')\nconst adapter7 = ollamaText('llama3.3')\nconst adapter8 = bedrockText('us.anthropic.claude-3-7-sonnet-20250219-v1:0')\n\n\u002F\u002F Optional: pass explicit API key\nconst adapterWithKey = openaiText('gpt-5.2', {\n  apiKey: 'sk-...',\n})\n```\n\n`@tanstack\u002Fai-bedrock` (Amazon Bedrock) branches on `config.api`:\n\n- `bedrockText(model)` or `bedrockText(model, { api: 'converse' })` (the default) — Bedrock's native Converse API via `@aws-sdk\u002Fclient-bedrock-runtime` (adapter name `bedrock-converse`). Reaches the broad catalog: Claude, Nova, Llama, Mistral, DeepSeek, and more.\n- `bedrockText(model, { api: 'chat' })` — OpenAI-compatible Chat Completions endpoint (adapter name `bedrock`). Open-weight models only (gpt-oss, DeepSeek V3.x, Gemma, Qwen, etc.). Does NOT reach Claude, Nova, or Llama.\n- `bedrockText(model, { api: 'responses' })` — OpenAI-compatible Responses API, mantle-only (adapter name `bedrock-responses`). Currently gpt-oss family.\n\nUse `createBedrockText(model, apiKey, config?)` to pass the key explicitly. Auth resolves from `BEDROCK_API_KEY` \u002F `AWS_BEARER_TOKEN_BEDROCK`, or SigV4 via the standard AWS credential chain (no extra packages needed — handled by `@aws-sdk\u002Fclient-bedrock-runtime`).\n\n### 2. Runtime Adapter Switching\n\nUse an adapter factory map to switch providers dynamically based on user\ninput or configuration:\n\n```typescript\nimport { chat, toServerSentEventsResponse } from '@tanstack\u002Fai'\nimport type { TextAdapter } from '@tanstack\u002Fai\u002Fadapters'\nimport { openaiText } from '@tanstack\u002Fai-openai'\nimport { anthropicText } from '@tanstack\u002Fai-anthropic'\nimport { geminiText } from '@tanstack\u002Fai-gemini'\n\n\u002F\u002F Define a map of provider+model to adapter factory calls\nconst adapters: Record\u003Cstring, () => TextAdapter> = {\n  'openai\u002Fgpt-5.2': () => openaiText('gpt-5.2'),\n  'anthropic\u002Fclaude-sonnet-4-6': () => anthropicText('claude-sonnet-4-6'),\n  'gemini\u002Fgemini-2.5-pro': () => geminiText('gemini-2.5-pro'),\n}\n\nexport function handleChat(providerModel: string, messages: Array\u003Cany>) {\n  const createAdapter = adapters[providerModel]\n  if (!createAdapter) {\n    throw new Error(`Unknown provider\u002Fmodel: ${providerModel}`)\n  }\n\n  const stream = chat({\n    adapter: createAdapter(),\n    messages,\n  })\n\n  return toServerSentEventsResponse(stream)\n}\n```\n\n### 3. Configuring Reasoning \u002F Thinking\n\nDifferent providers expose reasoning\u002Fthinking through their `modelOptions`:\n\n```typescript\nimport { chat } from '@tanstack\u002Fai'\nimport { openaiText } from '@tanstack\u002Fai-openai'\nimport { anthropicText } from '@tanstack\u002Fai-anthropic'\nimport { geminiText } from '@tanstack\u002Fai-gemini'\n\n\u002F\u002F OpenAI: reasoning with effort and summary\nconst openaiStream = chat({\n  adapter: openaiText('gpt-5.2'),\n  messages,\n  modelOptions: {\n    reasoning: {\n      effort: 'high',\n      summary: 'auto',\n    },\n  },\n})\n\n\u002F\u002F Anthropic: extended thinking with budget_tokens\nconst anthropicStream = chat({\n  adapter: anthropicText('claude-sonnet-4-6'),\n  messages,\n  modelOptions: {\n    max_tokens: 16000,\n    thinking: {\n      type: 'enabled',\n      budget_tokens: 8000, \u002F\u002F must be >= 1024 and \u003C max_tokens\n    },\n  },\n})\n\n\u002F\u002F Anthropic: adaptive thinking (claude-sonnet-4-6 and newer)\nconst adaptiveStream = chat({\n  adapter: anthropicText('claude-sonnet-4-6'),\n  messages,\n  modelOptions: {\n    max_tokens: 16000,\n    thinking: {\n      type: 'adaptive',\n    },\n    effort: 'high', \u002F\u002F 'max' | 'high' | 'medium' | 'low'\n  },\n})\n\n\u002F\u002F Gemini: thinking config with budget or level\nconst geminiStream = chat({\n  adapter: geminiText('gemini-2.5-pro'),\n  messages,\n  modelOptions: {\n    thinkingConfig: {\n      includeThoughts: true,\n      thinkingBudget: 4096,\n    },\n  },\n})\n```\n\n### 4. Extending Adapters with Custom Models\n\nUse `extendAdapter()` and `createModel()` to add custom or fine-tuned models\nwhile preserving type safety for the original models:\n\n```typescript\nimport { extendAdapter, createModel } from '@tanstack\u002Fai'\nimport { openaiText } from '@tanstack\u002Fai-openai'\n\n\u002F\u002F Define custom models\nconst customModels = [\n  createModel('ft:gpt-5.2:my-org:custom-model:abc123', ['text', 'image']),\n  createModel('my-local-proxy-model', ['text']),\n] as const\n\n\u002F\u002F Create extended factory - original models still fully typed\nconst myOpenai = extendAdapter(openaiText, customModels)\n\n\u002F\u002F Use original models - full type inference preserved\nconst gpt5 = myOpenai('gpt-5.2')\n\n\u002F\u002F Use custom models - accepted by the type system\nconst custom = myOpenai('ft:gpt-5.2:my-org:custom-model:abc123')\n\n\u002F\u002F Type error: 'nonexistent-model' is not a valid model\n\u002F\u002F myOpenai('nonexistent-model')\n```\n\nAt runtime, `extendAdapter` simply passes through to the original factory.\nThe `_customModels` parameter is only used for type inference.\n\n### 5. Configuring Sampling\n\nSampling controls (`temperature`, token limits, nucleus sampling) are passed\ninside `modelOptions` using each provider's **native** key. They are not\ntop-level fields on `chat()`\u002F`ai()`\u002F`generate()`.\n\n```typescript\n\u002F\u002F OpenAI — native keys\nchat({\n  adapter: openaiText('gpt-5.2'),\n  messages,\n  modelOptions: { temperature: 0.7, top_p: 0.9, max_output_tokens: 1000 },\n})\n\n\u002F\u002F Anthropic\nchat({\n  adapter: anthropicText('claude-sonnet-4-6'),\n  messages,\n  modelOptions: { temperature: 0.7, top_p: 0.9, max_tokens: 1000 },\n})\n\n\u002F\u002F Gemini — camelCase\nchat({\n  adapter: geminiText('gemini-2.5-pro'),\n  messages,\n  modelOptions: { temperature: 0.7, topP: 0.9, maxOutputTokens: 1000 },\n})\n\n\u002F\u002F Ollama — NESTED under modelOptions.options\nchat({\n  adapter: ollamaText('llama3.3'),\n  messages,\n  modelOptions: {\n    options: { temperature: 0.7, top_p: 0.9, num_predict: 1000 },\n  },\n})\n```\n\nPer-provider sampling keys (all live inside `modelOptions`):\n\n| Provider          | Temperature   | Nucleus | Max output tokens                   |\n| ----------------- | ------------- | ------- | ----------------------------------- |\n| OpenAI            | `temperature` | `top_p` | `max_output_tokens`                 |\n| Anthropic         | `temperature` | `top_p` | `max_tokens`                        |\n| Gemini            | `temperature` | `topP`  | `maxOutputTokens`                   |\n| Grok (xAI)        | `temperature` | `top_p` | `max_tokens`                        |\n| Groq              | `temperature` | `top_p` | `max_completion_tokens`             |\n| OpenRouter (chat) | `temperature` | `topP`  | `maxCompletionTokens`               |\n| Ollama            | `temperature` | `top_p` | `num_predict` (nested in `options`) |\n\n`temperature` is the one key every provider names identically; token limits and\nsome sampling options use provider-native names. Ollama nests all sampling under\n`modelOptions.options`.\n\n> **Anthropic `max_tokens` default:** Anthropic's API _requires_ `max_tokens`,\n> so the adapter always sends one. When you omit `modelOptions.max_tokens`, it\n> defaults to the selected model's full output ceiling (its `max_output_tokens`\n> from model metadata — e.g. 64K for Sonnet, 128K for Opus), not a low constant.\n> `max_tokens` is a ceiling, not a reservation (billing is per token generated),\n> so leaving it unset is the right default for codegen \u002F agentic \u002F long-form\n> output and avoids silent `stop_reason: \"max_tokens\"` truncation. Set it only to\n> cap output below the model ceiling. Other providers treat token limits as\n> optional and don't apply this flooring.\n\n### 6. Capability Flag: `supportsCombinedToolsAndSchema`\n\nAdapters can declare an optional capability method:\n\n```ts\nsupportsCombinedToolsAndSchema?(modelOptions?: TProviderOptions): boolean\n```\n\nWhen `true`, the engine wires `outputSchema` into the regular\n`chatStream` call alongside `tools` and harvests the schema-constrained\nJSON from the agent loop's final-turn text — skipping the separate\n`structuredOutput` \u002F `structuredOutputStream` finalization round-trip.\nWhen `false` (or the method is omitted), the legacy finalization path\nruns.\n\nCurrent per-adapter status (#605):\n\n| Adapter                                      | Returns                                                                                           |\n| -------------------------------------------- | ------------------------------------------------------------------------------------------------- |\n| `openaiText` \u002F `openaiChatCompletions`       | `true` (all supported models)                                                                     |\n| `anthropicText`                              | `true` for Claude 4.5+ (gated by `ANTHROPIC_COMBINED_TOOLS_AND_SCHEMA_MODELS`), `false` otherwise |\n| `geminiText`                                 | `true` for Gemini 3.x (gated by `GEMINI_COMBINED_TOOLS_AND_SCHEMA_MODELS`), `false` otherwise     |\n| `grokText`                                   | `true` for Grok 4 family (gated by `GROK_COMBINED_TOOLS_AND_SCHEMA_MODELS`), `false` otherwise    |\n| `groqText`                                   | `false` (Groq API rejects schema + tools + stream)                                                |\n| `openRouterText` \u002F `openRouterResponsesText` | `false` (per-call resolution is a follow-up)                                                      |\n| `ollamaText`                                 | `false` (constrained-decoding vs tool-call grammar conflict)                                      |\n\nSubclasses can override to narrow the capability. When extending an\nadapter for a custom model that doesn't support the combination, return\n`false` explicitly.\n\n### 6. OpenAI-Compatible Providers\n\nAny provider that implements the OpenAI **Chat Completions** API (DeepSeek,\nMoonshot\u002FKimi, Together, Fireworks, Cerebras, Qwen\u002FDashScope, Perplexity,\nNVIDIA NIM, LM Studio, etc.) can be used through the generic\n`openaiCompatible` factory from `@tanstack\u002Fai-openai\u002Fcompatible` — no\ndedicated package required.\n\n```typescript\nimport { openaiCompatible } from '@tanstack\u002Fai-openai\u002Fcompatible'\nimport { createModel } from '@tanstack\u002Fai'\n\n\u002F\u002F Provider-factory: configure baseURL + apiKey + models ONCE,\n\u002F\u002F then select a model per call (the model arg is a type-safe union).\nconst deepseek = openaiCompatible({\n  name: 'deepseek', \u002F\u002F optional label for devtools\u002Ferrors (default 'openai-compatible')\n  baseURL: 'https:\u002F\u002Fapi.deepseek.com\u002Fv1',\n  apiKey: process.env.DEEPSEEK_API_KEY!,\n  models: [\n    'deepseek-chat', \u002F\u002F bare string → optimistic defaults: text\u002Fimage in, streaming, tools, structured output\n    createModel('deepseek-reasoner', {\n      \u002F\u002F rich def → precise per-model capabilities\n      input: ['text'],\n      features: ['reasoning', 'structured_outputs'],\n    }),\n  ],\n})\n\nchat({ adapter: deepseek('deepseek-chat'), messages })\nchat({ adapter: deepseek('deepseek-reasoner'), messages })\n```\n\n`config` also accepts any OpenAI SDK `ClientOptions` (notably `defaultHeaders`\nand `defaultQuery`) for providers that need extra auth headers or query params.\n\nFor a single model, use the one-shot helper:\n\n```typescript\nimport { openaiCompatibleText } from '@tanstack\u002Fai-openai\u002Fcompatible'\n\nchat({\n  adapter: openaiCompatibleText('deepseek-chat', {\n    baseURL: 'https:\u002F\u002Fapi.deepseek.com\u002Fv1',\n    apiKey: process.env.DEEPSEEK_API_KEY!,\n  }),\n  messages,\n})\n```\n\nPass `api: 'responses'` to target the OpenAI **Responses** API instead of Chat\nCompletions (only for the rare compatible provider that implements it, e.g.\nAzure OpenAI); the default is `'chat-completions'`, which is what nearly all\ncompatible providers speak.\n\n> Verify the provider's current `baseURL` and model ids against its live docs —\n> they drift. See `docs\u002Fadapters\u002Fopenai-compatible.md` for the full provider table.\n\n## Common Mistakes\n\n### a. HIGH: Confusing legacy monolithic with tree-shakeable adapter\n\nThe legacy `openai()` (and `anthropic()`, etc.) monolithic adapters are\ndeprecated. They take the model in `chat()`, not in the factory.\n\n```typescript\n\u002F\u002F WRONG: Legacy monolithic adapter pattern\nimport { openai } from '@tanstack\u002Fai-openai'\nchat({ adapter: openai(), model: 'gpt-5.2', messages })\n\n\u002F\u002F CORRECT: Tree-shakeable adapter, model in factory\nimport { openaiText } from '@tanstack\u002Fai-openai'\nchat({ adapter: openaiText('gpt-5.2'), messages })\n```\n\nSource: docs\u002Fmigration\u002Fmigration.md\n\n### b. MEDIUM: Wrong API key environment variable name\n\nEach provider uses a specific env var name. Using the wrong one causes a\nruntime error:\n\n| Provider   | Correct Env Var                                | Common Mistake                                                           |\n| ---------- | ---------------------------------------------- | ------------------------------------------------------------------------ |\n| OpenAI     | `OPENAI_API_KEY`                               |                                                                          |\n| Anthropic  | `ANTHROPIC_API_KEY`                            |                                                                          |\n| Gemini     | `GOOGLE_API_KEY` or `GEMINI_API_KEY`           | `GOOGLE_GENAI_API_KEY` (does not work)                                   |\n| Grok (xAI) | `XAI_API_KEY`                                  | `GROK_API_KEY` (does not work)                                           |\n| Groq       | `GROQ_API_KEY`                                 |                                                                          |\n| OpenRouter | `OPENROUTER_API_KEY`                           |                                                                          |\n| Ollama     | `OLLAMA_HOST`                                  | No API key needed, just the host URL (default: `http:\u002F\u002Flocalhost:11434`) |\n| Bedrock    | `BEDROCK_API_KEY` \u002F `AWS_BEARER_TOKEN_BEDROCK` | Falls back to SigV4 credentials when no API key is set                   |\n\nSource: adapter source code (`utils\u002Fclient.ts` in each adapter package).\n\n## References\n\nDetailed per-adapter reference files:\n\n- [OpenAI Adapter](references\u002Fopenai-adapter.md)\n- [Anthropic Adapter](references\u002Fanthropic-adapter.md)\n- [Gemini Adapter](references\u002Fgemini-adapter.md)\n- [Ollama Adapter](references\u002Follama-adapter.md)\n- [Grok Adapter](references\u002Fgrok-adapter.md)\n- [Groq Adapter](references\u002Fgroq-adapter.md)\n- [OpenRouter Adapter](references\u002Fopenrouter-adapter.md)\n\n## Tension\n\n**HIGH Tension: Type safety vs. quick prototyping** -- Per-model type safety\nrequires specific model string literals. Quick prototyping wants dynamic\nselection with `string` variables. Agents optimizing for quick setup silently\nlose type safety. If model names come from user input or config files, use\n`extendAdapter()` to add custom names.\n\n## Cross-References\n\n- See also: `ai-core\u002Fchat-experience\u002FSKILL.md` -- Adapter choice affects chat setup\n- See also: `ai-core\u002Fstructured-outputs\u002FSKILL.md` -- `outputSchema` handles provider differences transparently\n",{"data":53,"body":65},{"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,63,64],"TanStack\u002Fai:docs\u002Fadapters\u002Fopenai.md","TanStack\u002Fai:docs\u002Fadapters\u002Fanthropic.md","TanStack\u002Fai:docs\u002Fadapters\u002Fgemini.md","TanStack\u002Fai:docs\u002Fadapters\u002Follama.md","TanStack\u002Fai:docs\u002Fadvanced\u002Fper-model-type-safety.md","TanStack\u002Fai:docs\u002Fadvanced\u002Fruntime-adapter-switching.md","TanStack\u002Fai:docs\u002Fadvanced\u002Fextend-adapter.md",{"type":66,"children":67},"root",[68,77,93,115,122,135,459,471,531,537,544,549,936,1691,1708,1785,1818,1824,1829,2612,2618,2629,3657,3663,3683,4131,4152,4158,4204,4853,4865,5129,5146,5211,5223,5228,5273,5333,5338,5562,5574,5580,5606,6187,6222,6227,6432,6460,6484,6490,6496,6524,6760,6765,6771,6776,6983,6996,7002,7007,7073,7079,7103,7109,7144],{"type":69,"tag":70,"props":71,"children":73},"element","h1",{"id":72},"adapter-configuration",[74],{"type":75,"value":76},"text","Adapter Configuration",{"type":69,"tag":78,"props":79,"children":80},"blockquote",{},[81],{"type":69,"tag":82,"props":83,"children":84},"p",{},[85,91],{"type":69,"tag":86,"props":87,"children":88},"strong",{},[89],{"type":75,"value":90},"Dependency:",{"type":75,"value":92}," This skill builds on ai-core. Read it first for critical rules.",{"type":69,"tag":78,"props":94,"children":95},{},[96],{"type":69,"tag":82,"props":97,"children":98},{},[99,104,106,113],{"type":69,"tag":86,"props":100,"children":101},{},[102],{"type":75,"value":103},"Before implementing:",{"type":75,"value":105}," Ask the user which provider and model they want.\nThen fetch the latest available models from the provider's source code\n(check the adapter's model metadata file, e.g. ",{"type":69,"tag":107,"props":108,"children":110},"code",{"className":109},[],[111],{"type":75,"value":112},"packages\u002Fai-openai\u002Fsrc\u002Fmodel-meta.ts",{"type":75,"value":114},")\nor from the provider's API\u002Fdocs to recommend the most current model.\nThe model lists in this skill and its reference files may be outdated.\nAlways verify against the source before recommending a specific model.",{"type":69,"tag":116,"props":117,"children":119},"h2",{"id":118},"setup",[120],{"type":75,"value":121},"Setup",{"type":69,"tag":82,"props":123,"children":124},{},[125,127,133],{"type":75,"value":126},"Create an adapter and use it with ",{"type":69,"tag":107,"props":128,"children":130},{"className":129},[],[131],{"type":75,"value":132},"chat()",{"type":75,"value":134},":",{"type":69,"tag":136,"props":137,"children":141},"pre",{"className":138,"code":139,"language":44,"meta":140,"style":140},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { chat, toServerSentEventsResponse } from '@tanstack\u002Fai'\nimport { openaiText } from '@tanstack\u002Fai-openai'\n\nconst stream = chat({\n  adapter: openaiText('gpt-5.2'),\n  messages,\n  modelOptions: {\n    temperature: 0.7,\n    max_output_tokens: 1000,\n  },\n})\n\nreturn toServerSentEventsResponse(stream)\n","",[142],{"type":69,"tag":107,"props":143,"children":144},{"__ignoreMap":140},[145,205,243,253,288,334,347,365,388,410,419,433,441],{"type":69,"tag":146,"props":147,"children":150},"span",{"class":148,"line":149},"line",1,[151,157,163,169,174,179,184,189,194,200],{"type":69,"tag":146,"props":152,"children":154},{"style":153},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[155],{"type":75,"value":156},"import",{"type":69,"tag":146,"props":158,"children":160},{"style":159},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[161],{"type":75,"value":162}," {",{"type":69,"tag":146,"props":164,"children":166},{"style":165},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[167],{"type":75,"value":168}," chat",{"type":69,"tag":146,"props":170,"children":171},{"style":159},[172],{"type":75,"value":173},",",{"type":69,"tag":146,"props":175,"children":176},{"style":165},[177],{"type":75,"value":178}," toServerSentEventsResponse",{"type":69,"tag":146,"props":180,"children":181},{"style":159},[182],{"type":75,"value":183}," }",{"type":69,"tag":146,"props":185,"children":186},{"style":153},[187],{"type":75,"value":188}," from",{"type":69,"tag":146,"props":190,"children":191},{"style":159},[192],{"type":75,"value":193}," '",{"type":69,"tag":146,"props":195,"children":197},{"style":196},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[198],{"type":75,"value":199},"@tanstack\u002Fai",{"type":69,"tag":146,"props":201,"children":202},{"style":159},[203],{"type":75,"value":204},"'\n",{"type":69,"tag":146,"props":206,"children":208},{"class":148,"line":207},2,[209,213,217,222,226,230,234,239],{"type":69,"tag":146,"props":210,"children":211},{"style":153},[212],{"type":75,"value":156},{"type":69,"tag":146,"props":214,"children":215},{"style":159},[216],{"type":75,"value":162},{"type":69,"tag":146,"props":218,"children":219},{"style":165},[220],{"type":75,"value":221}," openaiText",{"type":69,"tag":146,"props":223,"children":224},{"style":159},[225],{"type":75,"value":183},{"type":69,"tag":146,"props":227,"children":228},{"style":153},[229],{"type":75,"value":188},{"type":69,"tag":146,"props":231,"children":232},{"style":159},[233],{"type":75,"value":193},{"type":69,"tag":146,"props":235,"children":236},{"style":196},[237],{"type":75,"value":238},"@tanstack\u002Fai-openai",{"type":69,"tag":146,"props":240,"children":241},{"style":159},[242],{"type":75,"value":204},{"type":69,"tag":146,"props":244,"children":246},{"class":148,"line":245},3,[247],{"type":69,"tag":146,"props":248,"children":250},{"emptyLinePlaceholder":249},true,[251],{"type":75,"value":252},"\n",{"type":69,"tag":146,"props":254,"children":256},{"class":148,"line":255},4,[257,263,268,273,278,283],{"type":69,"tag":146,"props":258,"children":260},{"style":259},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[261],{"type":75,"value":262},"const",{"type":69,"tag":146,"props":264,"children":265},{"style":165},[266],{"type":75,"value":267}," stream ",{"type":69,"tag":146,"props":269,"children":270},{"style":159},[271],{"type":75,"value":272},"=",{"type":69,"tag":146,"props":274,"children":276},{"style":275},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[277],{"type":75,"value":168},{"type":69,"tag":146,"props":279,"children":280},{"style":165},[281],{"type":75,"value":282},"(",{"type":69,"tag":146,"props":284,"children":285},{"style":159},[286],{"type":75,"value":287},"{\n",{"type":69,"tag":146,"props":289,"children":291},{"class":148,"line":290},5,[292,298,302,306,310,315,320,324,329],{"type":69,"tag":146,"props":293,"children":295},{"style":294},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[296],{"type":75,"value":297},"  adapter",{"type":69,"tag":146,"props":299,"children":300},{"style":159},[301],{"type":75,"value":134},{"type":69,"tag":146,"props":303,"children":304},{"style":275},[305],{"type":75,"value":221},{"type":69,"tag":146,"props":307,"children":308},{"style":165},[309],{"type":75,"value":282},{"type":69,"tag":146,"props":311,"children":312},{"style":159},[313],{"type":75,"value":314},"'",{"type":69,"tag":146,"props":316,"children":317},{"style":196},[318],{"type":75,"value":319},"gpt-5.2",{"type":69,"tag":146,"props":321,"children":322},{"style":159},[323],{"type":75,"value":314},{"type":69,"tag":146,"props":325,"children":326},{"style":165},[327],{"type":75,"value":328},")",{"type":69,"tag":146,"props":330,"children":331},{"style":159},[332],{"type":75,"value":333},",\n",{"type":69,"tag":146,"props":335,"children":337},{"class":148,"line":336},6,[338,343],{"type":69,"tag":146,"props":339,"children":340},{"style":165},[341],{"type":75,"value":342},"  messages",{"type":69,"tag":146,"props":344,"children":345},{"style":159},[346],{"type":75,"value":333},{"type":69,"tag":146,"props":348,"children":350},{"class":148,"line":349},7,[351,356,360],{"type":69,"tag":146,"props":352,"children":353},{"style":294},[354],{"type":75,"value":355},"  modelOptions",{"type":69,"tag":146,"props":357,"children":358},{"style":159},[359],{"type":75,"value":134},{"type":69,"tag":146,"props":361,"children":362},{"style":159},[363],{"type":75,"value":364}," {\n",{"type":69,"tag":146,"props":366,"children":368},{"class":148,"line":367},8,[369,374,378,384],{"type":69,"tag":146,"props":370,"children":371},{"style":294},[372],{"type":75,"value":373},"    temperature",{"type":69,"tag":146,"props":375,"children":376},{"style":159},[377],{"type":75,"value":134},{"type":69,"tag":146,"props":379,"children":381},{"style":380},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[382],{"type":75,"value":383}," 0.7",{"type":69,"tag":146,"props":385,"children":386},{"style":159},[387],{"type":75,"value":333},{"type":69,"tag":146,"props":389,"children":391},{"class":148,"line":390},9,[392,397,401,406],{"type":69,"tag":146,"props":393,"children":394},{"style":294},[395],{"type":75,"value":396},"    max_output_tokens",{"type":69,"tag":146,"props":398,"children":399},{"style":159},[400],{"type":75,"value":134},{"type":69,"tag":146,"props":402,"children":403},{"style":380},[404],{"type":75,"value":405}," 1000",{"type":69,"tag":146,"props":407,"children":408},{"style":159},[409],{"type":75,"value":333},{"type":69,"tag":146,"props":411,"children":413},{"class":148,"line":412},10,[414],{"type":69,"tag":146,"props":415,"children":416},{"style":159},[417],{"type":75,"value":418},"  },\n",{"type":69,"tag":146,"props":420,"children":422},{"class":148,"line":421},11,[423,428],{"type":69,"tag":146,"props":424,"children":425},{"style":159},[426],{"type":75,"value":427},"}",{"type":69,"tag":146,"props":429,"children":430},{"style":165},[431],{"type":75,"value":432},")\n",{"type":69,"tag":146,"props":434,"children":436},{"class":148,"line":435},12,[437],{"type":69,"tag":146,"props":438,"children":439},{"emptyLinePlaceholder":249},[440],{"type":75,"value":252},{"type":69,"tag":146,"props":442,"children":444},{"class":148,"line":443},13,[445,450,454],{"type":69,"tag":146,"props":446,"children":447},{"style":153},[448],{"type":75,"value":449},"return",{"type":69,"tag":146,"props":451,"children":452},{"style":275},[453],{"type":75,"value":178},{"type":69,"tag":146,"props":455,"children":456},{"style":165},[457],{"type":75,"value":458},"(stream)\n",{"type":69,"tag":82,"props":460,"children":461},{},[462,464,469],{"type":75,"value":463},"The adapter factory function takes the model name as a string literal and an\noptional config object (API key, base URL, etc.). The model name is passed\ninto the factory, not into ",{"type":69,"tag":107,"props":465,"children":467},{"className":466},[],[468],{"type":75,"value":132},{"type":75,"value":470},".",{"type":69,"tag":82,"props":472,"children":473},{},[474,476,482,484,490,492,498,500,506,508,513,515,520,522,529],{"type":75,"value":475},"Sampling options (",{"type":69,"tag":107,"props":477,"children":479},{"className":478},[],[480],{"type":75,"value":481},"temperature",{"type":75,"value":483},", token limits, ",{"type":69,"tag":107,"props":485,"children":487},{"className":486},[],[488],{"type":75,"value":489},"top_p",{"type":75,"value":491},"\u002F",{"type":69,"tag":107,"props":493,"children":495},{"className":494},[],[496],{"type":75,"value":497},"topP",{"type":75,"value":499},", etc.) live\ninside ",{"type":69,"tag":107,"props":501,"children":503},{"className":502},[],[504],{"type":75,"value":505},"modelOptions",{"type":75,"value":507}," using each provider's native key — they are ",{"type":69,"tag":86,"props":509,"children":510},{},[511],{"type":75,"value":512},"not",{"type":75,"value":514},"\ntop-level options on ",{"type":69,"tag":107,"props":516,"children":518},{"className":517},[],[519],{"type":75,"value":132},{"type":75,"value":521},". See the per-provider table in\n",{"type":69,"tag":523,"props":524,"children":526},"a",{"href":525},"#5-configuring-sampling",[527],{"type":75,"value":528},"Configuring Sampling",{"type":75,"value":530}," below.",{"type":69,"tag":116,"props":532,"children":534},{"id":533},"core-patterns",[535],{"type":75,"value":536},"Core Patterns",{"type":69,"tag":538,"props":539,"children":541},"h3",{"id":540},"_1-adapter-selection",[542],{"type":75,"value":543},"1. Adapter Selection",{"type":69,"tag":82,"props":545,"children":546},{},[547],{"type":75,"value":548},"Each provider has a dedicated package with tree-shakeable adapter factories.\nThe text adapter is the primary one for chat\u002Fcompletions:",{"type":69,"tag":550,"props":551,"children":552},"table",{},[553,582],{"type":69,"tag":554,"props":555,"children":556},"thead",{},[557],{"type":69,"tag":558,"props":559,"children":560},"tr",{},[561,567,572,577],{"type":69,"tag":562,"props":563,"children":564},"th",{},[565],{"type":75,"value":566},"Provider",{"type":69,"tag":562,"props":568,"children":569},{},[570],{"type":75,"value":571},"Package",{"type":69,"tag":562,"props":573,"children":574},{},[575],{"type":75,"value":576},"Factory",{"type":69,"tag":562,"props":578,"children":579},{},[580],{"type":75,"value":581},"Env Var",{"type":69,"tag":583,"props":584,"children":585},"tbody",{},[586,621,656,699,734,769,804,848,890],{"type":69,"tag":558,"props":587,"children":588},{},[589,595,603,612],{"type":69,"tag":590,"props":591,"children":592},"td",{},[593],{"type":75,"value":594},"OpenAI",{"type":69,"tag":590,"props":596,"children":597},{},[598],{"type":69,"tag":107,"props":599,"children":601},{"className":600},[],[602],{"type":75,"value":238},{"type":69,"tag":590,"props":604,"children":605},{},[606],{"type":69,"tag":107,"props":607,"children":609},{"className":608},[],[610],{"type":75,"value":611},"openaiText",{"type":69,"tag":590,"props":613,"children":614},{},[615],{"type":69,"tag":107,"props":616,"children":618},{"className":617},[],[619],{"type":75,"value":620},"OPENAI_API_KEY",{"type":69,"tag":558,"props":622,"children":623},{},[624,629,638,647],{"type":69,"tag":590,"props":625,"children":626},{},[627],{"type":75,"value":628},"Anthropic",{"type":69,"tag":590,"props":630,"children":631},{},[632],{"type":69,"tag":107,"props":633,"children":635},{"className":634},[],[636],{"type":75,"value":637},"@tanstack\u002Fai-anthropic",{"type":69,"tag":590,"props":639,"children":640},{},[641],{"type":69,"tag":107,"props":642,"children":644},{"className":643},[],[645],{"type":75,"value":646},"anthropicText",{"type":69,"tag":590,"props":648,"children":649},{},[650],{"type":69,"tag":107,"props":651,"children":653},{"className":652},[],[654],{"type":75,"value":655},"ANTHROPIC_API_KEY",{"type":69,"tag":558,"props":657,"children":658},{},[659,664,673,682],{"type":69,"tag":590,"props":660,"children":661},{},[662],{"type":75,"value":663},"Gemini",{"type":69,"tag":590,"props":665,"children":666},{},[667],{"type":69,"tag":107,"props":668,"children":670},{"className":669},[],[671],{"type":75,"value":672},"@tanstack\u002Fai-gemini",{"type":69,"tag":590,"props":674,"children":675},{},[676],{"type":69,"tag":107,"props":677,"children":679},{"className":678},[],[680],{"type":75,"value":681},"geminiText",{"type":69,"tag":590,"props":683,"children":684},{},[685,691,693],{"type":69,"tag":107,"props":686,"children":688},{"className":687},[],[689],{"type":75,"value":690},"GOOGLE_API_KEY",{"type":75,"value":692}," or ",{"type":69,"tag":107,"props":694,"children":696},{"className":695},[],[697],{"type":75,"value":698},"GEMINI_API_KEY",{"type":69,"tag":558,"props":700,"children":701},{},[702,707,716,725],{"type":69,"tag":590,"props":703,"children":704},{},[705],{"type":75,"value":706},"Grok (xAI)",{"type":69,"tag":590,"props":708,"children":709},{},[710],{"type":69,"tag":107,"props":711,"children":713},{"className":712},[],[714],{"type":75,"value":715},"@tanstack\u002Fai-grok",{"type":69,"tag":590,"props":717,"children":718},{},[719],{"type":69,"tag":107,"props":720,"children":722},{"className":721},[],[723],{"type":75,"value":724},"grokText",{"type":69,"tag":590,"props":726,"children":727},{},[728],{"type":69,"tag":107,"props":729,"children":731},{"className":730},[],[732],{"type":75,"value":733},"XAI_API_KEY",{"type":69,"tag":558,"props":735,"children":736},{},[737,742,751,760],{"type":69,"tag":590,"props":738,"children":739},{},[740],{"type":75,"value":741},"Groq",{"type":69,"tag":590,"props":743,"children":744},{},[745],{"type":69,"tag":107,"props":746,"children":748},{"className":747},[],[749],{"type":75,"value":750},"@tanstack\u002Fai-groq",{"type":69,"tag":590,"props":752,"children":753},{},[754],{"type":69,"tag":107,"props":755,"children":757},{"className":756},[],[758],{"type":75,"value":759},"groqText",{"type":69,"tag":590,"props":761,"children":762},{},[763],{"type":69,"tag":107,"props":764,"children":766},{"className":765},[],[767],{"type":75,"value":768},"GROQ_API_KEY",{"type":69,"tag":558,"props":770,"children":771},{},[772,777,786,795],{"type":69,"tag":590,"props":773,"children":774},{},[775],{"type":75,"value":776},"OpenRouter",{"type":69,"tag":590,"props":778,"children":779},{},[780],{"type":69,"tag":107,"props":781,"children":783},{"className":782},[],[784],{"type":75,"value":785},"@tanstack\u002Fai-openrouter",{"type":69,"tag":590,"props":787,"children":788},{},[789],{"type":69,"tag":107,"props":790,"children":792},{"className":791},[],[793],{"type":75,"value":794},"openRouterText",{"type":69,"tag":590,"props":796,"children":797},{},[798],{"type":69,"tag":107,"props":799,"children":801},{"className":800},[],[802],{"type":75,"value":803},"OPENROUTER_API_KEY",{"type":69,"tag":558,"props":805,"children":806},{},[807,812,821,830],{"type":69,"tag":590,"props":808,"children":809},{},[810],{"type":75,"value":811},"Ollama",{"type":69,"tag":590,"props":813,"children":814},{},[815],{"type":69,"tag":107,"props":816,"children":818},{"className":817},[],[819],{"type":75,"value":820},"@tanstack\u002Fai-ollama",{"type":69,"tag":590,"props":822,"children":823},{},[824],{"type":69,"tag":107,"props":825,"children":827},{"className":826},[],[828],{"type":75,"value":829},"ollamaText",{"type":69,"tag":590,"props":831,"children":832},{},[833,839,841,847],{"type":69,"tag":107,"props":834,"children":836},{"className":835},[],[837],{"type":75,"value":838},"OLLAMA_HOST",{"type":75,"value":840}," (default: ",{"type":69,"tag":107,"props":842,"children":844},{"className":843},[],[845],{"type":75,"value":846},"http:\u002F\u002Flocalhost:11434",{"type":75,"value":328},{"type":69,"tag":558,"props":849,"children":850},{},[851,856,865,874],{"type":69,"tag":590,"props":852,"children":853},{},[854],{"type":75,"value":855},"Bedrock",{"type":69,"tag":590,"props":857,"children":858},{},[859],{"type":69,"tag":107,"props":860,"children":862},{"className":861},[],[863],{"type":75,"value":864},"@tanstack\u002Fai-bedrock",{"type":69,"tag":590,"props":866,"children":867},{},[868],{"type":69,"tag":107,"props":869,"children":871},{"className":870},[],[872],{"type":75,"value":873},"bedrockText",{"type":69,"tag":590,"props":875,"children":876},{},[877,883,884],{"type":69,"tag":107,"props":878,"children":880},{"className":879},[],[881],{"type":75,"value":882},"BEDROCK_API_KEY",{"type":75,"value":692},{"type":69,"tag":107,"props":885,"children":887},{"className":886},[],[888],{"type":75,"value":889},"AWS_BEARER_TOKEN_BEDROCK",{"type":69,"tag":558,"props":891,"children":892},{},[893,898,907,924],{"type":69,"tag":590,"props":894,"children":895},{},[896],{"type":75,"value":897},"OpenAI-compatible",{"type":69,"tag":590,"props":899,"children":900},{},[901],{"type":69,"tag":107,"props":902,"children":904},{"className":903},[],[905],{"type":75,"value":906},"@tanstack\u002Fai-openai\u002Fcompatible",{"type":69,"tag":590,"props":908,"children":909},{},[910,916,918],{"type":69,"tag":107,"props":911,"children":913},{"className":912},[],[914],{"type":75,"value":915},"openaiCompatible",{"type":75,"value":917}," \u002F ",{"type":69,"tag":107,"props":919,"children":921},{"className":920},[],[922],{"type":75,"value":923},"openaiCompatibleText",{"type":69,"tag":590,"props":925,"children":926},{},[927,929,935],{"type":75,"value":928},"provider-specific (passed via ",{"type":69,"tag":107,"props":930,"children":932},{"className":931},[],[933],{"type":75,"value":934},"apiKey",{"type":75,"value":328},{"type":69,"tag":136,"props":937,"children":939},{"className":138,"code":938,"language":44,"meta":140,"style":140},"\u002F\u002F Each factory takes model as first arg, optional config as second\nimport { openaiText } from '@tanstack\u002Fai-openai'\nimport { anthropicText } from '@tanstack\u002Fai-anthropic'\nimport { geminiText } from '@tanstack\u002Fai-gemini'\nimport { grokText } from '@tanstack\u002Fai-grok'\nimport { groqText } from '@tanstack\u002Fai-groq'\nimport { openRouterText } from '@tanstack\u002Fai-openrouter'\nimport { ollamaText } from '@tanstack\u002Fai-ollama'\nimport { bedrockText } from '@tanstack\u002Fai-bedrock'\n\n\u002F\u002F Model string is passed to the factory, NOT to chat()\nconst adapter = openaiText('gpt-5.2')\nconst adapter2 = anthropicText('claude-sonnet-4-6')\nconst adapter3 = geminiText('gemini-2.5-pro')\nconst adapter4 = grokText('grok-4')\nconst adapter5 = groqText('llama-3.3-70b-versatile')\nconst adapter6 = openRouterText('anthropic\u002Fclaude-sonnet-4')\nconst adapter7 = ollamaText('llama3.3')\nconst adapter8 = bedrockText('us.anthropic.claude-3-7-sonnet-20250219-v1:0')\n\n\u002F\u002F Optional: pass explicit API key\nconst adapterWithKey = openaiText('gpt-5.2', {\n  apiKey: 'sk-...',\n})\n",[940],{"type":69,"tag":107,"props":941,"children":942},{"__ignoreMap":140},[943,952,987,1023,1059,1095,1131,1167,1203,1239,1246,1254,1294,1335,1377,1419,1461,1503,1545,1587,1595,1604,1649,1679],{"type":69,"tag":146,"props":944,"children":945},{"class":148,"line":149},[946],{"type":69,"tag":146,"props":947,"children":949},{"style":948},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[950],{"type":75,"value":951},"\u002F\u002F Each factory takes model as first arg, optional config as second\n",{"type":69,"tag":146,"props":953,"children":954},{"class":148,"line":207},[955,959,963,967,971,975,979,983],{"type":69,"tag":146,"props":956,"children":957},{"style":153},[958],{"type":75,"value":156},{"type":69,"tag":146,"props":960,"children":961},{"style":159},[962],{"type":75,"value":162},{"type":69,"tag":146,"props":964,"children":965},{"style":165},[966],{"type":75,"value":221},{"type":69,"tag":146,"props":968,"children":969},{"style":159},[970],{"type":75,"value":183},{"type":69,"tag":146,"props":972,"children":973},{"style":153},[974],{"type":75,"value":188},{"type":69,"tag":146,"props":976,"children":977},{"style":159},[978],{"type":75,"value":193},{"type":69,"tag":146,"props":980,"children":981},{"style":196},[982],{"type":75,"value":238},{"type":69,"tag":146,"props":984,"children":985},{"style":159},[986],{"type":75,"value":204},{"type":69,"tag":146,"props":988,"children":989},{"class":148,"line":245},[990,994,998,1003,1007,1011,1015,1019],{"type":69,"tag":146,"props":991,"children":992},{"style":153},[993],{"type":75,"value":156},{"type":69,"tag":146,"props":995,"children":996},{"style":159},[997],{"type":75,"value":162},{"type":69,"tag":146,"props":999,"children":1000},{"style":165},[1001],{"type":75,"value":1002}," anthropicText",{"type":69,"tag":146,"props":1004,"children":1005},{"style":159},[1006],{"type":75,"value":183},{"type":69,"tag":146,"props":1008,"children":1009},{"style":153},[1010],{"type":75,"value":188},{"type":69,"tag":146,"props":1012,"children":1013},{"style":159},[1014],{"type":75,"value":193},{"type":69,"tag":146,"props":1016,"children":1017},{"style":196},[1018],{"type":75,"value":637},{"type":69,"tag":146,"props":1020,"children":1021},{"style":159},[1022],{"type":75,"value":204},{"type":69,"tag":146,"props":1024,"children":1025},{"class":148,"line":255},[1026,1030,1034,1039,1043,1047,1051,1055],{"type":69,"tag":146,"props":1027,"children":1028},{"style":153},[1029],{"type":75,"value":156},{"type":69,"tag":146,"props":1031,"children":1032},{"style":159},[1033],{"type":75,"value":162},{"type":69,"tag":146,"props":1035,"children":1036},{"style":165},[1037],{"type":75,"value":1038}," geminiText",{"type":69,"tag":146,"props":1040,"children":1041},{"style":159},[1042],{"type":75,"value":183},{"type":69,"tag":146,"props":1044,"children":1045},{"style":153},[1046],{"type":75,"value":188},{"type":69,"tag":146,"props":1048,"children":1049},{"style":159},[1050],{"type":75,"value":193},{"type":69,"tag":146,"props":1052,"children":1053},{"style":196},[1054],{"type":75,"value":672},{"type":69,"tag":146,"props":1056,"children":1057},{"style":159},[1058],{"type":75,"value":204},{"type":69,"tag":146,"props":1060,"children":1061},{"class":148,"line":290},[1062,1066,1070,1075,1079,1083,1087,1091],{"type":69,"tag":146,"props":1063,"children":1064},{"style":153},[1065],{"type":75,"value":156},{"type":69,"tag":146,"props":1067,"children":1068},{"style":159},[1069],{"type":75,"value":162},{"type":69,"tag":146,"props":1071,"children":1072},{"style":165},[1073],{"type":75,"value":1074}," grokText",{"type":69,"tag":146,"props":1076,"children":1077},{"style":159},[1078],{"type":75,"value":183},{"type":69,"tag":146,"props":1080,"children":1081},{"style":153},[1082],{"type":75,"value":188},{"type":69,"tag":146,"props":1084,"children":1085},{"style":159},[1086],{"type":75,"value":193},{"type":69,"tag":146,"props":1088,"children":1089},{"style":196},[1090],{"type":75,"value":715},{"type":69,"tag":146,"props":1092,"children":1093},{"style":159},[1094],{"type":75,"value":204},{"type":69,"tag":146,"props":1096,"children":1097},{"class":148,"line":336},[1098,1102,1106,1111,1115,1119,1123,1127],{"type":69,"tag":146,"props":1099,"children":1100},{"style":153},[1101],{"type":75,"value":156},{"type":69,"tag":146,"props":1103,"children":1104},{"style":159},[1105],{"type":75,"value":162},{"type":69,"tag":146,"props":1107,"children":1108},{"style":165},[1109],{"type":75,"value":1110}," groqText",{"type":69,"tag":146,"props":1112,"children":1113},{"style":159},[1114],{"type":75,"value":183},{"type":69,"tag":146,"props":1116,"children":1117},{"style":153},[1118],{"type":75,"value":188},{"type":69,"tag":146,"props":1120,"children":1121},{"style":159},[1122],{"type":75,"value":193},{"type":69,"tag":146,"props":1124,"children":1125},{"style":196},[1126],{"type":75,"value":750},{"type":69,"tag":146,"props":1128,"children":1129},{"style":159},[1130],{"type":75,"value":204},{"type":69,"tag":146,"props":1132,"children":1133},{"class":148,"line":349},[1134,1138,1142,1147,1151,1155,1159,1163],{"type":69,"tag":146,"props":1135,"children":1136},{"style":153},[1137],{"type":75,"value":156},{"type":69,"tag":146,"props":1139,"children":1140},{"style":159},[1141],{"type":75,"value":162},{"type":69,"tag":146,"props":1143,"children":1144},{"style":165},[1145],{"type":75,"value":1146}," openRouterText",{"type":69,"tag":146,"props":1148,"children":1149},{"style":159},[1150],{"type":75,"value":183},{"type":69,"tag":146,"props":1152,"children":1153},{"style":153},[1154],{"type":75,"value":188},{"type":69,"tag":146,"props":1156,"children":1157},{"style":159},[1158],{"type":75,"value":193},{"type":69,"tag":146,"props":1160,"children":1161},{"style":196},[1162],{"type":75,"value":785},{"type":69,"tag":146,"props":1164,"children":1165},{"style":159},[1166],{"type":75,"value":204},{"type":69,"tag":146,"props":1168,"children":1169},{"class":148,"line":367},[1170,1174,1178,1183,1187,1191,1195,1199],{"type":69,"tag":146,"props":1171,"children":1172},{"style":153},[1173],{"type":75,"value":156},{"type":69,"tag":146,"props":1175,"children":1176},{"style":159},[1177],{"type":75,"value":162},{"type":69,"tag":146,"props":1179,"children":1180},{"style":165},[1181],{"type":75,"value":1182}," ollamaText",{"type":69,"tag":146,"props":1184,"children":1185},{"style":159},[1186],{"type":75,"value":183},{"type":69,"tag":146,"props":1188,"children":1189},{"style":153},[1190],{"type":75,"value":188},{"type":69,"tag":146,"props":1192,"children":1193},{"style":159},[1194],{"type":75,"value":193},{"type":69,"tag":146,"props":1196,"children":1197},{"style":196},[1198],{"type":75,"value":820},{"type":69,"tag":146,"props":1200,"children":1201},{"style":159},[1202],{"type":75,"value":204},{"type":69,"tag":146,"props":1204,"children":1205},{"class":148,"line":390},[1206,1210,1214,1219,1223,1227,1231,1235],{"type":69,"tag":146,"props":1207,"children":1208},{"style":153},[1209],{"type":75,"value":156},{"type":69,"tag":146,"props":1211,"children":1212},{"style":159},[1213],{"type":75,"value":162},{"type":69,"tag":146,"props":1215,"children":1216},{"style":165},[1217],{"type":75,"value":1218}," bedrockText",{"type":69,"tag":146,"props":1220,"children":1221},{"style":159},[1222],{"type":75,"value":183},{"type":69,"tag":146,"props":1224,"children":1225},{"style":153},[1226],{"type":75,"value":188},{"type":69,"tag":146,"props":1228,"children":1229},{"style":159},[1230],{"type":75,"value":193},{"type":69,"tag":146,"props":1232,"children":1233},{"style":196},[1234],{"type":75,"value":864},{"type":69,"tag":146,"props":1236,"children":1237},{"style":159},[1238],{"type":75,"value":204},{"type":69,"tag":146,"props":1240,"children":1241},{"class":148,"line":412},[1242],{"type":69,"tag":146,"props":1243,"children":1244},{"emptyLinePlaceholder":249},[1245],{"type":75,"value":252},{"type":69,"tag":146,"props":1247,"children":1248},{"class":148,"line":421},[1249],{"type":69,"tag":146,"props":1250,"children":1251},{"style":948},[1252],{"type":75,"value":1253},"\u002F\u002F Model string is passed to the factory, NOT to chat()\n",{"type":69,"tag":146,"props":1255,"children":1256},{"class":148,"line":435},[1257,1261,1266,1270,1274,1278,1282,1286,1290],{"type":69,"tag":146,"props":1258,"children":1259},{"style":259},[1260],{"type":75,"value":262},{"type":69,"tag":146,"props":1262,"children":1263},{"style":165},[1264],{"type":75,"value":1265}," adapter ",{"type":69,"tag":146,"props":1267,"children":1268},{"style":159},[1269],{"type":75,"value":272},{"type":69,"tag":146,"props":1271,"children":1272},{"style":275},[1273],{"type":75,"value":221},{"type":69,"tag":146,"props":1275,"children":1276},{"style":165},[1277],{"type":75,"value":282},{"type":69,"tag":146,"props":1279,"children":1280},{"style":159},[1281],{"type":75,"value":314},{"type":69,"tag":146,"props":1283,"children":1284},{"style":196},[1285],{"type":75,"value":319},{"type":69,"tag":146,"props":1287,"children":1288},{"style":159},[1289],{"type":75,"value":314},{"type":69,"tag":146,"props":1291,"children":1292},{"style":165},[1293],{"type":75,"value":432},{"type":69,"tag":146,"props":1295,"children":1296},{"class":148,"line":443},[1297,1301,1306,1310,1314,1318,1322,1327,1331],{"type":69,"tag":146,"props":1298,"children":1299},{"style":259},[1300],{"type":75,"value":262},{"type":69,"tag":146,"props":1302,"children":1303},{"style":165},[1304],{"type":75,"value":1305}," adapter2 ",{"type":69,"tag":146,"props":1307,"children":1308},{"style":159},[1309],{"type":75,"value":272},{"type":69,"tag":146,"props":1311,"children":1312},{"style":275},[1313],{"type":75,"value":1002},{"type":69,"tag":146,"props":1315,"children":1316},{"style":165},[1317],{"type":75,"value":282},{"type":69,"tag":146,"props":1319,"children":1320},{"style":159},[1321],{"type":75,"value":314},{"type":69,"tag":146,"props":1323,"children":1324},{"style":196},[1325],{"type":75,"value":1326},"claude-sonnet-4-6",{"type":69,"tag":146,"props":1328,"children":1329},{"style":159},[1330],{"type":75,"value":314},{"type":69,"tag":146,"props":1332,"children":1333},{"style":165},[1334],{"type":75,"value":432},{"type":69,"tag":146,"props":1336,"children":1338},{"class":148,"line":1337},14,[1339,1343,1348,1352,1356,1360,1364,1369,1373],{"type":69,"tag":146,"props":1340,"children":1341},{"style":259},[1342],{"type":75,"value":262},{"type":69,"tag":146,"props":1344,"children":1345},{"style":165},[1346],{"type":75,"value":1347}," adapter3 ",{"type":69,"tag":146,"props":1349,"children":1350},{"style":159},[1351],{"type":75,"value":272},{"type":69,"tag":146,"props":1353,"children":1354},{"style":275},[1355],{"type":75,"value":1038},{"type":69,"tag":146,"props":1357,"children":1358},{"style":165},[1359],{"type":75,"value":282},{"type":69,"tag":146,"props":1361,"children":1362},{"style":159},[1363],{"type":75,"value":314},{"type":69,"tag":146,"props":1365,"children":1366},{"style":196},[1367],{"type":75,"value":1368},"gemini-2.5-pro",{"type":69,"tag":146,"props":1370,"children":1371},{"style":159},[1372],{"type":75,"value":314},{"type":69,"tag":146,"props":1374,"children":1375},{"style":165},[1376],{"type":75,"value":432},{"type":69,"tag":146,"props":1378,"children":1380},{"class":148,"line":1379},15,[1381,1385,1390,1394,1398,1402,1406,1411,1415],{"type":69,"tag":146,"props":1382,"children":1383},{"style":259},[1384],{"type":75,"value":262},{"type":69,"tag":146,"props":1386,"children":1387},{"style":165},[1388],{"type":75,"value":1389}," adapter4 ",{"type":69,"tag":146,"props":1391,"children":1392},{"style":159},[1393],{"type":75,"value":272},{"type":69,"tag":146,"props":1395,"children":1396},{"style":275},[1397],{"type":75,"value":1074},{"type":69,"tag":146,"props":1399,"children":1400},{"style":165},[1401],{"type":75,"value":282},{"type":69,"tag":146,"props":1403,"children":1404},{"style":159},[1405],{"type":75,"value":314},{"type":69,"tag":146,"props":1407,"children":1408},{"style":196},[1409],{"type":75,"value":1410},"grok-4",{"type":69,"tag":146,"props":1412,"children":1413},{"style":159},[1414],{"type":75,"value":314},{"type":69,"tag":146,"props":1416,"children":1417},{"style":165},[1418],{"type":75,"value":432},{"type":69,"tag":146,"props":1420,"children":1422},{"class":148,"line":1421},16,[1423,1427,1432,1436,1440,1444,1448,1453,1457],{"type":69,"tag":146,"props":1424,"children":1425},{"style":259},[1426],{"type":75,"value":262},{"type":69,"tag":146,"props":1428,"children":1429},{"style":165},[1430],{"type":75,"value":1431}," adapter5 ",{"type":69,"tag":146,"props":1433,"children":1434},{"style":159},[1435],{"type":75,"value":272},{"type":69,"tag":146,"props":1437,"children":1438},{"style":275},[1439],{"type":75,"value":1110},{"type":69,"tag":146,"props":1441,"children":1442},{"style":165},[1443],{"type":75,"value":282},{"type":69,"tag":146,"props":1445,"children":1446},{"style":159},[1447],{"type":75,"value":314},{"type":69,"tag":146,"props":1449,"children":1450},{"style":196},[1451],{"type":75,"value":1452},"llama-3.3-70b-versatile",{"type":69,"tag":146,"props":1454,"children":1455},{"style":159},[1456],{"type":75,"value":314},{"type":69,"tag":146,"props":1458,"children":1459},{"style":165},[1460],{"type":75,"value":432},{"type":69,"tag":146,"props":1462,"children":1464},{"class":148,"line":1463},17,[1465,1469,1474,1478,1482,1486,1490,1495,1499],{"type":69,"tag":146,"props":1466,"children":1467},{"style":259},[1468],{"type":75,"value":262},{"type":69,"tag":146,"props":1470,"children":1471},{"style":165},[1472],{"type":75,"value":1473}," adapter6 ",{"type":69,"tag":146,"props":1475,"children":1476},{"style":159},[1477],{"type":75,"value":272},{"type":69,"tag":146,"props":1479,"children":1480},{"style":275},[1481],{"type":75,"value":1146},{"type":69,"tag":146,"props":1483,"children":1484},{"style":165},[1485],{"type":75,"value":282},{"type":69,"tag":146,"props":1487,"children":1488},{"style":159},[1489],{"type":75,"value":314},{"type":69,"tag":146,"props":1491,"children":1492},{"style":196},[1493],{"type":75,"value":1494},"anthropic\u002Fclaude-sonnet-4",{"type":69,"tag":146,"props":1496,"children":1497},{"style":159},[1498],{"type":75,"value":314},{"type":69,"tag":146,"props":1500,"children":1501},{"style":165},[1502],{"type":75,"value":432},{"type":69,"tag":146,"props":1504,"children":1506},{"class":148,"line":1505},18,[1507,1511,1516,1520,1524,1528,1532,1537,1541],{"type":69,"tag":146,"props":1508,"children":1509},{"style":259},[1510],{"type":75,"value":262},{"type":69,"tag":146,"props":1512,"children":1513},{"style":165},[1514],{"type":75,"value":1515}," adapter7 ",{"type":69,"tag":146,"props":1517,"children":1518},{"style":159},[1519],{"type":75,"value":272},{"type":69,"tag":146,"props":1521,"children":1522},{"style":275},[1523],{"type":75,"value":1182},{"type":69,"tag":146,"props":1525,"children":1526},{"style":165},[1527],{"type":75,"value":282},{"type":69,"tag":146,"props":1529,"children":1530},{"style":159},[1531],{"type":75,"value":314},{"type":69,"tag":146,"props":1533,"children":1534},{"style":196},[1535],{"type":75,"value":1536},"llama3.3",{"type":69,"tag":146,"props":1538,"children":1539},{"style":159},[1540],{"type":75,"value":314},{"type":69,"tag":146,"props":1542,"children":1543},{"style":165},[1544],{"type":75,"value":432},{"type":69,"tag":146,"props":1546,"children":1548},{"class":148,"line":1547},19,[1549,1553,1558,1562,1566,1570,1574,1579,1583],{"type":69,"tag":146,"props":1550,"children":1551},{"style":259},[1552],{"type":75,"value":262},{"type":69,"tag":146,"props":1554,"children":1555},{"style":165},[1556],{"type":75,"value":1557}," adapter8 ",{"type":69,"tag":146,"props":1559,"children":1560},{"style":159},[1561],{"type":75,"value":272},{"type":69,"tag":146,"props":1563,"children":1564},{"style":275},[1565],{"type":75,"value":1218},{"type":69,"tag":146,"props":1567,"children":1568},{"style":165},[1569],{"type":75,"value":282},{"type":69,"tag":146,"props":1571,"children":1572},{"style":159},[1573],{"type":75,"value":314},{"type":69,"tag":146,"props":1575,"children":1576},{"style":196},[1577],{"type":75,"value":1578},"us.anthropic.claude-3-7-sonnet-20250219-v1:0",{"type":69,"tag":146,"props":1580,"children":1581},{"style":159},[1582],{"type":75,"value":314},{"type":69,"tag":146,"props":1584,"children":1585},{"style":165},[1586],{"type":75,"value":432},{"type":69,"tag":146,"props":1588,"children":1590},{"class":148,"line":1589},20,[1591],{"type":69,"tag":146,"props":1592,"children":1593},{"emptyLinePlaceholder":249},[1594],{"type":75,"value":252},{"type":69,"tag":146,"props":1596,"children":1598},{"class":148,"line":1597},21,[1599],{"type":69,"tag":146,"props":1600,"children":1601},{"style":948},[1602],{"type":75,"value":1603},"\u002F\u002F Optional: pass explicit API key\n",{"type":69,"tag":146,"props":1605,"children":1607},{"class":148,"line":1606},22,[1608,1612,1617,1621,1625,1629,1633,1637,1641,1645],{"type":69,"tag":146,"props":1609,"children":1610},{"style":259},[1611],{"type":75,"value":262},{"type":69,"tag":146,"props":1613,"children":1614},{"style":165},[1615],{"type":75,"value":1616}," adapterWithKey ",{"type":69,"tag":146,"props":1618,"children":1619},{"style":159},[1620],{"type":75,"value":272},{"type":69,"tag":146,"props":1622,"children":1623},{"style":275},[1624],{"type":75,"value":221},{"type":69,"tag":146,"props":1626,"children":1627},{"style":165},[1628],{"type":75,"value":282},{"type":69,"tag":146,"props":1630,"children":1631},{"style":159},[1632],{"type":75,"value":314},{"type":69,"tag":146,"props":1634,"children":1635},{"style":196},[1636],{"type":75,"value":319},{"type":69,"tag":146,"props":1638,"children":1639},{"style":159},[1640],{"type":75,"value":314},{"type":69,"tag":146,"props":1642,"children":1643},{"style":159},[1644],{"type":75,"value":173},{"type":69,"tag":146,"props":1646,"children":1647},{"style":159},[1648],{"type":75,"value":364},{"type":69,"tag":146,"props":1650,"children":1652},{"class":148,"line":1651},23,[1653,1658,1662,1666,1671,1675],{"type":69,"tag":146,"props":1654,"children":1655},{"style":294},[1656],{"type":75,"value":1657},"  apiKey",{"type":69,"tag":146,"props":1659,"children":1660},{"style":159},[1661],{"type":75,"value":134},{"type":69,"tag":146,"props":1663,"children":1664},{"style":159},[1665],{"type":75,"value":193},{"type":69,"tag":146,"props":1667,"children":1668},{"style":196},[1669],{"type":75,"value":1670},"sk-...",{"type":69,"tag":146,"props":1672,"children":1673},{"style":159},[1674],{"type":75,"value":314},{"type":69,"tag":146,"props":1676,"children":1677},{"style":159},[1678],{"type":75,"value":333},{"type":69,"tag":146,"props":1680,"children":1682},{"class":148,"line":1681},24,[1683,1687],{"type":69,"tag":146,"props":1684,"children":1685},{"style":159},[1686],{"type":75,"value":427},{"type":69,"tag":146,"props":1688,"children":1689},{"style":165},[1690],{"type":75,"value":432},{"type":69,"tag":82,"props":1692,"children":1693},{},[1694,1699,1701,1707],{"type":69,"tag":107,"props":1695,"children":1697},{"className":1696},[],[1698],{"type":75,"value":864},{"type":75,"value":1700}," (Amazon Bedrock) branches on ",{"type":69,"tag":107,"props":1702,"children":1704},{"className":1703},[],[1705],{"type":75,"value":1706},"config.api",{"type":75,"value":134},{"type":69,"tag":1709,"props":1710,"children":1711},"ul",{},[1712,1747,1766],{"type":69,"tag":1713,"props":1714,"children":1715},"li",{},[1716,1722,1723,1729,1731,1737,1739,1745],{"type":69,"tag":107,"props":1717,"children":1719},{"className":1718},[],[1720],{"type":75,"value":1721},"bedrockText(model)",{"type":75,"value":692},{"type":69,"tag":107,"props":1724,"children":1726},{"className":1725},[],[1727],{"type":75,"value":1728},"bedrockText(model, { api: 'converse' })",{"type":75,"value":1730}," (the default) — Bedrock's native Converse API via ",{"type":69,"tag":107,"props":1732,"children":1734},{"className":1733},[],[1735],{"type":75,"value":1736},"@aws-sdk\u002Fclient-bedrock-runtime",{"type":75,"value":1738}," (adapter name ",{"type":69,"tag":107,"props":1740,"children":1742},{"className":1741},[],[1743],{"type":75,"value":1744},"bedrock-converse",{"type":75,"value":1746},"). Reaches the broad catalog: Claude, Nova, Llama, Mistral, DeepSeek, and more.",{"type":69,"tag":1713,"props":1748,"children":1749},{},[1750,1756,1758,1764],{"type":69,"tag":107,"props":1751,"children":1753},{"className":1752},[],[1754],{"type":75,"value":1755},"bedrockText(model, { api: 'chat' })",{"type":75,"value":1757}," — OpenAI-compatible Chat Completions endpoint (adapter name ",{"type":69,"tag":107,"props":1759,"children":1761},{"className":1760},[],[1762],{"type":75,"value":1763},"bedrock",{"type":75,"value":1765},"). Open-weight models only (gpt-oss, DeepSeek V3.x, Gemma, Qwen, etc.). Does NOT reach Claude, Nova, or Llama.",{"type":69,"tag":1713,"props":1767,"children":1768},{},[1769,1775,1777,1783],{"type":69,"tag":107,"props":1770,"children":1772},{"className":1771},[],[1773],{"type":75,"value":1774},"bedrockText(model, { api: 'responses' })",{"type":75,"value":1776}," — OpenAI-compatible Responses API, mantle-only (adapter name ",{"type":69,"tag":107,"props":1778,"children":1780},{"className":1779},[],[1781],{"type":75,"value":1782},"bedrock-responses",{"type":75,"value":1784},"). Currently gpt-oss family.",{"type":69,"tag":82,"props":1786,"children":1787},{},[1788,1790,1796,1798,1803,1804,1809,1811,1816],{"type":75,"value":1789},"Use ",{"type":69,"tag":107,"props":1791,"children":1793},{"className":1792},[],[1794],{"type":75,"value":1795},"createBedrockText(model, apiKey, config?)",{"type":75,"value":1797}," to pass the key explicitly. Auth resolves from ",{"type":69,"tag":107,"props":1799,"children":1801},{"className":1800},[],[1802],{"type":75,"value":882},{"type":75,"value":917},{"type":69,"tag":107,"props":1805,"children":1807},{"className":1806},[],[1808],{"type":75,"value":889},{"type":75,"value":1810},", or SigV4 via the standard AWS credential chain (no extra packages needed — handled by ",{"type":69,"tag":107,"props":1812,"children":1814},{"className":1813},[],[1815],{"type":75,"value":1736},{"type":75,"value":1817},").",{"type":69,"tag":538,"props":1819,"children":1821},{"id":1820},"_2-runtime-adapter-switching",[1822],{"type":75,"value":1823},"2. Runtime Adapter Switching",{"type":69,"tag":82,"props":1825,"children":1826},{},[1827],{"type":75,"value":1828},"Use an adapter factory map to switch providers dynamically based on user\ninput or configuration:",{"type":69,"tag":136,"props":1830,"children":1832},{"className":138,"code":1831,"language":44,"meta":140,"style":140},"import { chat, toServerSentEventsResponse } from '@tanstack\u002Fai'\nimport type { TextAdapter } from '@tanstack\u002Fai\u002Fadapters'\nimport { openaiText } from '@tanstack\u002Fai-openai'\nimport { anthropicText } from '@tanstack\u002Fai-anthropic'\nimport { geminiText } from '@tanstack\u002Fai-gemini'\n\n\u002F\u002F Define a map of provider+model to adapter factory calls\nconst adapters: Record\u003Cstring, () => TextAdapter> = {\n  'openai\u002Fgpt-5.2': () => openaiText('gpt-5.2'),\n  'anthropic\u002Fclaude-sonnet-4-6': () => anthropicText('claude-sonnet-4-6'),\n  'gemini\u002Fgemini-2.5-pro': () => geminiText('gemini-2.5-pro'),\n}\n\nexport function handleChat(providerModel: string, messages: Array\u003Cany>) {\n  const createAdapter = adapters[providerModel]\n  if (!createAdapter) {\n    throw new Error(`Unknown provider\u002Fmodel: ${providerModel}`)\n  }\n\n  const stream = chat({\n    adapter: createAdapter(),\n    messages,\n  })\n\n  return toServerSentEventsResponse(stream)\n}\n",[1833],{"type":69,"tag":107,"props":1834,"children":1835},{"__ignoreMap":140},[1836,1879,1921,1956,1991,2026,2033,2041,2105,2162,2218,2274,2282,2289,2362,2397,2429,2479,2487,2494,2522,2547,2559,2571,2578,2604],{"type":69,"tag":146,"props":1837,"children":1838},{"class":148,"line":149},[1839,1843,1847,1851,1855,1859,1863,1867,1871,1875],{"type":69,"tag":146,"props":1840,"children":1841},{"style":153},[1842],{"type":75,"value":156},{"type":69,"tag":146,"props":1844,"children":1845},{"style":159},[1846],{"type":75,"value":162},{"type":69,"tag":146,"props":1848,"children":1849},{"style":165},[1850],{"type":75,"value":168},{"type":69,"tag":146,"props":1852,"children":1853},{"style":159},[1854],{"type":75,"value":173},{"type":69,"tag":146,"props":1856,"children":1857},{"style":165},[1858],{"type":75,"value":178},{"type":69,"tag":146,"props":1860,"children":1861},{"style":159},[1862],{"type":75,"value":183},{"type":69,"tag":146,"props":1864,"children":1865},{"style":153},[1866],{"type":75,"value":188},{"type":69,"tag":146,"props":1868,"children":1869},{"style":159},[1870],{"type":75,"value":193},{"type":69,"tag":146,"props":1872,"children":1873},{"style":196},[1874],{"type":75,"value":199},{"type":69,"tag":146,"props":1876,"children":1877},{"style":159},[1878],{"type":75,"value":204},{"type":69,"tag":146,"props":1880,"children":1881},{"class":148,"line":207},[1882,1886,1891,1895,1900,1904,1908,1912,1917],{"type":69,"tag":146,"props":1883,"children":1884},{"style":153},[1885],{"type":75,"value":156},{"type":69,"tag":146,"props":1887,"children":1888},{"style":153},[1889],{"type":75,"value":1890}," type",{"type":69,"tag":146,"props":1892,"children":1893},{"style":159},[1894],{"type":75,"value":162},{"type":69,"tag":146,"props":1896,"children":1897},{"style":165},[1898],{"type":75,"value":1899}," TextAdapter",{"type":69,"tag":146,"props":1901,"children":1902},{"style":159},[1903],{"type":75,"value":183},{"type":69,"tag":146,"props":1905,"children":1906},{"style":153},[1907],{"type":75,"value":188},{"type":69,"tag":146,"props":1909,"children":1910},{"style":159},[1911],{"type":75,"value":193},{"type":69,"tag":146,"props":1913,"children":1914},{"style":196},[1915],{"type":75,"value":1916},"@tanstack\u002Fai\u002Fadapters",{"type":69,"tag":146,"props":1918,"children":1919},{"style":159},[1920],{"type":75,"value":204},{"type":69,"tag":146,"props":1922,"children":1923},{"class":148,"line":245},[1924,1928,1932,1936,1940,1944,1948,1952],{"type":69,"tag":146,"props":1925,"children":1926},{"style":153},[1927],{"type":75,"value":156},{"type":69,"tag":146,"props":1929,"children":1930},{"style":159},[1931],{"type":75,"value":162},{"type":69,"tag":146,"props":1933,"children":1934},{"style":165},[1935],{"type":75,"value":221},{"type":69,"tag":146,"props":1937,"children":1938},{"style":159},[1939],{"type":75,"value":183},{"type":69,"tag":146,"props":1941,"children":1942},{"style":153},[1943],{"type":75,"value":188},{"type":69,"tag":146,"props":1945,"children":1946},{"style":159},[1947],{"type":75,"value":193},{"type":69,"tag":146,"props":1949,"children":1950},{"style":196},[1951],{"type":75,"value":238},{"type":69,"tag":146,"props":1953,"children":1954},{"style":159},[1955],{"type":75,"value":204},{"type":69,"tag":146,"props":1957,"children":1958},{"class":148,"line":255},[1959,1963,1967,1971,1975,1979,1983,1987],{"type":69,"tag":146,"props":1960,"children":1961},{"style":153},[1962],{"type":75,"value":156},{"type":69,"tag":146,"props":1964,"children":1965},{"style":159},[1966],{"type":75,"value":162},{"type":69,"tag":146,"props":1968,"children":1969},{"style":165},[1970],{"type":75,"value":1002},{"type":69,"tag":146,"props":1972,"children":1973},{"style":159},[1974],{"type":75,"value":183},{"type":69,"tag":146,"props":1976,"children":1977},{"style":153},[1978],{"type":75,"value":188},{"type":69,"tag":146,"props":1980,"children":1981},{"style":159},[1982],{"type":75,"value":193},{"type":69,"tag":146,"props":1984,"children":1985},{"style":196},[1986],{"type":75,"value":637},{"type":69,"tag":146,"props":1988,"children":1989},{"style":159},[1990],{"type":75,"value":204},{"type":69,"tag":146,"props":1992,"children":1993},{"class":148,"line":290},[1994,1998,2002,2006,2010,2014,2018,2022],{"type":69,"tag":146,"props":1995,"children":1996},{"style":153},[1997],{"type":75,"value":156},{"type":69,"tag":146,"props":1999,"children":2000},{"style":159},[2001],{"type":75,"value":162},{"type":69,"tag":146,"props":2003,"children":2004},{"style":165},[2005],{"type":75,"value":1038},{"type":69,"tag":146,"props":2007,"children":2008},{"style":159},[2009],{"type":75,"value":183},{"type":69,"tag":146,"props":2011,"children":2012},{"style":153},[2013],{"type":75,"value":188},{"type":69,"tag":146,"props":2015,"children":2016},{"style":159},[2017],{"type":75,"value":193},{"type":69,"tag":146,"props":2019,"children":2020},{"style":196},[2021],{"type":75,"value":672},{"type":69,"tag":146,"props":2023,"children":2024},{"style":159},[2025],{"type":75,"value":204},{"type":69,"tag":146,"props":2027,"children":2028},{"class":148,"line":336},[2029],{"type":69,"tag":146,"props":2030,"children":2031},{"emptyLinePlaceholder":249},[2032],{"type":75,"value":252},{"type":69,"tag":146,"props":2034,"children":2035},{"class":148,"line":349},[2036],{"type":69,"tag":146,"props":2037,"children":2038},{"style":948},[2039],{"type":75,"value":2040},"\u002F\u002F Define a map of provider+model to adapter factory calls\n",{"type":69,"tag":146,"props":2042,"children":2043},{"class":148,"line":367},[2044,2048,2053,2057,2063,2068,2073,2077,2082,2087,2091,2096,2101],{"type":69,"tag":146,"props":2045,"children":2046},{"style":259},[2047],{"type":75,"value":262},{"type":69,"tag":146,"props":2049,"children":2050},{"style":165},[2051],{"type":75,"value":2052}," adapters",{"type":69,"tag":146,"props":2054,"children":2055},{"style":159},[2056],{"type":75,"value":134},{"type":69,"tag":146,"props":2058,"children":2060},{"style":2059},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[2061],{"type":75,"value":2062}," Record",{"type":69,"tag":146,"props":2064,"children":2065},{"style":159},[2066],{"type":75,"value":2067},"\u003C",{"type":69,"tag":146,"props":2069,"children":2070},{"style":2059},[2071],{"type":75,"value":2072},"string",{"type":69,"tag":146,"props":2074,"children":2075},{"style":159},[2076],{"type":75,"value":173},{"type":69,"tag":146,"props":2078,"children":2079},{"style":159},[2080],{"type":75,"value":2081}," ()",{"type":69,"tag":146,"props":2083,"children":2084},{"style":259},[2085],{"type":75,"value":2086}," =>",{"type":69,"tag":146,"props":2088,"children":2089},{"style":2059},[2090],{"type":75,"value":1899},{"type":69,"tag":146,"props":2092,"children":2093},{"style":159},[2094],{"type":75,"value":2095},">",{"type":69,"tag":146,"props":2097,"children":2098},{"style":159},[2099],{"type":75,"value":2100}," =",{"type":69,"tag":146,"props":2102,"children":2103},{"style":159},[2104],{"type":75,"value":364},{"type":69,"tag":146,"props":2106,"children":2107},{"class":148,"line":390},[2108,2113,2118,2122,2126,2130,2134,2138,2142,2146,2150,2154,2158],{"type":69,"tag":146,"props":2109,"children":2110},{"style":159},[2111],{"type":75,"value":2112},"  '",{"type":69,"tag":146,"props":2114,"children":2115},{"style":294},[2116],{"type":75,"value":2117},"openai\u002Fgpt-5.2",{"type":69,"tag":146,"props":2119,"children":2120},{"style":159},[2121],{"type":75,"value":314},{"type":69,"tag":146,"props":2123,"children":2124},{"style":159},[2125],{"type":75,"value":134},{"type":69,"tag":146,"props":2127,"children":2128},{"style":159},[2129],{"type":75,"value":2081},{"type":69,"tag":146,"props":2131,"children":2132},{"style":259},[2133],{"type":75,"value":2086},{"type":69,"tag":146,"props":2135,"children":2136},{"style":275},[2137],{"type":75,"value":221},{"type":69,"tag":146,"props":2139,"children":2140},{"style":165},[2141],{"type":75,"value":282},{"type":69,"tag":146,"props":2143,"children":2144},{"style":159},[2145],{"type":75,"value":314},{"type":69,"tag":146,"props":2147,"children":2148},{"style":196},[2149],{"type":75,"value":319},{"type":69,"tag":146,"props":2151,"children":2152},{"style":159},[2153],{"type":75,"value":314},{"type":69,"tag":146,"props":2155,"children":2156},{"style":165},[2157],{"type":75,"value":328},{"type":69,"tag":146,"props":2159,"children":2160},{"style":159},[2161],{"type":75,"value":333},{"type":69,"tag":146,"props":2163,"children":2164},{"class":148,"line":412},[2165,2169,2174,2178,2182,2186,2190,2194,2198,2202,2206,2210,2214],{"type":69,"tag":146,"props":2166,"children":2167},{"style":159},[2168],{"type":75,"value":2112},{"type":69,"tag":146,"props":2170,"children":2171},{"style":294},[2172],{"type":75,"value":2173},"anthropic\u002Fclaude-sonnet-4-6",{"type":69,"tag":146,"props":2175,"children":2176},{"style":159},[2177],{"type":75,"value":314},{"type":69,"tag":146,"props":2179,"children":2180},{"style":159},[2181],{"type":75,"value":134},{"type":69,"tag":146,"props":2183,"children":2184},{"style":159},[2185],{"type":75,"value":2081},{"type":69,"tag":146,"props":2187,"children":2188},{"style":259},[2189],{"type":75,"value":2086},{"type":69,"tag":146,"props":2191,"children":2192},{"style":275},[2193],{"type":75,"value":1002},{"type":69,"tag":146,"props":2195,"children":2196},{"style":165},[2197],{"type":75,"value":282},{"type":69,"tag":146,"props":2199,"children":2200},{"style":159},[2201],{"type":75,"value":314},{"type":69,"tag":146,"props":2203,"children":2204},{"style":196},[2205],{"type":75,"value":1326},{"type":69,"tag":146,"props":2207,"children":2208},{"style":159},[2209],{"type":75,"value":314},{"type":69,"tag":146,"props":2211,"children":2212},{"style":165},[2213],{"type":75,"value":328},{"type":69,"tag":146,"props":2215,"children":2216},{"style":159},[2217],{"type":75,"value":333},{"type":69,"tag":146,"props":2219,"children":2220},{"class":148,"line":421},[2221,2225,2230,2234,2238,2242,2246,2250,2254,2258,2262,2266,2270],{"type":69,"tag":146,"props":2222,"children":2223},{"style":159},[2224],{"type":75,"value":2112},{"type":69,"tag":146,"props":2226,"children":2227},{"style":294},[2228],{"type":75,"value":2229},"gemini\u002Fgemini-2.5-pro",{"type":69,"tag":146,"props":2231,"children":2232},{"style":159},[2233],{"type":75,"value":314},{"type":69,"tag":146,"props":2235,"children":2236},{"style":159},[2237],{"type":75,"value":134},{"type":69,"tag":146,"props":2239,"children":2240},{"style":159},[2241],{"type":75,"value":2081},{"type":69,"tag":146,"props":2243,"children":2244},{"style":259},[2245],{"type":75,"value":2086},{"type":69,"tag":146,"props":2247,"children":2248},{"style":275},[2249],{"type":75,"value":1038},{"type":69,"tag":146,"props":2251,"children":2252},{"style":165},[2253],{"type":75,"value":282},{"type":69,"tag":146,"props":2255,"children":2256},{"style":159},[2257],{"type":75,"value":314},{"type":69,"tag":146,"props":2259,"children":2260},{"style":196},[2261],{"type":75,"value":1368},{"type":69,"tag":146,"props":2263,"children":2264},{"style":159},[2265],{"type":75,"value":314},{"type":69,"tag":146,"props":2267,"children":2268},{"style":165},[2269],{"type":75,"value":328},{"type":69,"tag":146,"props":2271,"children":2272},{"style":159},[2273],{"type":75,"value":333},{"type":69,"tag":146,"props":2275,"children":2276},{"class":148,"line":435},[2277],{"type":69,"tag":146,"props":2278,"children":2279},{"style":159},[2280],{"type":75,"value":2281},"}\n",{"type":69,"tag":146,"props":2283,"children":2284},{"class":148,"line":443},[2285],{"type":69,"tag":146,"props":2286,"children":2287},{"emptyLinePlaceholder":249},[2288],{"type":75,"value":252},{"type":69,"tag":146,"props":2290,"children":2291},{"class":148,"line":1337},[2292,2297,2302,2307,2311,2317,2321,2326,2330,2335,2339,2344,2348,2353,2358],{"type":69,"tag":146,"props":2293,"children":2294},{"style":153},[2295],{"type":75,"value":2296},"export",{"type":69,"tag":146,"props":2298,"children":2299},{"style":259},[2300],{"type":75,"value":2301}," function",{"type":69,"tag":146,"props":2303,"children":2304},{"style":275},[2305],{"type":75,"value":2306}," handleChat",{"type":69,"tag":146,"props":2308,"children":2309},{"style":159},[2310],{"type":75,"value":282},{"type":69,"tag":146,"props":2312,"children":2314},{"style":2313},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[2315],{"type":75,"value":2316},"providerModel",{"type":69,"tag":146,"props":2318,"children":2319},{"style":159},[2320],{"type":75,"value":134},{"type":69,"tag":146,"props":2322,"children":2323},{"style":2059},[2324],{"type":75,"value":2325}," string",{"type":69,"tag":146,"props":2327,"children":2328},{"style":159},[2329],{"type":75,"value":173},{"type":69,"tag":146,"props":2331,"children":2332},{"style":2313},[2333],{"type":75,"value":2334}," messages",{"type":69,"tag":146,"props":2336,"children":2337},{"style":159},[2338],{"type":75,"value":134},{"type":69,"tag":146,"props":2340,"children":2341},{"style":2059},[2342],{"type":75,"value":2343}," Array",{"type":69,"tag":146,"props":2345,"children":2346},{"style":159},[2347],{"type":75,"value":2067},{"type":69,"tag":146,"props":2349,"children":2350},{"style":2059},[2351],{"type":75,"value":2352},"any",{"type":69,"tag":146,"props":2354,"children":2355},{"style":159},[2356],{"type":75,"value":2357},">)",{"type":69,"tag":146,"props":2359,"children":2360},{"style":159},[2361],{"type":75,"value":364},{"type":69,"tag":146,"props":2363,"children":2364},{"class":148,"line":1379},[2365,2370,2375,2379,2383,2388,2392],{"type":69,"tag":146,"props":2366,"children":2367},{"style":259},[2368],{"type":75,"value":2369},"  const",{"type":69,"tag":146,"props":2371,"children":2372},{"style":165},[2373],{"type":75,"value":2374}," createAdapter",{"type":69,"tag":146,"props":2376,"children":2377},{"style":159},[2378],{"type":75,"value":2100},{"type":69,"tag":146,"props":2380,"children":2381},{"style":165},[2382],{"type":75,"value":2052},{"type":69,"tag":146,"props":2384,"children":2385},{"style":294},[2386],{"type":75,"value":2387},"[",{"type":69,"tag":146,"props":2389,"children":2390},{"style":165},[2391],{"type":75,"value":2316},{"type":69,"tag":146,"props":2393,"children":2394},{"style":294},[2395],{"type":75,"value":2396},"]\n",{"type":69,"tag":146,"props":2398,"children":2399},{"class":148,"line":1421},[2400,2405,2410,2415,2420,2425],{"type":69,"tag":146,"props":2401,"children":2402},{"style":153},[2403],{"type":75,"value":2404},"  if",{"type":69,"tag":146,"props":2406,"children":2407},{"style":294},[2408],{"type":75,"value":2409}," (",{"type":69,"tag":146,"props":2411,"children":2412},{"style":159},[2413],{"type":75,"value":2414},"!",{"type":69,"tag":146,"props":2416,"children":2417},{"style":165},[2418],{"type":75,"value":2419},"createAdapter",{"type":69,"tag":146,"props":2421,"children":2422},{"style":294},[2423],{"type":75,"value":2424},") ",{"type":69,"tag":146,"props":2426,"children":2427},{"style":159},[2428],{"type":75,"value":287},{"type":69,"tag":146,"props":2430,"children":2431},{"class":148,"line":1463},[2432,2437,2442,2447,2451,2456,2461,2466,2470,2475],{"type":69,"tag":146,"props":2433,"children":2434},{"style":153},[2435],{"type":75,"value":2436},"    throw",{"type":69,"tag":146,"props":2438,"children":2439},{"style":159},[2440],{"type":75,"value":2441}," new",{"type":69,"tag":146,"props":2443,"children":2444},{"style":275},[2445],{"type":75,"value":2446}," Error",{"type":69,"tag":146,"props":2448,"children":2449},{"style":294},[2450],{"type":75,"value":282},{"type":69,"tag":146,"props":2452,"children":2453},{"style":159},[2454],{"type":75,"value":2455},"`",{"type":69,"tag":146,"props":2457,"children":2458},{"style":196},[2459],{"type":75,"value":2460},"Unknown provider\u002Fmodel: ",{"type":69,"tag":146,"props":2462,"children":2463},{"style":159},[2464],{"type":75,"value":2465},"${",{"type":69,"tag":146,"props":2467,"children":2468},{"style":165},[2469],{"type":75,"value":2316},{"type":69,"tag":146,"props":2471,"children":2472},{"style":159},[2473],{"type":75,"value":2474},"}`",{"type":69,"tag":146,"props":2476,"children":2477},{"style":294},[2478],{"type":75,"value":432},{"type":69,"tag":146,"props":2480,"children":2481},{"class":148,"line":1505},[2482],{"type":69,"tag":146,"props":2483,"children":2484},{"style":159},[2485],{"type":75,"value":2486},"  }\n",{"type":69,"tag":146,"props":2488,"children":2489},{"class":148,"line":1547},[2490],{"type":69,"tag":146,"props":2491,"children":2492},{"emptyLinePlaceholder":249},[2493],{"type":75,"value":252},{"type":69,"tag":146,"props":2495,"children":2496},{"class":148,"line":1589},[2497,2501,2506,2510,2514,2518],{"type":69,"tag":146,"props":2498,"children":2499},{"style":259},[2500],{"type":75,"value":2369},{"type":69,"tag":146,"props":2502,"children":2503},{"style":165},[2504],{"type":75,"value":2505}," stream",{"type":69,"tag":146,"props":2507,"children":2508},{"style":159},[2509],{"type":75,"value":2100},{"type":69,"tag":146,"props":2511,"children":2512},{"style":275},[2513],{"type":75,"value":168},{"type":69,"tag":146,"props":2515,"children":2516},{"style":294},[2517],{"type":75,"value":282},{"type":69,"tag":146,"props":2519,"children":2520},{"style":159},[2521],{"type":75,"value":287},{"type":69,"tag":146,"props":2523,"children":2524},{"class":148,"line":1597},[2525,2530,2534,2538,2543],{"type":69,"tag":146,"props":2526,"children":2527},{"style":294},[2528],{"type":75,"value":2529},"    adapter",{"type":69,"tag":146,"props":2531,"children":2532},{"style":159},[2533],{"type":75,"value":134},{"type":69,"tag":146,"props":2535,"children":2536},{"style":275},[2537],{"type":75,"value":2374},{"type":69,"tag":146,"props":2539,"children":2540},{"style":294},[2541],{"type":75,"value":2542},"()",{"type":69,"tag":146,"props":2544,"children":2545},{"style":159},[2546],{"type":75,"value":333},{"type":69,"tag":146,"props":2548,"children":2549},{"class":148,"line":1606},[2550,2555],{"type":69,"tag":146,"props":2551,"children":2552},{"style":165},[2553],{"type":75,"value":2554},"    messages",{"type":69,"tag":146,"props":2556,"children":2557},{"style":159},[2558],{"type":75,"value":333},{"type":69,"tag":146,"props":2560,"children":2561},{"class":148,"line":1651},[2562,2567],{"type":69,"tag":146,"props":2563,"children":2564},{"style":159},[2565],{"type":75,"value":2566},"  }",{"type":69,"tag":146,"props":2568,"children":2569},{"style":294},[2570],{"type":75,"value":432},{"type":69,"tag":146,"props":2572,"children":2573},{"class":148,"line":1681},[2574],{"type":69,"tag":146,"props":2575,"children":2576},{"emptyLinePlaceholder":249},[2577],{"type":75,"value":252},{"type":69,"tag":146,"props":2579,"children":2581},{"class":148,"line":2580},25,[2582,2587,2591,2595,2600],{"type":69,"tag":146,"props":2583,"children":2584},{"style":153},[2585],{"type":75,"value":2586},"  return",{"type":69,"tag":146,"props":2588,"children":2589},{"style":275},[2590],{"type":75,"value":178},{"type":69,"tag":146,"props":2592,"children":2593},{"style":294},[2594],{"type":75,"value":282},{"type":69,"tag":146,"props":2596,"children":2597},{"style":165},[2598],{"type":75,"value":2599},"stream",{"type":69,"tag":146,"props":2601,"children":2602},{"style":294},[2603],{"type":75,"value":432},{"type":69,"tag":146,"props":2605,"children":2607},{"class":148,"line":2606},26,[2608],{"type":69,"tag":146,"props":2609,"children":2610},{"style":159},[2611],{"type":75,"value":2281},{"type":69,"tag":538,"props":2613,"children":2615},{"id":2614},"_3-configuring-reasoning-thinking",[2616],{"type":75,"value":2617},"3. Configuring Reasoning \u002F Thinking",{"type":69,"tag":82,"props":2619,"children":2620},{},[2621,2623,2628],{"type":75,"value":2622},"Different providers expose reasoning\u002Fthinking through their ",{"type":69,"tag":107,"props":2624,"children":2626},{"className":2625},[],[2627],{"type":75,"value":505},{"type":75,"value":134},{"type":69,"tag":136,"props":2630,"children":2632},{"className":138,"code":2631,"language":44,"meta":140,"style":140},"import { chat } from '@tanstack\u002Fai'\nimport { openaiText } from '@tanstack\u002Fai-openai'\nimport { anthropicText } from '@tanstack\u002Fai-anthropic'\nimport { geminiText } from '@tanstack\u002Fai-gemini'\n\n\u002F\u002F OpenAI: reasoning with effort and summary\nconst openaiStream = chat({\n  adapter: openaiText('gpt-5.2'),\n  messages,\n  modelOptions: {\n    reasoning: {\n      effort: 'high',\n      summary: 'auto',\n    },\n  },\n})\n\n\u002F\u002F Anthropic: extended thinking with budget_tokens\nconst anthropicStream = chat({\n  adapter: anthropicText('claude-sonnet-4-6'),\n  messages,\n  modelOptions: {\n    max_tokens: 16000,\n    thinking: {\n      type: 'enabled',\n      budget_tokens: 8000, \u002F\u002F must be >= 1024 and \u003C max_tokens\n    },\n  },\n})\n\n\u002F\u002F Anthropic: adaptive thinking (claude-sonnet-4-6 and newer)\nconst adaptiveStream = chat({\n  adapter: anthropicText('claude-sonnet-4-6'),\n  messages,\n  modelOptions: {\n    max_tokens: 16000,\n    thinking: {\n      type: 'adaptive',\n    },\n    effort: 'high', \u002F\u002F 'max' | 'high' | 'medium' | 'low'\n  },\n})\n\n\u002F\u002F Gemini: thinking config with budget or level\nconst geminiStream = chat({\n  adapter: geminiText('gemini-2.5-pro'),\n  messages,\n  modelOptions: {\n    thinkingConfig: {\n      includeThoughts: true,\n      thinkingBudget: 4096,\n    },\n  },\n})\n",[2633],{"type":69,"tag":107,"props":2634,"children":2635},{"__ignoreMap":140},[2636,2671,2706,2741,2776,2783,2791,2819,2858,2869,2884,2900,2929,2958,2966,2973,2984,2991,2999,3027,3066,3077,3092,3113,3129,3158,3184,3192,3200,3212,3220,3229,3258,3298,3310,3326,3346,3362,3391,3399,3433,3441,3453,3461,3470,3499,3539,3551,3567,3584,3607,3629,3637,3645],{"type":69,"tag":146,"props":2637,"children":2638},{"class":148,"line":149},[2639,2643,2647,2651,2655,2659,2663,2667],{"type":69,"tag":146,"props":2640,"children":2641},{"style":153},[2642],{"type":75,"value":156},{"type":69,"tag":146,"props":2644,"children":2645},{"style":159},[2646],{"type":75,"value":162},{"type":69,"tag":146,"props":2648,"children":2649},{"style":165},[2650],{"type":75,"value":168},{"type":69,"tag":146,"props":2652,"children":2653},{"style":159},[2654],{"type":75,"value":183},{"type":69,"tag":146,"props":2656,"children":2657},{"style":153},[2658],{"type":75,"value":188},{"type":69,"tag":146,"props":2660,"children":2661},{"style":159},[2662],{"type":75,"value":193},{"type":69,"tag":146,"props":2664,"children":2665},{"style":196},[2666],{"type":75,"value":199},{"type":69,"tag":146,"props":2668,"children":2669},{"style":159},[2670],{"type":75,"value":204},{"type":69,"tag":146,"props":2672,"children":2673},{"class":148,"line":207},[2674,2678,2682,2686,2690,2694,2698,2702],{"type":69,"tag":146,"props":2675,"children":2676},{"style":153},[2677],{"type":75,"value":156},{"type":69,"tag":146,"props":2679,"children":2680},{"style":159},[2681],{"type":75,"value":162},{"type":69,"tag":146,"props":2683,"children":2684},{"style":165},[2685],{"type":75,"value":221},{"type":69,"tag":146,"props":2687,"children":2688},{"style":159},[2689],{"type":75,"value":183},{"type":69,"tag":146,"props":2691,"children":2692},{"style":153},[2693],{"type":75,"value":188},{"type":69,"tag":146,"props":2695,"children":2696},{"style":159},[2697],{"type":75,"value":193},{"type":69,"tag":146,"props":2699,"children":2700},{"style":196},[2701],{"type":75,"value":238},{"type":69,"tag":146,"props":2703,"children":2704},{"style":159},[2705],{"type":75,"value":204},{"type":69,"tag":146,"props":2707,"children":2708},{"class":148,"line":245},[2709,2713,2717,2721,2725,2729,2733,2737],{"type":69,"tag":146,"props":2710,"children":2711},{"style":153},[2712],{"type":75,"value":156},{"type":69,"tag":146,"props":2714,"children":2715},{"style":159},[2716],{"type":75,"value":162},{"type":69,"tag":146,"props":2718,"children":2719},{"style":165},[2720],{"type":75,"value":1002},{"type":69,"tag":146,"props":2722,"children":2723},{"style":159},[2724],{"type":75,"value":183},{"type":69,"tag":146,"props":2726,"children":2727},{"style":153},[2728],{"type":75,"value":188},{"type":69,"tag":146,"props":2730,"children":2731},{"style":159},[2732],{"type":75,"value":193},{"type":69,"tag":146,"props":2734,"children":2735},{"style":196},[2736],{"type":75,"value":637},{"type":69,"tag":146,"props":2738,"children":2739},{"style":159},[2740],{"type":75,"value":204},{"type":69,"tag":146,"props":2742,"children":2743},{"class":148,"line":255},[2744,2748,2752,2756,2760,2764,2768,2772],{"type":69,"tag":146,"props":2745,"children":2746},{"style":153},[2747],{"type":75,"value":156},{"type":69,"tag":146,"props":2749,"children":2750},{"style":159},[2751],{"type":75,"value":162},{"type":69,"tag":146,"props":2753,"children":2754},{"style":165},[2755],{"type":75,"value":1038},{"type":69,"tag":146,"props":2757,"children":2758},{"style":159},[2759],{"type":75,"value":183},{"type":69,"tag":146,"props":2761,"children":2762},{"style":153},[2763],{"type":75,"value":188},{"type":69,"tag":146,"props":2765,"children":2766},{"style":159},[2767],{"type":75,"value":193},{"type":69,"tag":146,"props":2769,"children":2770},{"style":196},[2771],{"type":75,"value":672},{"type":69,"tag":146,"props":2773,"children":2774},{"style":159},[2775],{"type":75,"value":204},{"type":69,"tag":146,"props":2777,"children":2778},{"class":148,"line":290},[2779],{"type":69,"tag":146,"props":2780,"children":2781},{"emptyLinePlaceholder":249},[2782],{"type":75,"value":252},{"type":69,"tag":146,"props":2784,"children":2785},{"class":148,"line":336},[2786],{"type":69,"tag":146,"props":2787,"children":2788},{"style":948},[2789],{"type":75,"value":2790},"\u002F\u002F OpenAI: reasoning with effort and summary\n",{"type":69,"tag":146,"props":2792,"children":2793},{"class":148,"line":349},[2794,2798,2803,2807,2811,2815],{"type":69,"tag":146,"props":2795,"children":2796},{"style":259},[2797],{"type":75,"value":262},{"type":69,"tag":146,"props":2799,"children":2800},{"style":165},[2801],{"type":75,"value":2802}," openaiStream ",{"type":69,"tag":146,"props":2804,"children":2805},{"style":159},[2806],{"type":75,"value":272},{"type":69,"tag":146,"props":2808,"children":2809},{"style":275},[2810],{"type":75,"value":168},{"type":69,"tag":146,"props":2812,"children":2813},{"style":165},[2814],{"type":75,"value":282},{"type":69,"tag":146,"props":2816,"children":2817},{"style":159},[2818],{"type":75,"value":287},{"type":69,"tag":146,"props":2820,"children":2821},{"class":148,"line":367},[2822,2826,2830,2834,2838,2842,2846,2850,2854],{"type":69,"tag":146,"props":2823,"children":2824},{"style":294},[2825],{"type":75,"value":297},{"type":69,"tag":146,"props":2827,"children":2828},{"style":159},[2829],{"type":75,"value":134},{"type":69,"tag":146,"props":2831,"children":2832},{"style":275},[2833],{"type":75,"value":221},{"type":69,"tag":146,"props":2835,"children":2836},{"style":165},[2837],{"type":75,"value":282},{"type":69,"tag":146,"props":2839,"children":2840},{"style":159},[2841],{"type":75,"value":314},{"type":69,"tag":146,"props":2843,"children":2844},{"style":196},[2845],{"type":75,"value":319},{"type":69,"tag":146,"props":2847,"children":2848},{"style":159},[2849],{"type":75,"value":314},{"type":69,"tag":146,"props":2851,"children":2852},{"style":165},[2853],{"type":75,"value":328},{"type":69,"tag":146,"props":2855,"children":2856},{"style":159},[2857],{"type":75,"value":333},{"type":69,"tag":146,"props":2859,"children":2860},{"class":148,"line":390},[2861,2865],{"type":69,"tag":146,"props":2862,"children":2863},{"style":165},[2864],{"type":75,"value":342},{"type":69,"tag":146,"props":2866,"children":2867},{"style":159},[2868],{"type":75,"value":333},{"type":69,"tag":146,"props":2870,"children":2871},{"class":148,"line":412},[2872,2876,2880],{"type":69,"tag":146,"props":2873,"children":2874},{"style":294},[2875],{"type":75,"value":355},{"type":69,"tag":146,"props":2877,"children":2878},{"style":159},[2879],{"type":75,"value":134},{"type":69,"tag":146,"props":2881,"children":2882},{"style":159},[2883],{"type":75,"value":364},{"type":69,"tag":146,"props":2885,"children":2886},{"class":148,"line":421},[2887,2892,2896],{"type":69,"tag":146,"props":2888,"children":2889},{"style":294},[2890],{"type":75,"value":2891},"    reasoning",{"type":69,"tag":146,"props":2893,"children":2894},{"style":159},[2895],{"type":75,"value":134},{"type":69,"tag":146,"props":2897,"children":2898},{"style":159},[2899],{"type":75,"value":364},{"type":69,"tag":146,"props":2901,"children":2902},{"class":148,"line":435},[2903,2908,2912,2916,2921,2925],{"type":69,"tag":146,"props":2904,"children":2905},{"style":294},[2906],{"type":75,"value":2907},"      effort",{"type":69,"tag":146,"props":2909,"children":2910},{"style":159},[2911],{"type":75,"value":134},{"type":69,"tag":146,"props":2913,"children":2914},{"style":159},[2915],{"type":75,"value":193},{"type":69,"tag":146,"props":2917,"children":2918},{"style":196},[2919],{"type":75,"value":2920},"high",{"type":69,"tag":146,"props":2922,"children":2923},{"style":159},[2924],{"type":75,"value":314},{"type":69,"tag":146,"props":2926,"children":2927},{"style":159},[2928],{"type":75,"value":333},{"type":69,"tag":146,"props":2930,"children":2931},{"class":148,"line":443},[2932,2937,2941,2945,2950,2954],{"type":69,"tag":146,"props":2933,"children":2934},{"style":294},[2935],{"type":75,"value":2936},"      summary",{"type":69,"tag":146,"props":2938,"children":2939},{"style":159},[2940],{"type":75,"value":134},{"type":69,"tag":146,"props":2942,"children":2943},{"style":159},[2944],{"type":75,"value":193},{"type":69,"tag":146,"props":2946,"children":2947},{"style":196},[2948],{"type":75,"value":2949},"auto",{"type":69,"tag":146,"props":2951,"children":2952},{"style":159},[2953],{"type":75,"value":314},{"type":69,"tag":146,"props":2955,"children":2956},{"style":159},[2957],{"type":75,"value":333},{"type":69,"tag":146,"props":2959,"children":2960},{"class":148,"line":1337},[2961],{"type":69,"tag":146,"props":2962,"children":2963},{"style":159},[2964],{"type":75,"value":2965},"    },\n",{"type":69,"tag":146,"props":2967,"children":2968},{"class":148,"line":1379},[2969],{"type":69,"tag":146,"props":2970,"children":2971},{"style":159},[2972],{"type":75,"value":418},{"type":69,"tag":146,"props":2974,"children":2975},{"class":148,"line":1421},[2976,2980],{"type":69,"tag":146,"props":2977,"children":2978},{"style":159},[2979],{"type":75,"value":427},{"type":69,"tag":146,"props":2981,"children":2982},{"style":165},[2983],{"type":75,"value":432},{"type":69,"tag":146,"props":2985,"children":2986},{"class":148,"line":1463},[2987],{"type":69,"tag":146,"props":2988,"children":2989},{"emptyLinePlaceholder":249},[2990],{"type":75,"value":252},{"type":69,"tag":146,"props":2992,"children":2993},{"class":148,"line":1505},[2994],{"type":69,"tag":146,"props":2995,"children":2996},{"style":948},[2997],{"type":75,"value":2998},"\u002F\u002F Anthropic: extended thinking with budget_tokens\n",{"type":69,"tag":146,"props":3000,"children":3001},{"class":148,"line":1547},[3002,3006,3011,3015,3019,3023],{"type":69,"tag":146,"props":3003,"children":3004},{"style":259},[3005],{"type":75,"value":262},{"type":69,"tag":146,"props":3007,"children":3008},{"style":165},[3009],{"type":75,"value":3010}," anthropicStream ",{"type":69,"tag":146,"props":3012,"children":3013},{"style":159},[3014],{"type":75,"value":272},{"type":69,"tag":146,"props":3016,"children":3017},{"style":275},[3018],{"type":75,"value":168},{"type":69,"tag":146,"props":3020,"children":3021},{"style":165},[3022],{"type":75,"value":282},{"type":69,"tag":146,"props":3024,"children":3025},{"style":159},[3026],{"type":75,"value":287},{"type":69,"tag":146,"props":3028,"children":3029},{"class":148,"line":1589},[3030,3034,3038,3042,3046,3050,3054,3058,3062],{"type":69,"tag":146,"props":3031,"children":3032},{"style":294},[3033],{"type":75,"value":297},{"type":69,"tag":146,"props":3035,"children":3036},{"style":159},[3037],{"type":75,"value":134},{"type":69,"tag":146,"props":3039,"children":3040},{"style":275},[3041],{"type":75,"value":1002},{"type":69,"tag":146,"props":3043,"children":3044},{"style":165},[3045],{"type":75,"value":282},{"type":69,"tag":146,"props":3047,"children":3048},{"style":159},[3049],{"type":75,"value":314},{"type":69,"tag":146,"props":3051,"children":3052},{"style":196},[3053],{"type":75,"value":1326},{"type":69,"tag":146,"props":3055,"children":3056},{"style":159},[3057],{"type":75,"value":314},{"type":69,"tag":146,"props":3059,"children":3060},{"style":165},[3061],{"type":75,"value":328},{"type":69,"tag":146,"props":3063,"children":3064},{"style":159},[3065],{"type":75,"value":333},{"type":69,"tag":146,"props":3067,"children":3068},{"class":148,"line":1597},[3069,3073],{"type":69,"tag":146,"props":3070,"children":3071},{"style":165},[3072],{"type":75,"value":342},{"type":69,"tag":146,"props":3074,"children":3075},{"style":159},[3076],{"type":75,"value":333},{"type":69,"tag":146,"props":3078,"children":3079},{"class":148,"line":1606},[3080,3084,3088],{"type":69,"tag":146,"props":3081,"children":3082},{"style":294},[3083],{"type":75,"value":355},{"type":69,"tag":146,"props":3085,"children":3086},{"style":159},[3087],{"type":75,"value":134},{"type":69,"tag":146,"props":3089,"children":3090},{"style":159},[3091],{"type":75,"value":364},{"type":69,"tag":146,"props":3093,"children":3094},{"class":148,"line":1651},[3095,3100,3104,3109],{"type":69,"tag":146,"props":3096,"children":3097},{"style":294},[3098],{"type":75,"value":3099},"    max_tokens",{"type":69,"tag":146,"props":3101,"children":3102},{"style":159},[3103],{"type":75,"value":134},{"type":69,"tag":146,"props":3105,"children":3106},{"style":380},[3107],{"type":75,"value":3108}," 16000",{"type":69,"tag":146,"props":3110,"children":3111},{"style":159},[3112],{"type":75,"value":333},{"type":69,"tag":146,"props":3114,"children":3115},{"class":148,"line":1681},[3116,3121,3125],{"type":69,"tag":146,"props":3117,"children":3118},{"style":294},[3119],{"type":75,"value":3120},"    thinking",{"type":69,"tag":146,"props":3122,"children":3123},{"style":159},[3124],{"type":75,"value":134},{"type":69,"tag":146,"props":3126,"children":3127},{"style":159},[3128],{"type":75,"value":364},{"type":69,"tag":146,"props":3130,"children":3131},{"class":148,"line":2580},[3132,3137,3141,3145,3150,3154],{"type":69,"tag":146,"props":3133,"children":3134},{"style":294},[3135],{"type":75,"value":3136},"      type",{"type":69,"tag":146,"props":3138,"children":3139},{"style":159},[3140],{"type":75,"value":134},{"type":69,"tag":146,"props":3142,"children":3143},{"style":159},[3144],{"type":75,"value":193},{"type":69,"tag":146,"props":3146,"children":3147},{"style":196},[3148],{"type":75,"value":3149},"enabled",{"type":69,"tag":146,"props":3151,"children":3152},{"style":159},[3153],{"type":75,"value":314},{"type":69,"tag":146,"props":3155,"children":3156},{"style":159},[3157],{"type":75,"value":333},{"type":69,"tag":146,"props":3159,"children":3160},{"class":148,"line":2606},[3161,3166,3170,3175,3179],{"type":69,"tag":146,"props":3162,"children":3163},{"style":294},[3164],{"type":75,"value":3165},"      budget_tokens",{"type":69,"tag":146,"props":3167,"children":3168},{"style":159},[3169],{"type":75,"value":134},{"type":69,"tag":146,"props":3171,"children":3172},{"style":380},[3173],{"type":75,"value":3174}," 8000",{"type":69,"tag":146,"props":3176,"children":3177},{"style":159},[3178],{"type":75,"value":173},{"type":69,"tag":146,"props":3180,"children":3181},{"style":948},[3182],{"type":75,"value":3183}," \u002F\u002F must be >= 1024 and \u003C max_tokens\n",{"type":69,"tag":146,"props":3185,"children":3187},{"class":148,"line":3186},27,[3188],{"type":69,"tag":146,"props":3189,"children":3190},{"style":159},[3191],{"type":75,"value":2965},{"type":69,"tag":146,"props":3193,"children":3195},{"class":148,"line":3194},28,[3196],{"type":69,"tag":146,"props":3197,"children":3198},{"style":159},[3199],{"type":75,"value":418},{"type":69,"tag":146,"props":3201,"children":3203},{"class":148,"line":3202},29,[3204,3208],{"type":69,"tag":146,"props":3205,"children":3206},{"style":159},[3207],{"type":75,"value":427},{"type":69,"tag":146,"props":3209,"children":3210},{"style":165},[3211],{"type":75,"value":432},{"type":69,"tag":146,"props":3213,"children":3215},{"class":148,"line":3214},30,[3216],{"type":69,"tag":146,"props":3217,"children":3218},{"emptyLinePlaceholder":249},[3219],{"type":75,"value":252},{"type":69,"tag":146,"props":3221,"children":3223},{"class":148,"line":3222},31,[3224],{"type":69,"tag":146,"props":3225,"children":3226},{"style":948},[3227],{"type":75,"value":3228},"\u002F\u002F Anthropic: adaptive thinking (claude-sonnet-4-6 and newer)\n",{"type":69,"tag":146,"props":3230,"children":3232},{"class":148,"line":3231},32,[3233,3237,3242,3246,3250,3254],{"type":69,"tag":146,"props":3234,"children":3235},{"style":259},[3236],{"type":75,"value":262},{"type":69,"tag":146,"props":3238,"children":3239},{"style":165},[3240],{"type":75,"value":3241}," adaptiveStream ",{"type":69,"tag":146,"props":3243,"children":3244},{"style":159},[3245],{"type":75,"value":272},{"type":69,"tag":146,"props":3247,"children":3248},{"style":275},[3249],{"type":75,"value":168},{"type":69,"tag":146,"props":3251,"children":3252},{"style":165},[3253],{"type":75,"value":282},{"type":69,"tag":146,"props":3255,"children":3256},{"style":159},[3257],{"type":75,"value":287},{"type":69,"tag":146,"props":3259,"children":3261},{"class":148,"line":3260},33,[3262,3266,3270,3274,3278,3282,3286,3290,3294],{"type":69,"tag":146,"props":3263,"children":3264},{"style":294},[3265],{"type":75,"value":297},{"type":69,"tag":146,"props":3267,"children":3268},{"style":159},[3269],{"type":75,"value":134},{"type":69,"tag":146,"props":3271,"children":3272},{"style":275},[3273],{"type":75,"value":1002},{"type":69,"tag":146,"props":3275,"children":3276},{"style":165},[3277],{"type":75,"value":282},{"type":69,"tag":146,"props":3279,"children":3280},{"style":159},[3281],{"type":75,"value":314},{"type":69,"tag":146,"props":3283,"children":3284},{"style":196},[3285],{"type":75,"value":1326},{"type":69,"tag":146,"props":3287,"children":3288},{"style":159},[3289],{"type":75,"value":314},{"type":69,"tag":146,"props":3291,"children":3292},{"style":165},[3293],{"type":75,"value":328},{"type":69,"tag":146,"props":3295,"children":3296},{"style":159},[3297],{"type":75,"value":333},{"type":69,"tag":146,"props":3299,"children":3301},{"class":148,"line":3300},34,[3302,3306],{"type":69,"tag":146,"props":3303,"children":3304},{"style":165},[3305],{"type":75,"value":342},{"type":69,"tag":146,"props":3307,"children":3308},{"style":159},[3309],{"type":75,"value":333},{"type":69,"tag":146,"props":3311,"children":3313},{"class":148,"line":3312},35,[3314,3318,3322],{"type":69,"tag":146,"props":3315,"children":3316},{"style":294},[3317],{"type":75,"value":355},{"type":69,"tag":146,"props":3319,"children":3320},{"style":159},[3321],{"type":75,"value":134},{"type":69,"tag":146,"props":3323,"children":3324},{"style":159},[3325],{"type":75,"value":364},{"type":69,"tag":146,"props":3327,"children":3329},{"class":148,"line":3328},36,[3330,3334,3338,3342],{"type":69,"tag":146,"props":3331,"children":3332},{"style":294},[3333],{"type":75,"value":3099},{"type":69,"tag":146,"props":3335,"children":3336},{"style":159},[3337],{"type":75,"value":134},{"type":69,"tag":146,"props":3339,"children":3340},{"style":380},[3341],{"type":75,"value":3108},{"type":69,"tag":146,"props":3343,"children":3344},{"style":159},[3345],{"type":75,"value":333},{"type":69,"tag":146,"props":3347,"children":3349},{"class":148,"line":3348},37,[3350,3354,3358],{"type":69,"tag":146,"props":3351,"children":3352},{"style":294},[3353],{"type":75,"value":3120},{"type":69,"tag":146,"props":3355,"children":3356},{"style":159},[3357],{"type":75,"value":134},{"type":69,"tag":146,"props":3359,"children":3360},{"style":159},[3361],{"type":75,"value":364},{"type":69,"tag":146,"props":3363,"children":3365},{"class":148,"line":3364},38,[3366,3370,3374,3378,3383,3387],{"type":69,"tag":146,"props":3367,"children":3368},{"style":294},[3369],{"type":75,"value":3136},{"type":69,"tag":146,"props":3371,"children":3372},{"style":159},[3373],{"type":75,"value":134},{"type":69,"tag":146,"props":3375,"children":3376},{"style":159},[3377],{"type":75,"value":193},{"type":69,"tag":146,"props":3379,"children":3380},{"style":196},[3381],{"type":75,"value":3382},"adaptive",{"type":69,"tag":146,"props":3384,"children":3385},{"style":159},[3386],{"type":75,"value":314},{"type":69,"tag":146,"props":3388,"children":3389},{"style":159},[3390],{"type":75,"value":333},{"type":69,"tag":146,"props":3392,"children":3394},{"class":148,"line":3393},39,[3395],{"type":69,"tag":146,"props":3396,"children":3397},{"style":159},[3398],{"type":75,"value":2965},{"type":69,"tag":146,"props":3400,"children":3402},{"class":148,"line":3401},40,[3403,3408,3412,3416,3420,3424,3428],{"type":69,"tag":146,"props":3404,"children":3405},{"style":294},[3406],{"type":75,"value":3407},"    effort",{"type":69,"tag":146,"props":3409,"children":3410},{"style":159},[3411],{"type":75,"value":134},{"type":69,"tag":146,"props":3413,"children":3414},{"style":159},[3415],{"type":75,"value":193},{"type":69,"tag":146,"props":3417,"children":3418},{"style":196},[3419],{"type":75,"value":2920},{"type":69,"tag":146,"props":3421,"children":3422},{"style":159},[3423],{"type":75,"value":314},{"type":69,"tag":146,"props":3425,"children":3426},{"style":159},[3427],{"type":75,"value":173},{"type":69,"tag":146,"props":3429,"children":3430},{"style":948},[3431],{"type":75,"value":3432}," \u002F\u002F 'max' | 'high' | 'medium' | 'low'\n",{"type":69,"tag":146,"props":3434,"children":3436},{"class":148,"line":3435},41,[3437],{"type":69,"tag":146,"props":3438,"children":3439},{"style":159},[3440],{"type":75,"value":418},{"type":69,"tag":146,"props":3442,"children":3444},{"class":148,"line":3443},42,[3445,3449],{"type":69,"tag":146,"props":3446,"children":3447},{"style":159},[3448],{"type":75,"value":427},{"type":69,"tag":146,"props":3450,"children":3451},{"style":165},[3452],{"type":75,"value":432},{"type":69,"tag":146,"props":3454,"children":3456},{"class":148,"line":3455},43,[3457],{"type":69,"tag":146,"props":3458,"children":3459},{"emptyLinePlaceholder":249},[3460],{"type":75,"value":252},{"type":69,"tag":146,"props":3462,"children":3464},{"class":148,"line":3463},44,[3465],{"type":69,"tag":146,"props":3466,"children":3467},{"style":948},[3468],{"type":75,"value":3469},"\u002F\u002F Gemini: thinking config with budget or level\n",{"type":69,"tag":146,"props":3471,"children":3473},{"class":148,"line":3472},45,[3474,3478,3483,3487,3491,3495],{"type":69,"tag":146,"props":3475,"children":3476},{"style":259},[3477],{"type":75,"value":262},{"type":69,"tag":146,"props":3479,"children":3480},{"style":165},[3481],{"type":75,"value":3482}," geminiStream ",{"type":69,"tag":146,"props":3484,"children":3485},{"style":159},[3486],{"type":75,"value":272},{"type":69,"tag":146,"props":3488,"children":3489},{"style":275},[3490],{"type":75,"value":168},{"type":69,"tag":146,"props":3492,"children":3493},{"style":165},[3494],{"type":75,"value":282},{"type":69,"tag":146,"props":3496,"children":3497},{"style":159},[3498],{"type":75,"value":287},{"type":69,"tag":146,"props":3500,"children":3502},{"class":148,"line":3501},46,[3503,3507,3511,3515,3519,3523,3527,3531,3535],{"type":69,"tag":146,"props":3504,"children":3505},{"style":294},[3506],{"type":75,"value":297},{"type":69,"tag":146,"props":3508,"children":3509},{"style":159},[3510],{"type":75,"value":134},{"type":69,"tag":146,"props":3512,"children":3513},{"style":275},[3514],{"type":75,"value":1038},{"type":69,"tag":146,"props":3516,"children":3517},{"style":165},[3518],{"type":75,"value":282},{"type":69,"tag":146,"props":3520,"children":3521},{"style":159},[3522],{"type":75,"value":314},{"type":69,"tag":146,"props":3524,"children":3525},{"style":196},[3526],{"type":75,"value":1368},{"type":69,"tag":146,"props":3528,"children":3529},{"style":159},[3530],{"type":75,"value":314},{"type":69,"tag":146,"props":3532,"children":3533},{"style":165},[3534],{"type":75,"value":328},{"type":69,"tag":146,"props":3536,"children":3537},{"style":159},[3538],{"type":75,"value":333},{"type":69,"tag":146,"props":3540,"children":3542},{"class":148,"line":3541},47,[3543,3547],{"type":69,"tag":146,"props":3544,"children":3545},{"style":165},[3546],{"type":75,"value":342},{"type":69,"tag":146,"props":3548,"children":3549},{"style":159},[3550],{"type":75,"value":333},{"type":69,"tag":146,"props":3552,"children":3554},{"class":148,"line":3553},48,[3555,3559,3563],{"type":69,"tag":146,"props":3556,"children":3557},{"style":294},[3558],{"type":75,"value":355},{"type":69,"tag":146,"props":3560,"children":3561},{"style":159},[3562],{"type":75,"value":134},{"type":69,"tag":146,"props":3564,"children":3565},{"style":159},[3566],{"type":75,"value":364},{"type":69,"tag":146,"props":3568,"children":3570},{"class":148,"line":3569},49,[3571,3576,3580],{"type":69,"tag":146,"props":3572,"children":3573},{"style":294},[3574],{"type":75,"value":3575},"    thinkingConfig",{"type":69,"tag":146,"props":3577,"children":3578},{"style":159},[3579],{"type":75,"value":134},{"type":69,"tag":146,"props":3581,"children":3582},{"style":159},[3583],{"type":75,"value":364},{"type":69,"tag":146,"props":3585,"children":3587},{"class":148,"line":3586},50,[3588,3593,3597,3603],{"type":69,"tag":146,"props":3589,"children":3590},{"style":294},[3591],{"type":75,"value":3592},"      includeThoughts",{"type":69,"tag":146,"props":3594,"children":3595},{"style":159},[3596],{"type":75,"value":134},{"type":69,"tag":146,"props":3598,"children":3600},{"style":3599},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[3601],{"type":75,"value":3602}," true",{"type":69,"tag":146,"props":3604,"children":3605},{"style":159},[3606],{"type":75,"value":333},{"type":69,"tag":146,"props":3608,"children":3610},{"class":148,"line":3609},51,[3611,3616,3620,3625],{"type":69,"tag":146,"props":3612,"children":3613},{"style":294},[3614],{"type":75,"value":3615},"      thinkingBudget",{"type":69,"tag":146,"props":3617,"children":3618},{"style":159},[3619],{"type":75,"value":134},{"type":69,"tag":146,"props":3621,"children":3622},{"style":380},[3623],{"type":75,"value":3624}," 4096",{"type":69,"tag":146,"props":3626,"children":3627},{"style":159},[3628],{"type":75,"value":333},{"type":69,"tag":146,"props":3630,"children":3632},{"class":148,"line":3631},52,[3633],{"type":69,"tag":146,"props":3634,"children":3635},{"style":159},[3636],{"type":75,"value":2965},{"type":69,"tag":146,"props":3638,"children":3640},{"class":148,"line":3639},53,[3641],{"type":69,"tag":146,"props":3642,"children":3643},{"style":159},[3644],{"type":75,"value":418},{"type":69,"tag":146,"props":3646,"children":3648},{"class":148,"line":3647},54,[3649,3653],{"type":69,"tag":146,"props":3650,"children":3651},{"style":159},[3652],{"type":75,"value":427},{"type":69,"tag":146,"props":3654,"children":3655},{"style":165},[3656],{"type":75,"value":432},{"type":69,"tag":538,"props":3658,"children":3660},{"id":3659},"_4-extending-adapters-with-custom-models",[3661],{"type":75,"value":3662},"4. Extending Adapters with Custom Models",{"type":69,"tag":82,"props":3664,"children":3665},{},[3666,3667,3673,3675,3681],{"type":75,"value":1789},{"type":69,"tag":107,"props":3668,"children":3670},{"className":3669},[],[3671],{"type":75,"value":3672},"extendAdapter()",{"type":75,"value":3674}," and ",{"type":69,"tag":107,"props":3676,"children":3678},{"className":3677},[],[3679],{"type":75,"value":3680},"createModel()",{"type":75,"value":3682}," to add custom or fine-tuned models\nwhile preserving type safety for the original models:",{"type":69,"tag":136,"props":3684,"children":3686},{"className":138,"code":3685,"language":44,"meta":140,"style":140},"import { extendAdapter, createModel } from '@tanstack\u002Fai'\nimport { openaiText } from '@tanstack\u002Fai-openai'\n\n\u002F\u002F Define custom models\nconst customModels = [\n  createModel('ft:gpt-5.2:my-org:custom-model:abc123', ['text', 'image']),\n  createModel('my-local-proxy-model', ['text']),\n] as const\n\n\u002F\u002F Create extended factory - original models still fully typed\nconst myOpenai = extendAdapter(openaiText, customModels)\n\n\u002F\u002F Use original models - full type inference preserved\nconst gpt5 = myOpenai('gpt-5.2')\n\n\u002F\u002F Use custom models - accepted by the type system\nconst custom = myOpenai('ft:gpt-5.2:my-org:custom-model:abc123')\n\n\u002F\u002F Type error: 'nonexistent-model' is not a valid model\n\u002F\u002F myOpenai('nonexistent-model')\n",[3687],{"type":69,"tag":107,"props":3688,"children":3689},{"__ignoreMap":140},[3690,3735,3770,3777,3785,3806,3878,3930,3948,3955,3963,3997,4004,4012,4053,4060,4068,4108,4115,4123],{"type":69,"tag":146,"props":3691,"children":3692},{"class":148,"line":149},[3693,3697,3701,3706,3710,3715,3719,3723,3727,3731],{"type":69,"tag":146,"props":3694,"children":3695},{"style":153},[3696],{"type":75,"value":156},{"type":69,"tag":146,"props":3698,"children":3699},{"style":159},[3700],{"type":75,"value":162},{"type":69,"tag":146,"props":3702,"children":3703},{"style":165},[3704],{"type":75,"value":3705}," extendAdapter",{"type":69,"tag":146,"props":3707,"children":3708},{"style":159},[3709],{"type":75,"value":173},{"type":69,"tag":146,"props":3711,"children":3712},{"style":165},[3713],{"type":75,"value":3714}," createModel",{"type":69,"tag":146,"props":3716,"children":3717},{"style":159},[3718],{"type":75,"value":183},{"type":69,"tag":146,"props":3720,"children":3721},{"style":153},[3722],{"type":75,"value":188},{"type":69,"tag":146,"props":3724,"children":3725},{"style":159},[3726],{"type":75,"value":193},{"type":69,"tag":146,"props":3728,"children":3729},{"style":196},[3730],{"type":75,"value":199},{"type":69,"tag":146,"props":3732,"children":3733},{"style":159},[3734],{"type":75,"value":204},{"type":69,"tag":146,"props":3736,"children":3737},{"class":148,"line":207},[3738,3742,3746,3750,3754,3758,3762,3766],{"type":69,"tag":146,"props":3739,"children":3740},{"style":153},[3741],{"type":75,"value":156},{"type":69,"tag":146,"props":3743,"children":3744},{"style":159},[3745],{"type":75,"value":162},{"type":69,"tag":146,"props":3747,"children":3748},{"style":165},[3749],{"type":75,"value":221},{"type":69,"tag":146,"props":3751,"children":3752},{"style":159},[3753],{"type":75,"value":183},{"type":69,"tag":146,"props":3755,"children":3756},{"style":153},[3757],{"type":75,"value":188},{"type":69,"tag":146,"props":3759,"children":3760},{"style":159},[3761],{"type":75,"value":193},{"type":69,"tag":146,"props":3763,"children":3764},{"style":196},[3765],{"type":75,"value":238},{"type":69,"tag":146,"props":3767,"children":3768},{"style":159},[3769],{"type":75,"value":204},{"type":69,"tag":146,"props":3771,"children":3772},{"class":148,"line":245},[3773],{"type":69,"tag":146,"props":3774,"children":3775},{"emptyLinePlaceholder":249},[3776],{"type":75,"value":252},{"type":69,"tag":146,"props":3778,"children":3779},{"class":148,"line":255},[3780],{"type":69,"tag":146,"props":3781,"children":3782},{"style":948},[3783],{"type":75,"value":3784},"\u002F\u002F Define custom models\n",{"type":69,"tag":146,"props":3786,"children":3787},{"class":148,"line":290},[3788,3792,3797,3801],{"type":69,"tag":146,"props":3789,"children":3790},{"style":259},[3791],{"type":75,"value":262},{"type":69,"tag":146,"props":3793,"children":3794},{"style":165},[3795],{"type":75,"value":3796}," customModels ",{"type":69,"tag":146,"props":3798,"children":3799},{"style":159},[3800],{"type":75,"value":272},{"type":69,"tag":146,"props":3802,"children":3803},{"style":165},[3804],{"type":75,"value":3805}," [\n",{"type":69,"tag":146,"props":3807,"children":3808},{"class":148,"line":336},[3809,3814,3818,3822,3827,3831,3835,3840,3844,3848,3852,3856,3860,3865,3869,3874],{"type":69,"tag":146,"props":3810,"children":3811},{"style":275},[3812],{"type":75,"value":3813},"  createModel",{"type":69,"tag":146,"props":3815,"children":3816},{"style":165},[3817],{"type":75,"value":282},{"type":69,"tag":146,"props":3819,"children":3820},{"style":159},[3821],{"type":75,"value":314},{"type":69,"tag":146,"props":3823,"children":3824},{"style":196},[3825],{"type":75,"value":3826},"ft:gpt-5.2:my-org:custom-model:abc123",{"type":69,"tag":146,"props":3828,"children":3829},{"style":159},[3830],{"type":75,"value":314},{"type":69,"tag":146,"props":3832,"children":3833},{"style":159},[3834],{"type":75,"value":173},{"type":69,"tag":146,"props":3836,"children":3837},{"style":165},[3838],{"type":75,"value":3839}," [",{"type":69,"tag":146,"props":3841,"children":3842},{"style":159},[3843],{"type":75,"value":314},{"type":69,"tag":146,"props":3845,"children":3846},{"style":196},[3847],{"type":75,"value":75},{"type":69,"tag":146,"props":3849,"children":3850},{"style":159},[3851],{"type":75,"value":314},{"type":69,"tag":146,"props":3853,"children":3854},{"style":159},[3855],{"type":75,"value":173},{"type":69,"tag":146,"props":3857,"children":3858},{"style":159},[3859],{"type":75,"value":193},{"type":69,"tag":146,"props":3861,"children":3862},{"style":196},[3863],{"type":75,"value":3864},"image",{"type":69,"tag":146,"props":3866,"children":3867},{"style":159},[3868],{"type":75,"value":314},{"type":69,"tag":146,"props":3870,"children":3871},{"style":165},[3872],{"type":75,"value":3873},"])",{"type":69,"tag":146,"props":3875,"children":3876},{"style":159},[3877],{"type":75,"value":333},{"type":69,"tag":146,"props":3879,"children":3880},{"class":148,"line":349},[3881,3885,3889,3893,3898,3902,3906,3910,3914,3918,3922,3926],{"type":69,"tag":146,"props":3882,"children":3883},{"style":275},[3884],{"type":75,"value":3813},{"type":69,"tag":146,"props":3886,"children":3887},{"style":165},[3888],{"type":75,"value":282},{"type":69,"tag":146,"props":3890,"children":3891},{"style":159},[3892],{"type":75,"value":314},{"type":69,"tag":146,"props":3894,"children":3895},{"style":196},[3896],{"type":75,"value":3897},"my-local-proxy-model",{"type":69,"tag":146,"props":3899,"children":3900},{"style":159},[3901],{"type":75,"value":314},{"type":69,"tag":146,"props":3903,"children":3904},{"style":159},[3905],{"type":75,"value":173},{"type":69,"tag":146,"props":3907,"children":3908},{"style":165},[3909],{"type":75,"value":3839},{"type":69,"tag":146,"props":3911,"children":3912},{"style":159},[3913],{"type":75,"value":314},{"type":69,"tag":146,"props":3915,"children":3916},{"style":196},[3917],{"type":75,"value":75},{"type":69,"tag":146,"props":3919,"children":3920},{"style":159},[3921],{"type":75,"value":314},{"type":69,"tag":146,"props":3923,"children":3924},{"style":165},[3925],{"type":75,"value":3873},{"type":69,"tag":146,"props":3927,"children":3928},{"style":159},[3929],{"type":75,"value":333},{"type":69,"tag":146,"props":3931,"children":3932},{"class":148,"line":367},[3933,3938,3943],{"type":69,"tag":146,"props":3934,"children":3935},{"style":165},[3936],{"type":75,"value":3937},"] ",{"type":69,"tag":146,"props":3939,"children":3940},{"style":153},[3941],{"type":75,"value":3942},"as",{"type":69,"tag":146,"props":3944,"children":3945},{"style":259},[3946],{"type":75,"value":3947}," const\n",{"type":69,"tag":146,"props":3949,"children":3950},{"class":148,"line":390},[3951],{"type":69,"tag":146,"props":3952,"children":3953},{"emptyLinePlaceholder":249},[3954],{"type":75,"value":252},{"type":69,"tag":146,"props":3956,"children":3957},{"class":148,"line":412},[3958],{"type":69,"tag":146,"props":3959,"children":3960},{"style":948},[3961],{"type":75,"value":3962},"\u002F\u002F Create extended factory - original models still fully typed\n",{"type":69,"tag":146,"props":3964,"children":3965},{"class":148,"line":421},[3966,3970,3975,3979,3983,3988,3992],{"type":69,"tag":146,"props":3967,"children":3968},{"style":259},[3969],{"type":75,"value":262},{"type":69,"tag":146,"props":3971,"children":3972},{"style":165},[3973],{"type":75,"value":3974}," myOpenai ",{"type":69,"tag":146,"props":3976,"children":3977},{"style":159},[3978],{"type":75,"value":272},{"type":69,"tag":146,"props":3980,"children":3981},{"style":275},[3982],{"type":75,"value":3705},{"type":69,"tag":146,"props":3984,"children":3985},{"style":165},[3986],{"type":75,"value":3987},"(openaiText",{"type":69,"tag":146,"props":3989,"children":3990},{"style":159},[3991],{"type":75,"value":173},{"type":69,"tag":146,"props":3993,"children":3994},{"style":165},[3995],{"type":75,"value":3996}," customModels)\n",{"type":69,"tag":146,"props":3998,"children":3999},{"class":148,"line":435},[4000],{"type":69,"tag":146,"props":4001,"children":4002},{"emptyLinePlaceholder":249},[4003],{"type":75,"value":252},{"type":69,"tag":146,"props":4005,"children":4006},{"class":148,"line":443},[4007],{"type":69,"tag":146,"props":4008,"children":4009},{"style":948},[4010],{"type":75,"value":4011},"\u002F\u002F Use original models - full type inference preserved\n",{"type":69,"tag":146,"props":4013,"children":4014},{"class":148,"line":1337},[4015,4019,4024,4028,4033,4037,4041,4045,4049],{"type":69,"tag":146,"props":4016,"children":4017},{"style":259},[4018],{"type":75,"value":262},{"type":69,"tag":146,"props":4020,"children":4021},{"style":165},[4022],{"type":75,"value":4023}," gpt5 ",{"type":69,"tag":146,"props":4025,"children":4026},{"style":159},[4027],{"type":75,"value":272},{"type":69,"tag":146,"props":4029,"children":4030},{"style":275},[4031],{"type":75,"value":4032}," myOpenai",{"type":69,"tag":146,"props":4034,"children":4035},{"style":165},[4036],{"type":75,"value":282},{"type":69,"tag":146,"props":4038,"children":4039},{"style":159},[4040],{"type":75,"value":314},{"type":69,"tag":146,"props":4042,"children":4043},{"style":196},[4044],{"type":75,"value":319},{"type":69,"tag":146,"props":4046,"children":4047},{"style":159},[4048],{"type":75,"value":314},{"type":69,"tag":146,"props":4050,"children":4051},{"style":165},[4052],{"type":75,"value":432},{"type":69,"tag":146,"props":4054,"children":4055},{"class":148,"line":1379},[4056],{"type":69,"tag":146,"props":4057,"children":4058},{"emptyLinePlaceholder":249},[4059],{"type":75,"value":252},{"type":69,"tag":146,"props":4061,"children":4062},{"class":148,"line":1421},[4063],{"type":69,"tag":146,"props":4064,"children":4065},{"style":948},[4066],{"type":75,"value":4067},"\u002F\u002F Use custom models - accepted by the type system\n",{"type":69,"tag":146,"props":4069,"children":4070},{"class":148,"line":1463},[4071,4075,4080,4084,4088,4092,4096,4100,4104],{"type":69,"tag":146,"props":4072,"children":4073},{"style":259},[4074],{"type":75,"value":262},{"type":69,"tag":146,"props":4076,"children":4077},{"style":165},[4078],{"type":75,"value":4079}," custom ",{"type":69,"tag":146,"props":4081,"children":4082},{"style":159},[4083],{"type":75,"value":272},{"type":69,"tag":146,"props":4085,"children":4086},{"style":275},[4087],{"type":75,"value":4032},{"type":69,"tag":146,"props":4089,"children":4090},{"style":165},[4091],{"type":75,"value":282},{"type":69,"tag":146,"props":4093,"children":4094},{"style":159},[4095],{"type":75,"value":314},{"type":69,"tag":146,"props":4097,"children":4098},{"style":196},[4099],{"type":75,"value":3826},{"type":69,"tag":146,"props":4101,"children":4102},{"style":159},[4103],{"type":75,"value":314},{"type":69,"tag":146,"props":4105,"children":4106},{"style":165},[4107],{"type":75,"value":432},{"type":69,"tag":146,"props":4109,"children":4110},{"class":148,"line":1505},[4111],{"type":69,"tag":146,"props":4112,"children":4113},{"emptyLinePlaceholder":249},[4114],{"type":75,"value":252},{"type":69,"tag":146,"props":4116,"children":4117},{"class":148,"line":1547},[4118],{"type":69,"tag":146,"props":4119,"children":4120},{"style":948},[4121],{"type":75,"value":4122},"\u002F\u002F Type error: 'nonexistent-model' is not a valid model\n",{"type":69,"tag":146,"props":4124,"children":4125},{"class":148,"line":1589},[4126],{"type":69,"tag":146,"props":4127,"children":4128},{"style":948},[4129],{"type":75,"value":4130},"\u002F\u002F myOpenai('nonexistent-model')\n",{"type":69,"tag":82,"props":4132,"children":4133},{},[4134,4136,4142,4144,4150],{"type":75,"value":4135},"At runtime, ",{"type":69,"tag":107,"props":4137,"children":4139},{"className":4138},[],[4140],{"type":75,"value":4141},"extendAdapter",{"type":75,"value":4143}," simply passes through to the original factory.\nThe ",{"type":69,"tag":107,"props":4145,"children":4147},{"className":4146},[],[4148],{"type":75,"value":4149},"_customModels",{"type":75,"value":4151}," parameter is only used for type inference.",{"type":69,"tag":538,"props":4153,"children":4155},{"id":4154},"_5-configuring-sampling",[4156],{"type":75,"value":4157},"5. Configuring Sampling",{"type":69,"tag":82,"props":4159,"children":4160},{},[4161,4163,4168,4170,4175,4177,4182,4184,4189,4190,4196,4197,4203],{"type":75,"value":4162},"Sampling controls (",{"type":69,"tag":107,"props":4164,"children":4166},{"className":4165},[],[4167],{"type":75,"value":481},{"type":75,"value":4169},", token limits, nucleus sampling) are passed\ninside ",{"type":69,"tag":107,"props":4171,"children":4173},{"className":4172},[],[4174],{"type":75,"value":505},{"type":75,"value":4176}," using each provider's ",{"type":69,"tag":86,"props":4178,"children":4179},{},[4180],{"type":75,"value":4181},"native",{"type":75,"value":4183}," key. They are not\ntop-level fields on ",{"type":69,"tag":107,"props":4185,"children":4187},{"className":4186},[],[4188],{"type":75,"value":132},{"type":75,"value":491},{"type":69,"tag":107,"props":4191,"children":4193},{"className":4192},[],[4194],{"type":75,"value":4195},"ai()",{"type":75,"value":491},{"type":69,"tag":107,"props":4198,"children":4200},{"className":4199},[],[4201],{"type":75,"value":4202},"generate()",{"type":75,"value":470},{"type":69,"tag":136,"props":4205,"children":4207},{"className":138,"code":4206,"language":44,"meta":140,"style":140},"\u002F\u002F OpenAI — native keys\nchat({\n  adapter: openaiText('gpt-5.2'),\n  messages,\n  modelOptions: { temperature: 0.7, top_p: 0.9, max_output_tokens: 1000 },\n})\n\n\u002F\u002F Anthropic\nchat({\n  adapter: anthropicText('claude-sonnet-4-6'),\n  messages,\n  modelOptions: { temperature: 0.7, top_p: 0.9, max_tokens: 1000 },\n})\n\n\u002F\u002F Gemini — camelCase\nchat({\n  adapter: geminiText('gemini-2.5-pro'),\n  messages,\n  modelOptions: { temperature: 0.7, topP: 0.9, maxOutputTokens: 1000 },\n})\n\n\u002F\u002F Ollama — NESTED under modelOptions.options\nchat({\n  adapter: ollamaText('llama3.3'),\n  messages,\n  modelOptions: {\n    options: { temperature: 0.7, top_p: 0.9, num_predict: 1000 },\n  },\n})\n",[4208],{"type":69,"tag":107,"props":4209,"children":4210},{"__ignoreMap":140},[4211,4219,4235,4274,4285,4353,4364,4371,4379,4394,4433,4444,4508,4519,4526,4534,4549,4588,4599,4664,4675,4682,4690,4705,4744,4755,4770,4835,4842],{"type":69,"tag":146,"props":4212,"children":4213},{"class":148,"line":149},[4214],{"type":69,"tag":146,"props":4215,"children":4216},{"style":948},[4217],{"type":75,"value":4218},"\u002F\u002F OpenAI — native keys\n",{"type":69,"tag":146,"props":4220,"children":4221},{"class":148,"line":207},[4222,4227,4231],{"type":69,"tag":146,"props":4223,"children":4224},{"style":275},[4225],{"type":75,"value":4226},"chat",{"type":69,"tag":146,"props":4228,"children":4229},{"style":165},[4230],{"type":75,"value":282},{"type":69,"tag":146,"props":4232,"children":4233},{"style":159},[4234],{"type":75,"value":287},{"type":69,"tag":146,"props":4236,"children":4237},{"class":148,"line":245},[4238,4242,4246,4250,4254,4258,4262,4266,4270],{"type":69,"tag":146,"props":4239,"children":4240},{"style":294},[4241],{"type":75,"value":297},{"type":69,"tag":146,"props":4243,"children":4244},{"style":159},[4245],{"type":75,"value":134},{"type":69,"tag":146,"props":4247,"children":4248},{"style":275},[4249],{"type":75,"value":221},{"type":69,"tag":146,"props":4251,"children":4252},{"style":165},[4253],{"type":75,"value":282},{"type":69,"tag":146,"props":4255,"children":4256},{"style":159},[4257],{"type":75,"value":314},{"type":69,"tag":146,"props":4259,"children":4260},{"style":196},[4261],{"type":75,"value":319},{"type":69,"tag":146,"props":4263,"children":4264},{"style":159},[4265],{"type":75,"value":314},{"type":69,"tag":146,"props":4267,"children":4268},{"style":165},[4269],{"type":75,"value":328},{"type":69,"tag":146,"props":4271,"children":4272},{"style":159},[4273],{"type":75,"value":333},{"type":69,"tag":146,"props":4275,"children":4276},{"class":148,"line":255},[4277,4281],{"type":69,"tag":146,"props":4278,"children":4279},{"style":165},[4280],{"type":75,"value":342},{"type":69,"tag":146,"props":4282,"children":4283},{"style":159},[4284],{"type":75,"value":333},{"type":69,"tag":146,"props":4286,"children":4287},{"class":148,"line":290},[4288,4292,4296,4300,4305,4309,4313,4317,4322,4326,4331,4335,4340,4344,4348],{"type":69,"tag":146,"props":4289,"children":4290},{"style":294},[4291],{"type":75,"value":355},{"type":69,"tag":146,"props":4293,"children":4294},{"style":159},[4295],{"type":75,"value":134},{"type":69,"tag":146,"props":4297,"children":4298},{"style":159},[4299],{"type":75,"value":162},{"type":69,"tag":146,"props":4301,"children":4302},{"style":294},[4303],{"type":75,"value":4304}," temperature",{"type":69,"tag":146,"props":4306,"children":4307},{"style":159},[4308],{"type":75,"value":134},{"type":69,"tag":146,"props":4310,"children":4311},{"style":380},[4312],{"type":75,"value":383},{"type":69,"tag":146,"props":4314,"children":4315},{"style":159},[4316],{"type":75,"value":173},{"type":69,"tag":146,"props":4318,"children":4319},{"style":294},[4320],{"type":75,"value":4321}," top_p",{"type":69,"tag":146,"props":4323,"children":4324},{"style":159},[4325],{"type":75,"value":134},{"type":69,"tag":146,"props":4327,"children":4328},{"style":380},[4329],{"type":75,"value":4330}," 0.9",{"type":69,"tag":146,"props":4332,"children":4333},{"style":159},[4334],{"type":75,"value":173},{"type":69,"tag":146,"props":4336,"children":4337},{"style":294},[4338],{"type":75,"value":4339}," max_output_tokens",{"type":69,"tag":146,"props":4341,"children":4342},{"style":159},[4343],{"type":75,"value":134},{"type":69,"tag":146,"props":4345,"children":4346},{"style":380},[4347],{"type":75,"value":405},{"type":69,"tag":146,"props":4349,"children":4350},{"style":159},[4351],{"type":75,"value":4352}," },\n",{"type":69,"tag":146,"props":4354,"children":4355},{"class":148,"line":336},[4356,4360],{"type":69,"tag":146,"props":4357,"children":4358},{"style":159},[4359],{"type":75,"value":427},{"type":69,"tag":146,"props":4361,"children":4362},{"style":165},[4363],{"type":75,"value":432},{"type":69,"tag":146,"props":4365,"children":4366},{"class":148,"line":349},[4367],{"type":69,"tag":146,"props":4368,"children":4369},{"emptyLinePlaceholder":249},[4370],{"type":75,"value":252},{"type":69,"tag":146,"props":4372,"children":4373},{"class":148,"line":367},[4374],{"type":69,"tag":146,"props":4375,"children":4376},{"style":948},[4377],{"type":75,"value":4378},"\u002F\u002F Anthropic\n",{"type":69,"tag":146,"props":4380,"children":4381},{"class":148,"line":390},[4382,4386,4390],{"type":69,"tag":146,"props":4383,"children":4384},{"style":275},[4385],{"type":75,"value":4226},{"type":69,"tag":146,"props":4387,"children":4388},{"style":165},[4389],{"type":75,"value":282},{"type":69,"tag":146,"props":4391,"children":4392},{"style":159},[4393],{"type":75,"value":287},{"type":69,"tag":146,"props":4395,"children":4396},{"class":148,"line":412},[4397,4401,4405,4409,4413,4417,4421,4425,4429],{"type":69,"tag":146,"props":4398,"children":4399},{"style":294},[4400],{"type":75,"value":297},{"type":69,"tag":146,"props":4402,"children":4403},{"style":159},[4404],{"type":75,"value":134},{"type":69,"tag":146,"props":4406,"children":4407},{"style":275},[4408],{"type":75,"value":1002},{"type":69,"tag":146,"props":4410,"children":4411},{"style":165},[4412],{"type":75,"value":282},{"type":69,"tag":146,"props":4414,"children":4415},{"style":159},[4416],{"type":75,"value":314},{"type":69,"tag":146,"props":4418,"children":4419},{"style":196},[4420],{"type":75,"value":1326},{"type":69,"tag":146,"props":4422,"children":4423},{"style":159},[4424],{"type":75,"value":314},{"type":69,"tag":146,"props":4426,"children":4427},{"style":165},[4428],{"type":75,"value":328},{"type":69,"tag":146,"props":4430,"children":4431},{"style":159},[4432],{"type":75,"value":333},{"type":69,"tag":146,"props":4434,"children":4435},{"class":148,"line":421},[4436,4440],{"type":69,"tag":146,"props":4437,"children":4438},{"style":165},[4439],{"type":75,"value":342},{"type":69,"tag":146,"props":4441,"children":4442},{"style":159},[4443],{"type":75,"value":333},{"type":69,"tag":146,"props":4445,"children":4446},{"class":148,"line":435},[4447,4451,4455,4459,4463,4467,4471,4475,4479,4483,4487,4491,4496,4500,4504],{"type":69,"tag":146,"props":4448,"children":4449},{"style":294},[4450],{"type":75,"value":355},{"type":69,"tag":146,"props":4452,"children":4453},{"style":159},[4454],{"type":75,"value":134},{"type":69,"tag":146,"props":4456,"children":4457},{"style":159},[4458],{"type":75,"value":162},{"type":69,"tag":146,"props":4460,"children":4461},{"style":294},[4462],{"type":75,"value":4304},{"type":69,"tag":146,"props":4464,"children":4465},{"style":159},[4466],{"type":75,"value":134},{"type":69,"tag":146,"props":4468,"children":4469},{"style":380},[4470],{"type":75,"value":383},{"type":69,"tag":146,"props":4472,"children":4473},{"style":159},[4474],{"type":75,"value":173},{"type":69,"tag":146,"props":4476,"children":4477},{"style":294},[4478],{"type":75,"value":4321},{"type":69,"tag":146,"props":4480,"children":4481},{"style":159},[4482],{"type":75,"value":134},{"type":69,"tag":146,"props":4484,"children":4485},{"style":380},[4486],{"type":75,"value":4330},{"type":69,"tag":146,"props":4488,"children":4489},{"style":159},[4490],{"type":75,"value":173},{"type":69,"tag":146,"props":4492,"children":4493},{"style":294},[4494],{"type":75,"value":4495}," max_tokens",{"type":69,"tag":146,"props":4497,"children":4498},{"style":159},[4499],{"type":75,"value":134},{"type":69,"tag":146,"props":4501,"children":4502},{"style":380},[4503],{"type":75,"value":405},{"type":69,"tag":146,"props":4505,"children":4506},{"style":159},[4507],{"type":75,"value":4352},{"type":69,"tag":146,"props":4509,"children":4510},{"class":148,"line":443},[4511,4515],{"type":69,"tag":146,"props":4512,"children":4513},{"style":159},[4514],{"type":75,"value":427},{"type":69,"tag":146,"props":4516,"children":4517},{"style":165},[4518],{"type":75,"value":432},{"type":69,"tag":146,"props":4520,"children":4521},{"class":148,"line":1337},[4522],{"type":69,"tag":146,"props":4523,"children":4524},{"emptyLinePlaceholder":249},[4525],{"type":75,"value":252},{"type":69,"tag":146,"props":4527,"children":4528},{"class":148,"line":1379},[4529],{"type":69,"tag":146,"props":4530,"children":4531},{"style":948},[4532],{"type":75,"value":4533},"\u002F\u002F Gemini — camelCase\n",{"type":69,"tag":146,"props":4535,"children":4536},{"class":148,"line":1421},[4537,4541,4545],{"type":69,"tag":146,"props":4538,"children":4539},{"style":275},[4540],{"type":75,"value":4226},{"type":69,"tag":146,"props":4542,"children":4543},{"style":165},[4544],{"type":75,"value":282},{"type":69,"tag":146,"props":4546,"children":4547},{"style":159},[4548],{"type":75,"value":287},{"type":69,"tag":146,"props":4550,"children":4551},{"class":148,"line":1463},[4552,4556,4560,4564,4568,4572,4576,4580,4584],{"type":69,"tag":146,"props":4553,"children":4554},{"style":294},[4555],{"type":75,"value":297},{"type":69,"tag":146,"props":4557,"children":4558},{"style":159},[4559],{"type":75,"value":134},{"type":69,"tag":146,"props":4561,"children":4562},{"style":275},[4563],{"type":75,"value":1038},{"type":69,"tag":146,"props":4565,"children":4566},{"style":165},[4567],{"type":75,"value":282},{"type":69,"tag":146,"props":4569,"children":4570},{"style":159},[4571],{"type":75,"value":314},{"type":69,"tag":146,"props":4573,"children":4574},{"style":196},[4575],{"type":75,"value":1368},{"type":69,"tag":146,"props":4577,"children":4578},{"style":159},[4579],{"type":75,"value":314},{"type":69,"tag":146,"props":4581,"children":4582},{"style":165},[4583],{"type":75,"value":328},{"type":69,"tag":146,"props":4585,"children":4586},{"style":159},[4587],{"type":75,"value":333},{"type":69,"tag":146,"props":4589,"children":4590},{"class":148,"line":1505},[4591,4595],{"type":69,"tag":146,"props":4592,"children":4593},{"style":165},[4594],{"type":75,"value":342},{"type":69,"tag":146,"props":4596,"children":4597},{"style":159},[4598],{"type":75,"value":333},{"type":69,"tag":146,"props":4600,"children":4601},{"class":148,"line":1547},[4602,4606,4610,4614,4618,4622,4626,4630,4635,4639,4643,4647,4652,4656,4660],{"type":69,"tag":146,"props":4603,"children":4604},{"style":294},[4605],{"type":75,"value":355},{"type":69,"tag":146,"props":4607,"children":4608},{"style":159},[4609],{"type":75,"value":134},{"type":69,"tag":146,"props":4611,"children":4612},{"style":159},[4613],{"type":75,"value":162},{"type":69,"tag":146,"props":4615,"children":4616},{"style":294},[4617],{"type":75,"value":4304},{"type":69,"tag":146,"props":4619,"children":4620},{"style":159},[4621],{"type":75,"value":134},{"type":69,"tag":146,"props":4623,"children":4624},{"style":380},[4625],{"type":75,"value":383},{"type":69,"tag":146,"props":4627,"children":4628},{"style":159},[4629],{"type":75,"value":173},{"type":69,"tag":146,"props":4631,"children":4632},{"style":294},[4633],{"type":75,"value":4634}," topP",{"type":69,"tag":146,"props":4636,"children":4637},{"style":159},[4638],{"type":75,"value":134},{"type":69,"tag":146,"props":4640,"children":4641},{"style":380},[4642],{"type":75,"value":4330},{"type":69,"tag":146,"props":4644,"children":4645},{"style":159},[4646],{"type":75,"value":173},{"type":69,"tag":146,"props":4648,"children":4649},{"style":294},[4650],{"type":75,"value":4651}," maxOutputTokens",{"type":69,"tag":146,"props":4653,"children":4654},{"style":159},[4655],{"type":75,"value":134},{"type":69,"tag":146,"props":4657,"children":4658},{"style":380},[4659],{"type":75,"value":405},{"type":69,"tag":146,"props":4661,"children":4662},{"style":159},[4663],{"type":75,"value":4352},{"type":69,"tag":146,"props":4665,"children":4666},{"class":148,"line":1589},[4667,4671],{"type":69,"tag":146,"props":4668,"children":4669},{"style":159},[4670],{"type":75,"value":427},{"type":69,"tag":146,"props":4672,"children":4673},{"style":165},[4674],{"type":75,"value":432},{"type":69,"tag":146,"props":4676,"children":4677},{"class":148,"line":1597},[4678],{"type":69,"tag":146,"props":4679,"children":4680},{"emptyLinePlaceholder":249},[4681],{"type":75,"value":252},{"type":69,"tag":146,"props":4683,"children":4684},{"class":148,"line":1606},[4685],{"type":69,"tag":146,"props":4686,"children":4687},{"style":948},[4688],{"type":75,"value":4689},"\u002F\u002F Ollama — NESTED under modelOptions.options\n",{"type":69,"tag":146,"props":4691,"children":4692},{"class":148,"line":1651},[4693,4697,4701],{"type":69,"tag":146,"props":4694,"children":4695},{"style":275},[4696],{"type":75,"value":4226},{"type":69,"tag":146,"props":4698,"children":4699},{"style":165},[4700],{"type":75,"value":282},{"type":69,"tag":146,"props":4702,"children":4703},{"style":159},[4704],{"type":75,"value":287},{"type":69,"tag":146,"props":4706,"children":4707},{"class":148,"line":1681},[4708,4712,4716,4720,4724,4728,4732,4736,4740],{"type":69,"tag":146,"props":4709,"children":4710},{"style":294},[4711],{"type":75,"value":297},{"type":69,"tag":146,"props":4713,"children":4714},{"style":159},[4715],{"type":75,"value":134},{"type":69,"tag":146,"props":4717,"children":4718},{"style":275},[4719],{"type":75,"value":1182},{"type":69,"tag":146,"props":4721,"children":4722},{"style":165},[4723],{"type":75,"value":282},{"type":69,"tag":146,"props":4725,"children":4726},{"style":159},[4727],{"type":75,"value":314},{"type":69,"tag":146,"props":4729,"children":4730},{"style":196},[4731],{"type":75,"value":1536},{"type":69,"tag":146,"props":4733,"children":4734},{"style":159},[4735],{"type":75,"value":314},{"type":69,"tag":146,"props":4737,"children":4738},{"style":165},[4739],{"type":75,"value":328},{"type":69,"tag":146,"props":4741,"children":4742},{"style":159},[4743],{"type":75,"value":333},{"type":69,"tag":146,"props":4745,"children":4746},{"class":148,"line":2580},[4747,4751],{"type":69,"tag":146,"props":4748,"children":4749},{"style":165},[4750],{"type":75,"value":342},{"type":69,"tag":146,"props":4752,"children":4753},{"style":159},[4754],{"type":75,"value":333},{"type":69,"tag":146,"props":4756,"children":4757},{"class":148,"line":2606},[4758,4762,4766],{"type":69,"tag":146,"props":4759,"children":4760},{"style":294},[4761],{"type":75,"value":355},{"type":69,"tag":146,"props":4763,"children":4764},{"style":159},[4765],{"type":75,"value":134},{"type":69,"tag":146,"props":4767,"children":4768},{"style":159},[4769],{"type":75,"value":364},{"type":69,"tag":146,"props":4771,"children":4772},{"class":148,"line":3186},[4773,4778,4782,4786,4790,4794,4798,4802,4806,4810,4814,4818,4823,4827,4831],{"type":69,"tag":146,"props":4774,"children":4775},{"style":294},[4776],{"type":75,"value":4777},"    options",{"type":69,"tag":146,"props":4779,"children":4780},{"style":159},[4781],{"type":75,"value":134},{"type":69,"tag":146,"props":4783,"children":4784},{"style":159},[4785],{"type":75,"value":162},{"type":69,"tag":146,"props":4787,"children":4788},{"style":294},[4789],{"type":75,"value":4304},{"type":69,"tag":146,"props":4791,"children":4792},{"style":159},[4793],{"type":75,"value":134},{"type":69,"tag":146,"props":4795,"children":4796},{"style":380},[4797],{"type":75,"value":383},{"type":69,"tag":146,"props":4799,"children":4800},{"style":159},[4801],{"type":75,"value":173},{"type":69,"tag":146,"props":4803,"children":4804},{"style":294},[4805],{"type":75,"value":4321},{"type":69,"tag":146,"props":4807,"children":4808},{"style":159},[4809],{"type":75,"value":134},{"type":69,"tag":146,"props":4811,"children":4812},{"style":380},[4813],{"type":75,"value":4330},{"type":69,"tag":146,"props":4815,"children":4816},{"style":159},[4817],{"type":75,"value":173},{"type":69,"tag":146,"props":4819,"children":4820},{"style":294},[4821],{"type":75,"value":4822}," num_predict",{"type":69,"tag":146,"props":4824,"children":4825},{"style":159},[4826],{"type":75,"value":134},{"type":69,"tag":146,"props":4828,"children":4829},{"style":380},[4830],{"type":75,"value":405},{"type":69,"tag":146,"props":4832,"children":4833},{"style":159},[4834],{"type":75,"value":4352},{"type":69,"tag":146,"props":4836,"children":4837},{"class":148,"line":3194},[4838],{"type":69,"tag":146,"props":4839,"children":4840},{"style":159},[4841],{"type":75,"value":418},{"type":69,"tag":146,"props":4843,"children":4844},{"class":148,"line":3202},[4845,4849],{"type":69,"tag":146,"props":4846,"children":4847},{"style":159},[4848],{"type":75,"value":427},{"type":69,"tag":146,"props":4850,"children":4851},{"style":165},[4852],{"type":75,"value":432},{"type":69,"tag":82,"props":4854,"children":4855},{},[4856,4858,4863],{"type":75,"value":4857},"Per-provider sampling keys (all live inside ",{"type":69,"tag":107,"props":4859,"children":4861},{"className":4860},[],[4862],{"type":75,"value":505},{"type":75,"value":4864},"):",{"type":69,"tag":550,"props":4866,"children":4867},{},[4868,4893],{"type":69,"tag":554,"props":4869,"children":4870},{},[4871],{"type":69,"tag":558,"props":4872,"children":4873},{},[4874,4878,4883,4888],{"type":69,"tag":562,"props":4875,"children":4876},{},[4877],{"type":75,"value":566},{"type":69,"tag":562,"props":4879,"children":4880},{},[4881],{"type":75,"value":4882},"Temperature",{"type":69,"tag":562,"props":4884,"children":4885},{},[4886],{"type":75,"value":4887},"Nucleus",{"type":69,"tag":562,"props":4889,"children":4890},{},[4891],{"type":75,"value":4892},"Max output tokens",{"type":69,"tag":583,"props":4894,"children":4895},{},[4896,4928,4960,4992,5023,5055,5088],{"type":69,"tag":558,"props":4897,"children":4898},{},[4899,4903,4911,4919],{"type":69,"tag":590,"props":4900,"children":4901},{},[4902],{"type":75,"value":594},{"type":69,"tag":590,"props":4904,"children":4905},{},[4906],{"type":69,"tag":107,"props":4907,"children":4909},{"className":4908},[],[4910],{"type":75,"value":481},{"type":69,"tag":590,"props":4912,"children":4913},{},[4914],{"type":69,"tag":107,"props":4915,"children":4917},{"className":4916},[],[4918],{"type":75,"value":489},{"type":69,"tag":590,"props":4920,"children":4921},{},[4922],{"type":69,"tag":107,"props":4923,"children":4925},{"className":4924},[],[4926],{"type":75,"value":4927},"max_output_tokens",{"type":69,"tag":558,"props":4929,"children":4930},{},[4931,4935,4943,4951],{"type":69,"tag":590,"props":4932,"children":4933},{},[4934],{"type":75,"value":628},{"type":69,"tag":590,"props":4936,"children":4937},{},[4938],{"type":69,"tag":107,"props":4939,"children":4941},{"className":4940},[],[4942],{"type":75,"value":481},{"type":69,"tag":590,"props":4944,"children":4945},{},[4946],{"type":69,"tag":107,"props":4947,"children":4949},{"className":4948},[],[4950],{"type":75,"value":489},{"type":69,"tag":590,"props":4952,"children":4953},{},[4954],{"type":69,"tag":107,"props":4955,"children":4957},{"className":4956},[],[4958],{"type":75,"value":4959},"max_tokens",{"type":69,"tag":558,"props":4961,"children":4962},{},[4963,4967,4975,4983],{"type":69,"tag":590,"props":4964,"children":4965},{},[4966],{"type":75,"value":663},{"type":69,"tag":590,"props":4968,"children":4969},{},[4970],{"type":69,"tag":107,"props":4971,"children":4973},{"className":4972},[],[4974],{"type":75,"value":481},{"type":69,"tag":590,"props":4976,"children":4977},{},[4978],{"type":69,"tag":107,"props":4979,"children":4981},{"className":4980},[],[4982],{"type":75,"value":497},{"type":69,"tag":590,"props":4984,"children":4985},{},[4986],{"type":69,"tag":107,"props":4987,"children":4989},{"className":4988},[],[4990],{"type":75,"value":4991},"maxOutputTokens",{"type":69,"tag":558,"props":4993,"children":4994},{},[4995,4999,5007,5015],{"type":69,"tag":590,"props":4996,"children":4997},{},[4998],{"type":75,"value":706},{"type":69,"tag":590,"props":5000,"children":5001},{},[5002],{"type":69,"tag":107,"props":5003,"children":5005},{"className":5004},[],[5006],{"type":75,"value":481},{"type":69,"tag":590,"props":5008,"children":5009},{},[5010],{"type":69,"tag":107,"props":5011,"children":5013},{"className":5012},[],[5014],{"type":75,"value":489},{"type":69,"tag":590,"props":5016,"children":5017},{},[5018],{"type":69,"tag":107,"props":5019,"children":5021},{"className":5020},[],[5022],{"type":75,"value":4959},{"type":69,"tag":558,"props":5024,"children":5025},{},[5026,5030,5038,5046],{"type":69,"tag":590,"props":5027,"children":5028},{},[5029],{"type":75,"value":741},{"type":69,"tag":590,"props":5031,"children":5032},{},[5033],{"type":69,"tag":107,"props":5034,"children":5036},{"className":5035},[],[5037],{"type":75,"value":481},{"type":69,"tag":590,"props":5039,"children":5040},{},[5041],{"type":69,"tag":107,"props":5042,"children":5044},{"className":5043},[],[5045],{"type":75,"value":489},{"type":69,"tag":590,"props":5047,"children":5048},{},[5049],{"type":69,"tag":107,"props":5050,"children":5052},{"className":5051},[],[5053],{"type":75,"value":5054},"max_completion_tokens",{"type":69,"tag":558,"props":5056,"children":5057},{},[5058,5063,5071,5079],{"type":69,"tag":590,"props":5059,"children":5060},{},[5061],{"type":75,"value":5062},"OpenRouter (chat)",{"type":69,"tag":590,"props":5064,"children":5065},{},[5066],{"type":69,"tag":107,"props":5067,"children":5069},{"className":5068},[],[5070],{"type":75,"value":481},{"type":69,"tag":590,"props":5072,"children":5073},{},[5074],{"type":69,"tag":107,"props":5075,"children":5077},{"className":5076},[],[5078],{"type":75,"value":497},{"type":69,"tag":590,"props":5080,"children":5081},{},[5082],{"type":69,"tag":107,"props":5083,"children":5085},{"className":5084},[],[5086],{"type":75,"value":5087},"maxCompletionTokens",{"type":69,"tag":558,"props":5089,"children":5090},{},[5091,5095,5103,5111],{"type":69,"tag":590,"props":5092,"children":5093},{},[5094],{"type":75,"value":811},{"type":69,"tag":590,"props":5096,"children":5097},{},[5098],{"type":69,"tag":107,"props":5099,"children":5101},{"className":5100},[],[5102],{"type":75,"value":481},{"type":69,"tag":590,"props":5104,"children":5105},{},[5106],{"type":69,"tag":107,"props":5107,"children":5109},{"className":5108},[],[5110],{"type":75,"value":489},{"type":69,"tag":590,"props":5112,"children":5113},{},[5114,5120,5122,5128],{"type":69,"tag":107,"props":5115,"children":5117},{"className":5116},[],[5118],{"type":75,"value":5119},"num_predict",{"type":75,"value":5121}," (nested in ",{"type":69,"tag":107,"props":5123,"children":5125},{"className":5124},[],[5126],{"type":75,"value":5127},"options",{"type":75,"value":328},{"type":69,"tag":82,"props":5130,"children":5131},{},[5132,5137,5139,5145],{"type":69,"tag":107,"props":5133,"children":5135},{"className":5134},[],[5136],{"type":75,"value":481},{"type":75,"value":5138}," is the one key every provider names identically; token limits and\nsome sampling options use provider-native names. Ollama nests all sampling under\n",{"type":69,"tag":107,"props":5140,"children":5142},{"className":5141},[],[5143],{"type":75,"value":5144},"modelOptions.options",{"type":75,"value":470},{"type":69,"tag":78,"props":5147,"children":5148},{},[5149],{"type":69,"tag":82,"props":5150,"children":5151},{},[5152,5164,5166,5172,5174,5179,5181,5187,5189,5194,5196,5201,5203,5209],{"type":69,"tag":86,"props":5153,"children":5154},{},[5155,5157,5162],{"type":75,"value":5156},"Anthropic ",{"type":69,"tag":107,"props":5158,"children":5160},{"className":5159},[],[5161],{"type":75,"value":4959},{"type":75,"value":5163}," default:",{"type":75,"value":5165}," Anthropic's API ",{"type":69,"tag":5167,"props":5168,"children":5169},"em",{},[5170],{"type":75,"value":5171},"requires",{"type":75,"value":5173}," ",{"type":69,"tag":107,"props":5175,"children":5177},{"className":5176},[],[5178],{"type":75,"value":4959},{"type":75,"value":5180},",\nso the adapter always sends one. When you omit ",{"type":69,"tag":107,"props":5182,"children":5184},{"className":5183},[],[5185],{"type":75,"value":5186},"modelOptions.max_tokens",{"type":75,"value":5188},", it\ndefaults to the selected model's full output ceiling (its ",{"type":69,"tag":107,"props":5190,"children":5192},{"className":5191},[],[5193],{"type":75,"value":4927},{"type":75,"value":5195},"\nfrom model metadata — e.g. 64K for Sonnet, 128K for Opus), not a low constant.\n",{"type":69,"tag":107,"props":5197,"children":5199},{"className":5198},[],[5200],{"type":75,"value":4959},{"type":75,"value":5202}," is a ceiling, not a reservation (billing is per token generated),\nso leaving it unset is the right default for codegen \u002F agentic \u002F long-form\noutput and avoids silent ",{"type":69,"tag":107,"props":5204,"children":5206},{"className":5205},[],[5207],{"type":75,"value":5208},"stop_reason: \"max_tokens\"",{"type":75,"value":5210}," truncation. Set it only to\ncap output below the model ceiling. Other providers treat token limits as\noptional and don't apply this flooring.",{"type":69,"tag":538,"props":5212,"children":5214},{"id":5213},"_6-capability-flag-supportscombinedtoolsandschema",[5215,5217],{"type":75,"value":5216},"6. Capability Flag: ",{"type":69,"tag":107,"props":5218,"children":5220},{"className":5219},[],[5221],{"type":75,"value":5222},"supportsCombinedToolsAndSchema",{"type":69,"tag":82,"props":5224,"children":5225},{},[5226],{"type":75,"value":5227},"Adapters can declare an optional capability method:",{"type":69,"tag":136,"props":5229,"children":5233},{"className":5230,"code":5231,"language":5232,"meta":140,"style":140},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","supportsCombinedToolsAndSchema?(modelOptions?: TProviderOptions): boolean\n","ts",[5234],{"type":69,"tag":107,"props":5235,"children":5236},{"__ignoreMap":140},[5237],{"type":69,"tag":146,"props":5238,"children":5239},{"class":148,"line":149},[5240,5244,5249,5254,5259,5264,5268],{"type":69,"tag":146,"props":5241,"children":5242},{"style":165},[5243],{"type":75,"value":5222},{"type":69,"tag":146,"props":5245,"children":5246},{"style":159},[5247],{"type":75,"value":5248},"?",{"type":69,"tag":146,"props":5250,"children":5251},{"style":165},[5252],{"type":75,"value":5253},"(modelOptions",{"type":69,"tag":146,"props":5255,"children":5256},{"style":159},[5257],{"type":75,"value":5258},"?:",{"type":69,"tag":146,"props":5260,"children":5261},{"style":165},[5262],{"type":75,"value":5263}," TProviderOptions)",{"type":69,"tag":146,"props":5265,"children":5266},{"style":159},[5267],{"type":75,"value":134},{"type":69,"tag":146,"props":5269,"children":5270},{"style":165},[5271],{"type":75,"value":5272}," boolean\n",{"type":69,"tag":82,"props":5274,"children":5275},{},[5276,5278,5284,5286,5292,5294,5300,5302,5308,5310,5316,5317,5323,5325,5331],{"type":75,"value":5277},"When ",{"type":69,"tag":107,"props":5279,"children":5281},{"className":5280},[],[5282],{"type":75,"value":5283},"true",{"type":75,"value":5285},", the engine wires ",{"type":69,"tag":107,"props":5287,"children":5289},{"className":5288},[],[5290],{"type":75,"value":5291},"outputSchema",{"type":75,"value":5293}," into the regular\n",{"type":69,"tag":107,"props":5295,"children":5297},{"className":5296},[],[5298],{"type":75,"value":5299},"chatStream",{"type":75,"value":5301}," call alongside ",{"type":69,"tag":107,"props":5303,"children":5305},{"className":5304},[],[5306],{"type":75,"value":5307},"tools",{"type":75,"value":5309}," and harvests the schema-constrained\nJSON from the agent loop's final-turn text — skipping the separate\n",{"type":69,"tag":107,"props":5311,"children":5313},{"className":5312},[],[5314],{"type":75,"value":5315},"structuredOutput",{"type":75,"value":917},{"type":69,"tag":107,"props":5318,"children":5320},{"className":5319},[],[5321],{"type":75,"value":5322},"structuredOutputStream",{"type":75,"value":5324}," finalization round-trip.\nWhen ",{"type":69,"tag":107,"props":5326,"children":5328},{"className":5327},[],[5329],{"type":75,"value":5330},"false",{"type":75,"value":5332}," (or the method is omitted), the legacy finalization path\nruns.",{"type":69,"tag":82,"props":5334,"children":5335},{},[5336],{"type":75,"value":5337},"Current per-adapter status (#605):",{"type":69,"tag":550,"props":5339,"children":5340},{},[5341,5357],{"type":69,"tag":554,"props":5342,"children":5343},{},[5344],{"type":69,"tag":558,"props":5345,"children":5346},{},[5347,5352],{"type":69,"tag":562,"props":5348,"children":5349},{},[5350],{"type":75,"value":5351},"Adapter",{"type":69,"tag":562,"props":5353,"children":5354},{},[5355],{"type":75,"value":5356},"Returns",{"type":69,"tag":583,"props":5358,"children":5359},{},[5360,5388,5424,5458,5492,5513,5541],{"type":69,"tag":558,"props":5361,"children":5362},{},[5363,5378],{"type":69,"tag":590,"props":5364,"children":5365},{},[5366,5371,5372],{"type":69,"tag":107,"props":5367,"children":5369},{"className":5368},[],[5370],{"type":75,"value":611},{"type":75,"value":917},{"type":69,"tag":107,"props":5373,"children":5375},{"className":5374},[],[5376],{"type":75,"value":5377},"openaiChatCompletions",{"type":69,"tag":590,"props":5379,"children":5380},{},[5381,5386],{"type":69,"tag":107,"props":5382,"children":5384},{"className":5383},[],[5385],{"type":75,"value":5283},{"type":75,"value":5387}," (all supported models)",{"type":69,"tag":558,"props":5389,"children":5390},{},[5391,5399],{"type":69,"tag":590,"props":5392,"children":5393},{},[5394],{"type":69,"tag":107,"props":5395,"children":5397},{"className":5396},[],[5398],{"type":75,"value":646},{"type":69,"tag":590,"props":5400,"children":5401},{},[5402,5407,5409,5415,5417,5422],{"type":69,"tag":107,"props":5403,"children":5405},{"className":5404},[],[5406],{"type":75,"value":5283},{"type":75,"value":5408}," for Claude 4.5+ (gated by ",{"type":69,"tag":107,"props":5410,"children":5412},{"className":5411},[],[5413],{"type":75,"value":5414},"ANTHROPIC_COMBINED_TOOLS_AND_SCHEMA_MODELS",{"type":75,"value":5416},"), ",{"type":69,"tag":107,"props":5418,"children":5420},{"className":5419},[],[5421],{"type":75,"value":5330},{"type":75,"value":5423}," otherwise",{"type":69,"tag":558,"props":5425,"children":5426},{},[5427,5435],{"type":69,"tag":590,"props":5428,"children":5429},{},[5430],{"type":69,"tag":107,"props":5431,"children":5433},{"className":5432},[],[5434],{"type":75,"value":681},{"type":69,"tag":590,"props":5436,"children":5437},{},[5438,5443,5445,5451,5452,5457],{"type":69,"tag":107,"props":5439,"children":5441},{"className":5440},[],[5442],{"type":75,"value":5283},{"type":75,"value":5444}," for Gemini 3.x (gated by ",{"type":69,"tag":107,"props":5446,"children":5448},{"className":5447},[],[5449],{"type":75,"value":5450},"GEMINI_COMBINED_TOOLS_AND_SCHEMA_MODELS",{"type":75,"value":5416},{"type":69,"tag":107,"props":5453,"children":5455},{"className":5454},[],[5456],{"type":75,"value":5330},{"type":75,"value":5423},{"type":69,"tag":558,"props":5459,"children":5460},{},[5461,5469],{"type":69,"tag":590,"props":5462,"children":5463},{},[5464],{"type":69,"tag":107,"props":5465,"children":5467},{"className":5466},[],[5468],{"type":75,"value":724},{"type":69,"tag":590,"props":5470,"children":5471},{},[5472,5477,5479,5485,5486,5491],{"type":69,"tag":107,"props":5473,"children":5475},{"className":5474},[],[5476],{"type":75,"value":5283},{"type":75,"value":5478}," for Grok 4 family (gated by ",{"type":69,"tag":107,"props":5480,"children":5482},{"className":5481},[],[5483],{"type":75,"value":5484},"GROK_COMBINED_TOOLS_AND_SCHEMA_MODELS",{"type":75,"value":5416},{"type":69,"tag":107,"props":5487,"children":5489},{"className":5488},[],[5490],{"type":75,"value":5330},{"type":75,"value":5423},{"type":69,"tag":558,"props":5493,"children":5494},{},[5495,5503],{"type":69,"tag":590,"props":5496,"children":5497},{},[5498],{"type":69,"tag":107,"props":5499,"children":5501},{"className":5500},[],[5502],{"type":75,"value":759},{"type":69,"tag":590,"props":5504,"children":5505},{},[5506,5511],{"type":69,"tag":107,"props":5507,"children":5509},{"className":5508},[],[5510],{"type":75,"value":5330},{"type":75,"value":5512}," (Groq API rejects schema + tools + stream)",{"type":69,"tag":558,"props":5514,"children":5515},{},[5516,5531],{"type":69,"tag":590,"props":5517,"children":5518},{},[5519,5524,5525],{"type":69,"tag":107,"props":5520,"children":5522},{"className":5521},[],[5523],{"type":75,"value":794},{"type":75,"value":917},{"type":69,"tag":107,"props":5526,"children":5528},{"className":5527},[],[5529],{"type":75,"value":5530},"openRouterResponsesText",{"type":69,"tag":590,"props":5532,"children":5533},{},[5534,5539],{"type":69,"tag":107,"props":5535,"children":5537},{"className":5536},[],[5538],{"type":75,"value":5330},{"type":75,"value":5540}," (per-call resolution is a follow-up)",{"type":69,"tag":558,"props":5542,"children":5543},{},[5544,5552],{"type":69,"tag":590,"props":5545,"children":5546},{},[5547],{"type":69,"tag":107,"props":5548,"children":5550},{"className":5549},[],[5551],{"type":75,"value":829},{"type":69,"tag":590,"props":5553,"children":5554},{},[5555,5560],{"type":69,"tag":107,"props":5556,"children":5558},{"className":5557},[],[5559],{"type":75,"value":5330},{"type":75,"value":5561}," (constrained-decoding vs tool-call grammar conflict)",{"type":69,"tag":82,"props":5563,"children":5564},{},[5565,5567,5572],{"type":75,"value":5566},"Subclasses can override to narrow the capability. When extending an\nadapter for a custom model that doesn't support the combination, return\n",{"type":69,"tag":107,"props":5568,"children":5570},{"className":5569},[],[5571],{"type":75,"value":5330},{"type":75,"value":5573}," explicitly.",{"type":69,"tag":538,"props":5575,"children":5577},{"id":5576},"_6-openai-compatible-providers",[5578],{"type":75,"value":5579},"6. OpenAI-Compatible Providers",{"type":69,"tag":82,"props":5581,"children":5582},{},[5583,5585,5590,5592,5597,5599,5604],{"type":75,"value":5584},"Any provider that implements the OpenAI ",{"type":69,"tag":86,"props":5586,"children":5587},{},[5588],{"type":75,"value":5589},"Chat Completions",{"type":75,"value":5591}," API (DeepSeek,\nMoonshot\u002FKimi, Together, Fireworks, Cerebras, Qwen\u002FDashScope, Perplexity,\nNVIDIA NIM, LM Studio, etc.) can be used through the generic\n",{"type":69,"tag":107,"props":5593,"children":5595},{"className":5594},[],[5596],{"type":75,"value":915},{"type":75,"value":5598}," factory from ",{"type":69,"tag":107,"props":5600,"children":5602},{"className":5601},[],[5603],{"type":75,"value":906},{"type":75,"value":5605}," — no\ndedicated package required.",{"type":69,"tag":136,"props":5607,"children":5609},{"className":138,"code":5608,"language":44,"meta":140,"style":140},"import { openaiCompatible } from '@tanstack\u002Fai-openai\u002Fcompatible'\nimport { createModel } from '@tanstack\u002Fai'\n\n\u002F\u002F Provider-factory: configure baseURL + apiKey + models ONCE,\n\u002F\u002F then select a model per call (the model arg is a type-safe union).\nconst deepseek = openaiCompatible({\n  name: 'deepseek', \u002F\u002F optional label for devtools\u002Ferrors (default 'openai-compatible')\n  baseURL: 'https:\u002F\u002Fapi.deepseek.com\u002Fv1',\n  apiKey: process.env.DEEPSEEK_API_KEY!,\n  models: [\n    'deepseek-chat', \u002F\u002F bare string → optimistic defaults: text\u002Fimage in, streaming, tools, structured output\n    createModel('deepseek-reasoner', {\n      \u002F\u002F rich def → precise per-model capabilities\n      input: ['text'],\n      features: ['reasoning', 'structured_outputs'],\n    }),\n  ],\n})\n\nchat({ adapter: deepseek('deepseek-chat'), messages })\nchat({ adapter: deepseek('deepseek-reasoner'), messages })\n",[5610],{"type":69,"tag":107,"props":5611,"children":5612},{"__ignoreMap":140},[5613,5649,5684,5691,5699,5707,5735,5769,5798,5837,5853,5879,5912,5920,5957,6011,6027,6039,6050,6057,6124],{"type":69,"tag":146,"props":5614,"children":5615},{"class":148,"line":149},[5616,5620,5624,5629,5633,5637,5641,5645],{"type":69,"tag":146,"props":5617,"children":5618},{"style":153},[5619],{"type":75,"value":156},{"type":69,"tag":146,"props":5621,"children":5622},{"style":159},[5623],{"type":75,"value":162},{"type":69,"tag":146,"props":5625,"children":5626},{"style":165},[5627],{"type":75,"value":5628}," openaiCompatible",{"type":69,"tag":146,"props":5630,"children":5631},{"style":159},[5632],{"type":75,"value":183},{"type":69,"tag":146,"props":5634,"children":5635},{"style":153},[5636],{"type":75,"value":188},{"type":69,"tag":146,"props":5638,"children":5639},{"style":159},[5640],{"type":75,"value":193},{"type":69,"tag":146,"props":5642,"children":5643},{"style":196},[5644],{"type":75,"value":906},{"type":69,"tag":146,"props":5646,"children":5647},{"style":159},[5648],{"type":75,"value":204},{"type":69,"tag":146,"props":5650,"children":5651},{"class":148,"line":207},[5652,5656,5660,5664,5668,5672,5676,5680],{"type":69,"tag":146,"props":5653,"children":5654},{"style":153},[5655],{"type":75,"value":156},{"type":69,"tag":146,"props":5657,"children":5658},{"style":159},[5659],{"type":75,"value":162},{"type":69,"tag":146,"props":5661,"children":5662},{"style":165},[5663],{"type":75,"value":3714},{"type":69,"tag":146,"props":5665,"children":5666},{"style":159},[5667],{"type":75,"value":183},{"type":69,"tag":146,"props":5669,"children":5670},{"style":153},[5671],{"type":75,"value":188},{"type":69,"tag":146,"props":5673,"children":5674},{"style":159},[5675],{"type":75,"value":193},{"type":69,"tag":146,"props":5677,"children":5678},{"style":196},[5679],{"type":75,"value":199},{"type":69,"tag":146,"props":5681,"children":5682},{"style":159},[5683],{"type":75,"value":204},{"type":69,"tag":146,"props":5685,"children":5686},{"class":148,"line":245},[5687],{"type":69,"tag":146,"props":5688,"children":5689},{"emptyLinePlaceholder":249},[5690],{"type":75,"value":252},{"type":69,"tag":146,"props":5692,"children":5693},{"class":148,"line":255},[5694],{"type":69,"tag":146,"props":5695,"children":5696},{"style":948},[5697],{"type":75,"value":5698},"\u002F\u002F Provider-factory: configure baseURL + apiKey + models ONCE,\n",{"type":69,"tag":146,"props":5700,"children":5701},{"class":148,"line":290},[5702],{"type":69,"tag":146,"props":5703,"children":5704},{"style":948},[5705],{"type":75,"value":5706},"\u002F\u002F then select a model per call (the model arg is a type-safe union).\n",{"type":69,"tag":146,"props":5708,"children":5709},{"class":148,"line":336},[5710,5714,5719,5723,5727,5731],{"type":69,"tag":146,"props":5711,"children":5712},{"style":259},[5713],{"type":75,"value":262},{"type":69,"tag":146,"props":5715,"children":5716},{"style":165},[5717],{"type":75,"value":5718}," deepseek ",{"type":69,"tag":146,"props":5720,"children":5721},{"style":159},[5722],{"type":75,"value":272},{"type":69,"tag":146,"props":5724,"children":5725},{"style":275},[5726],{"type":75,"value":5628},{"type":69,"tag":146,"props":5728,"children":5729},{"style":165},[5730],{"type":75,"value":282},{"type":69,"tag":146,"props":5732,"children":5733},{"style":159},[5734],{"type":75,"value":287},{"type":69,"tag":146,"props":5736,"children":5737},{"class":148,"line":349},[5738,5743,5747,5751,5756,5760,5764],{"type":69,"tag":146,"props":5739,"children":5740},{"style":294},[5741],{"type":75,"value":5742},"  name",{"type":69,"tag":146,"props":5744,"children":5745},{"style":159},[5746],{"type":75,"value":134},{"type":69,"tag":146,"props":5748,"children":5749},{"style":159},[5750],{"type":75,"value":193},{"type":69,"tag":146,"props":5752,"children":5753},{"style":196},[5754],{"type":75,"value":5755},"deepseek",{"type":69,"tag":146,"props":5757,"children":5758},{"style":159},[5759],{"type":75,"value":314},{"type":69,"tag":146,"props":5761,"children":5762},{"style":159},[5763],{"type":75,"value":173},{"type":69,"tag":146,"props":5765,"children":5766},{"style":948},[5767],{"type":75,"value":5768}," \u002F\u002F optional label for devtools\u002Ferrors (default 'openai-compatible')\n",{"type":69,"tag":146,"props":5770,"children":5771},{"class":148,"line":367},[5772,5777,5781,5785,5790,5794],{"type":69,"tag":146,"props":5773,"children":5774},{"style":294},[5775],{"type":75,"value":5776},"  baseURL",{"type":69,"tag":146,"props":5778,"children":5779},{"style":159},[5780],{"type":75,"value":134},{"type":69,"tag":146,"props":5782,"children":5783},{"style":159},[5784],{"type":75,"value":193},{"type":69,"tag":146,"props":5786,"children":5787},{"style":196},[5788],{"type":75,"value":5789},"https:\u002F\u002Fapi.deepseek.com\u002Fv1",{"type":69,"tag":146,"props":5791,"children":5792},{"style":159},[5793],{"type":75,"value":314},{"type":69,"tag":146,"props":5795,"children":5796},{"style":159},[5797],{"type":75,"value":333},{"type":69,"tag":146,"props":5799,"children":5800},{"class":148,"line":390},[5801,5805,5809,5814,5818,5823,5827,5832],{"type":69,"tag":146,"props":5802,"children":5803},{"style":294},[5804],{"type":75,"value":1657},{"type":69,"tag":146,"props":5806,"children":5807},{"style":159},[5808],{"type":75,"value":134},{"type":69,"tag":146,"props":5810,"children":5811},{"style":165},[5812],{"type":75,"value":5813}," process",{"type":69,"tag":146,"props":5815,"children":5816},{"style":159},[5817],{"type":75,"value":470},{"type":69,"tag":146,"props":5819,"children":5820},{"style":165},[5821],{"type":75,"value":5822},"env",{"type":69,"tag":146,"props":5824,"children":5825},{"style":159},[5826],{"type":75,"value":470},{"type":69,"tag":146,"props":5828,"children":5829},{"style":165},[5830],{"type":75,"value":5831},"DEEPSEEK_API_KEY",{"type":69,"tag":146,"props":5833,"children":5834},{"style":159},[5835],{"type":75,"value":5836},"!,\n",{"type":69,"tag":146,"props":5838,"children":5839},{"class":148,"line":412},[5840,5845,5849],{"type":69,"tag":146,"props":5841,"children":5842},{"style":294},[5843],{"type":75,"value":5844},"  models",{"type":69,"tag":146,"props":5846,"children":5847},{"style":159},[5848],{"type":75,"value":134},{"type":69,"tag":146,"props":5850,"children":5851},{"style":165},[5852],{"type":75,"value":3805},{"type":69,"tag":146,"props":5854,"children":5855},{"class":148,"line":421},[5856,5861,5866,5870,5874],{"type":69,"tag":146,"props":5857,"children":5858},{"style":159},[5859],{"type":75,"value":5860},"    '",{"type":69,"tag":146,"props":5862,"children":5863},{"style":196},[5864],{"type":75,"value":5865},"deepseek-chat",{"type":69,"tag":146,"props":5867,"children":5868},{"style":159},[5869],{"type":75,"value":314},{"type":69,"tag":146,"props":5871,"children":5872},{"style":159},[5873],{"type":75,"value":173},{"type":69,"tag":146,"props":5875,"children":5876},{"style":948},[5877],{"type":75,"value":5878}," \u002F\u002F bare string → optimistic defaults: text\u002Fimage in, streaming, tools, structured output\n",{"type":69,"tag":146,"props":5880,"children":5881},{"class":148,"line":435},[5882,5887,5891,5895,5900,5904,5908],{"type":69,"tag":146,"props":5883,"children":5884},{"style":275},[5885],{"type":75,"value":5886},"    createModel",{"type":69,"tag":146,"props":5888,"children":5889},{"style":165},[5890],{"type":75,"value":282},{"type":69,"tag":146,"props":5892,"children":5893},{"style":159},[5894],{"type":75,"value":314},{"type":69,"tag":146,"props":5896,"children":5897},{"style":196},[5898],{"type":75,"value":5899},"deepseek-reasoner",{"type":69,"tag":146,"props":5901,"children":5902},{"style":159},[5903],{"type":75,"value":314},{"type":69,"tag":146,"props":5905,"children":5906},{"style":159},[5907],{"type":75,"value":173},{"type":69,"tag":146,"props":5909,"children":5910},{"style":159},[5911],{"type":75,"value":364},{"type":69,"tag":146,"props":5913,"children":5914},{"class":148,"line":443},[5915],{"type":69,"tag":146,"props":5916,"children":5917},{"style":948},[5918],{"type":75,"value":5919},"      \u002F\u002F rich def → precise per-model capabilities\n",{"type":69,"tag":146,"props":5921,"children":5922},{"class":148,"line":1337},[5923,5928,5932,5936,5940,5944,5948,5953],{"type":69,"tag":146,"props":5924,"children":5925},{"style":294},[5926],{"type":75,"value":5927},"      input",{"type":69,"tag":146,"props":5929,"children":5930},{"style":159},[5931],{"type":75,"value":134},{"type":69,"tag":146,"props":5933,"children":5934},{"style":165},[5935],{"type":75,"value":3839},{"type":69,"tag":146,"props":5937,"children":5938},{"style":159},[5939],{"type":75,"value":314},{"type":69,"tag":146,"props":5941,"children":5942},{"style":196},[5943],{"type":75,"value":75},{"type":69,"tag":146,"props":5945,"children":5946},{"style":159},[5947],{"type":75,"value":314},{"type":69,"tag":146,"props":5949,"children":5950},{"style":165},[5951],{"type":75,"value":5952},"]",{"type":69,"tag":146,"props":5954,"children":5955},{"style":159},[5956],{"type":75,"value":333},{"type":69,"tag":146,"props":5958,"children":5959},{"class":148,"line":1379},[5960,5965,5969,5973,5977,5982,5986,5990,5994,5999,6003,6007],{"type":69,"tag":146,"props":5961,"children":5962},{"style":294},[5963],{"type":75,"value":5964},"      features",{"type":69,"tag":146,"props":5966,"children":5967},{"style":159},[5968],{"type":75,"value":134},{"type":69,"tag":146,"props":5970,"children":5971},{"style":165},[5972],{"type":75,"value":3839},{"type":69,"tag":146,"props":5974,"children":5975},{"style":159},[5976],{"type":75,"value":314},{"type":69,"tag":146,"props":5978,"children":5979},{"style":196},[5980],{"type":75,"value":5981},"reasoning",{"type":69,"tag":146,"props":5983,"children":5984},{"style":159},[5985],{"type":75,"value":314},{"type":69,"tag":146,"props":5987,"children":5988},{"style":159},[5989],{"type":75,"value":173},{"type":69,"tag":146,"props":5991,"children":5992},{"style":159},[5993],{"type":75,"value":193},{"type":69,"tag":146,"props":5995,"children":5996},{"style":196},[5997],{"type":75,"value":5998},"structured_outputs",{"type":69,"tag":146,"props":6000,"children":6001},{"style":159},[6002],{"type":75,"value":314},{"type":69,"tag":146,"props":6004,"children":6005},{"style":165},[6006],{"type":75,"value":5952},{"type":69,"tag":146,"props":6008,"children":6009},{"style":159},[6010],{"type":75,"value":333},{"type":69,"tag":146,"props":6012,"children":6013},{"class":148,"line":1421},[6014,6019,6023],{"type":69,"tag":146,"props":6015,"children":6016},{"style":159},[6017],{"type":75,"value":6018},"    }",{"type":69,"tag":146,"props":6020,"children":6021},{"style":165},[6022],{"type":75,"value":328},{"type":69,"tag":146,"props":6024,"children":6025},{"style":159},[6026],{"type":75,"value":333},{"type":69,"tag":146,"props":6028,"children":6029},{"class":148,"line":1463},[6030,6035],{"type":69,"tag":146,"props":6031,"children":6032},{"style":165},[6033],{"type":75,"value":6034},"  ]",{"type":69,"tag":146,"props":6036,"children":6037},{"style":159},[6038],{"type":75,"value":333},{"type":69,"tag":146,"props":6040,"children":6041},{"class":148,"line":1505},[6042,6046],{"type":69,"tag":146,"props":6043,"children":6044},{"style":159},[6045],{"type":75,"value":427},{"type":69,"tag":146,"props":6047,"children":6048},{"style":165},[6049],{"type":75,"value":432},{"type":69,"tag":146,"props":6051,"children":6052},{"class":148,"line":1547},[6053],{"type":69,"tag":146,"props":6054,"children":6055},{"emptyLinePlaceholder":249},[6056],{"type":75,"value":252},{"type":69,"tag":146,"props":6058,"children":6059},{"class":148,"line":1589},[6060,6064,6068,6073,6078,6082,6087,6091,6095,6099,6103,6107,6111,6116,6120],{"type":69,"tag":146,"props":6061,"children":6062},{"style":275},[6063],{"type":75,"value":4226},{"type":69,"tag":146,"props":6065,"children":6066},{"style":165},[6067],{"type":75,"value":282},{"type":69,"tag":146,"props":6069,"children":6070},{"style":159},[6071],{"type":75,"value":6072},"{",{"type":69,"tag":146,"props":6074,"children":6075},{"style":294},[6076],{"type":75,"value":6077}," adapter",{"type":69,"tag":146,"props":6079,"children":6080},{"style":159},[6081],{"type":75,"value":134},{"type":69,"tag":146,"props":6083,"children":6084},{"style":275},[6085],{"type":75,"value":6086}," deepseek",{"type":69,"tag":146,"props":6088,"children":6089},{"style":165},[6090],{"type":75,"value":282},{"type":69,"tag":146,"props":6092,"children":6093},{"style":159},[6094],{"type":75,"value":314},{"type":69,"tag":146,"props":6096,"children":6097},{"style":196},[6098],{"type":75,"value":5865},{"type":69,"tag":146,"props":6100,"children":6101},{"style":159},[6102],{"type":75,"value":314},{"type":69,"tag":146,"props":6104,"children":6105},{"style":165},[6106],{"type":75,"value":328},{"type":69,"tag":146,"props":6108,"children":6109},{"style":159},[6110],{"type":75,"value":173},{"type":69,"tag":146,"props":6112,"children":6113},{"style":165},[6114],{"type":75,"value":6115}," messages ",{"type":69,"tag":146,"props":6117,"children":6118},{"style":159},[6119],{"type":75,"value":427},{"type":69,"tag":146,"props":6121,"children":6122},{"style":165},[6123],{"type":75,"value":432},{"type":69,"tag":146,"props":6125,"children":6126},{"class":148,"line":1597},[6127,6131,6135,6139,6143,6147,6151,6155,6159,6163,6167,6171,6175,6179,6183],{"type":69,"tag":146,"props":6128,"children":6129},{"style":275},[6130],{"type":75,"value":4226},{"type":69,"tag":146,"props":6132,"children":6133},{"style":165},[6134],{"type":75,"value":282},{"type":69,"tag":146,"props":6136,"children":6137},{"style":159},[6138],{"type":75,"value":6072},{"type":69,"tag":146,"props":6140,"children":6141},{"style":294},[6142],{"type":75,"value":6077},{"type":69,"tag":146,"props":6144,"children":6145},{"style":159},[6146],{"type":75,"value":134},{"type":69,"tag":146,"props":6148,"children":6149},{"style":275},[6150],{"type":75,"value":6086},{"type":69,"tag":146,"props":6152,"children":6153},{"style":165},[6154],{"type":75,"value":282},{"type":69,"tag":146,"props":6156,"children":6157},{"style":159},[6158],{"type":75,"value":314},{"type":69,"tag":146,"props":6160,"children":6161},{"style":196},[6162],{"type":75,"value":5899},{"type":69,"tag":146,"props":6164,"children":6165},{"style":159},[6166],{"type":75,"value":314},{"type":69,"tag":146,"props":6168,"children":6169},{"style":165},[6170],{"type":75,"value":328},{"type":69,"tag":146,"props":6172,"children":6173},{"style":159},[6174],{"type":75,"value":173},{"type":69,"tag":146,"props":6176,"children":6177},{"style":165},[6178],{"type":75,"value":6115},{"type":69,"tag":146,"props":6180,"children":6181},{"style":159},[6182],{"type":75,"value":427},{"type":69,"tag":146,"props":6184,"children":6185},{"style":165},[6186],{"type":75,"value":432},{"type":69,"tag":82,"props":6188,"children":6189},{},[6190,6196,6198,6204,6206,6212,6214,6220],{"type":69,"tag":107,"props":6191,"children":6193},{"className":6192},[],[6194],{"type":75,"value":6195},"config",{"type":75,"value":6197}," also accepts any OpenAI SDK ",{"type":69,"tag":107,"props":6199,"children":6201},{"className":6200},[],[6202],{"type":75,"value":6203},"ClientOptions",{"type":75,"value":6205}," (notably ",{"type":69,"tag":107,"props":6207,"children":6209},{"className":6208},[],[6210],{"type":75,"value":6211},"defaultHeaders",{"type":75,"value":6213},"\nand ",{"type":69,"tag":107,"props":6215,"children":6217},{"className":6216},[],[6218],{"type":75,"value":6219},"defaultQuery",{"type":75,"value":6221},") for providers that need extra auth headers or query params.",{"type":69,"tag":82,"props":6223,"children":6224},{},[6225],{"type":75,"value":6226},"For a single model, use the one-shot helper:",{"type":69,"tag":136,"props":6228,"children":6230},{"className":138,"code":6229,"language":44,"meta":140,"style":140},"import { openaiCompatibleText } from '@tanstack\u002Fai-openai\u002Fcompatible'\n\nchat({\n  adapter: openaiCompatibleText('deepseek-chat', {\n    baseURL: 'https:\u002F\u002Fapi.deepseek.com\u002Fv1',\n    apiKey: process.env.DEEPSEEK_API_KEY!,\n  }),\n  messages,\n})\n",[6231],{"type":69,"tag":107,"props":6232,"children":6233},{"__ignoreMap":140},[6234,6270,6277,6292,6331,6359,6395,6410,6421],{"type":69,"tag":146,"props":6235,"children":6236},{"class":148,"line":149},[6237,6241,6245,6250,6254,6258,6262,6266],{"type":69,"tag":146,"props":6238,"children":6239},{"style":153},[6240],{"type":75,"value":156},{"type":69,"tag":146,"props":6242,"children":6243},{"style":159},[6244],{"type":75,"value":162},{"type":69,"tag":146,"props":6246,"children":6247},{"style":165},[6248],{"type":75,"value":6249}," openaiCompatibleText",{"type":69,"tag":146,"props":6251,"children":6252},{"style":159},[6253],{"type":75,"value":183},{"type":69,"tag":146,"props":6255,"children":6256},{"style":153},[6257],{"type":75,"value":188},{"type":69,"tag":146,"props":6259,"children":6260},{"style":159},[6261],{"type":75,"value":193},{"type":69,"tag":146,"props":6263,"children":6264},{"style":196},[6265],{"type":75,"value":906},{"type":69,"tag":146,"props":6267,"children":6268},{"style":159},[6269],{"type":75,"value":204},{"type":69,"tag":146,"props":6271,"children":6272},{"class":148,"line":207},[6273],{"type":69,"tag":146,"props":6274,"children":6275},{"emptyLinePlaceholder":249},[6276],{"type":75,"value":252},{"type":69,"tag":146,"props":6278,"children":6279},{"class":148,"line":245},[6280,6284,6288],{"type":69,"tag":146,"props":6281,"children":6282},{"style":275},[6283],{"type":75,"value":4226},{"type":69,"tag":146,"props":6285,"children":6286},{"style":165},[6287],{"type":75,"value":282},{"type":69,"tag":146,"props":6289,"children":6290},{"style":159},[6291],{"type":75,"value":287},{"type":69,"tag":146,"props":6293,"children":6294},{"class":148,"line":255},[6295,6299,6303,6307,6311,6315,6319,6323,6327],{"type":69,"tag":146,"props":6296,"children":6297},{"style":294},[6298],{"type":75,"value":297},{"type":69,"tag":146,"props":6300,"children":6301},{"style":159},[6302],{"type":75,"value":134},{"type":69,"tag":146,"props":6304,"children":6305},{"style":275},[6306],{"type":75,"value":6249},{"type":69,"tag":146,"props":6308,"children":6309},{"style":165},[6310],{"type":75,"value":282},{"type":69,"tag":146,"props":6312,"children":6313},{"style":159},[6314],{"type":75,"value":314},{"type":69,"tag":146,"props":6316,"children":6317},{"style":196},[6318],{"type":75,"value":5865},{"type":69,"tag":146,"props":6320,"children":6321},{"style":159},[6322],{"type":75,"value":314},{"type":69,"tag":146,"props":6324,"children":6325},{"style":159},[6326],{"type":75,"value":173},{"type":69,"tag":146,"props":6328,"children":6329},{"style":159},[6330],{"type":75,"value":364},{"type":69,"tag":146,"props":6332,"children":6333},{"class":148,"line":290},[6334,6339,6343,6347,6351,6355],{"type":69,"tag":146,"props":6335,"children":6336},{"style":294},[6337],{"type":75,"value":6338},"    baseURL",{"type":69,"tag":146,"props":6340,"children":6341},{"style":159},[6342],{"type":75,"value":134},{"type":69,"tag":146,"props":6344,"children":6345},{"style":159},[6346],{"type":75,"value":193},{"type":69,"tag":146,"props":6348,"children":6349},{"style":196},[6350],{"type":75,"value":5789},{"type":69,"tag":146,"props":6352,"children":6353},{"style":159},[6354],{"type":75,"value":314},{"type":69,"tag":146,"props":6356,"children":6357},{"style":159},[6358],{"type":75,"value":333},{"type":69,"tag":146,"props":6360,"children":6361},{"class":148,"line":336},[6362,6367,6371,6375,6379,6383,6387,6391],{"type":69,"tag":146,"props":6363,"children":6364},{"style":294},[6365],{"type":75,"value":6366},"    apiKey",{"type":69,"tag":146,"props":6368,"children":6369},{"style":159},[6370],{"type":75,"value":134},{"type":69,"tag":146,"props":6372,"children":6373},{"style":165},[6374],{"type":75,"value":5813},{"type":69,"tag":146,"props":6376,"children":6377},{"style":159},[6378],{"type":75,"value":470},{"type":69,"tag":146,"props":6380,"children":6381},{"style":165},[6382],{"type":75,"value":5822},{"type":69,"tag":146,"props":6384,"children":6385},{"style":159},[6386],{"type":75,"value":470},{"type":69,"tag":146,"props":6388,"children":6389},{"style":165},[6390],{"type":75,"value":5831},{"type":69,"tag":146,"props":6392,"children":6393},{"style":159},[6394],{"type":75,"value":5836},{"type":69,"tag":146,"props":6396,"children":6397},{"class":148,"line":349},[6398,6402,6406],{"type":69,"tag":146,"props":6399,"children":6400},{"style":159},[6401],{"type":75,"value":2566},{"type":69,"tag":146,"props":6403,"children":6404},{"style":165},[6405],{"type":75,"value":328},{"type":69,"tag":146,"props":6407,"children":6408},{"style":159},[6409],{"type":75,"value":333},{"type":69,"tag":146,"props":6411,"children":6412},{"class":148,"line":367},[6413,6417],{"type":69,"tag":146,"props":6414,"children":6415},{"style":165},[6416],{"type":75,"value":342},{"type":69,"tag":146,"props":6418,"children":6419},{"style":159},[6420],{"type":75,"value":333},{"type":69,"tag":146,"props":6422,"children":6423},{"class":148,"line":390},[6424,6428],{"type":69,"tag":146,"props":6425,"children":6426},{"style":159},[6427],{"type":75,"value":427},{"type":69,"tag":146,"props":6429,"children":6430},{"style":165},[6431],{"type":75,"value":432},{"type":69,"tag":82,"props":6433,"children":6434},{},[6435,6437,6443,6445,6450,6452,6458],{"type":75,"value":6436},"Pass ",{"type":69,"tag":107,"props":6438,"children":6440},{"className":6439},[],[6441],{"type":75,"value":6442},"api: 'responses'",{"type":75,"value":6444}," to target the OpenAI ",{"type":69,"tag":86,"props":6446,"children":6447},{},[6448],{"type":75,"value":6449},"Responses",{"type":75,"value":6451}," API instead of Chat\nCompletions (only for the rare compatible provider that implements it, e.g.\nAzure OpenAI); the default is ",{"type":69,"tag":107,"props":6453,"children":6455},{"className":6454},[],[6456],{"type":75,"value":6457},"'chat-completions'",{"type":75,"value":6459},", which is what nearly all\ncompatible providers speak.",{"type":69,"tag":78,"props":6461,"children":6462},{},[6463],{"type":69,"tag":82,"props":6464,"children":6465},{},[6466,6468,6474,6476,6482],{"type":75,"value":6467},"Verify the provider's current ",{"type":69,"tag":107,"props":6469,"children":6471},{"className":6470},[],[6472],{"type":75,"value":6473},"baseURL",{"type":75,"value":6475}," and model ids against its live docs —\nthey drift. See ",{"type":69,"tag":107,"props":6477,"children":6479},{"className":6478},[],[6480],{"type":75,"value":6481},"docs\u002Fadapters\u002Fopenai-compatible.md",{"type":75,"value":6483}," for the full provider table.",{"type":69,"tag":116,"props":6485,"children":6487},{"id":6486},"common-mistakes",[6488],{"type":75,"value":6489},"Common Mistakes",{"type":69,"tag":538,"props":6491,"children":6493},{"id":6492},"a-high-confusing-legacy-monolithic-with-tree-shakeable-adapter",[6494],{"type":75,"value":6495},"a. HIGH: Confusing legacy monolithic with tree-shakeable adapter",{"type":69,"tag":82,"props":6497,"children":6498},{},[6499,6501,6507,6509,6515,6517,6522],{"type":75,"value":6500},"The legacy ",{"type":69,"tag":107,"props":6502,"children":6504},{"className":6503},[],[6505],{"type":75,"value":6506},"openai()",{"type":75,"value":6508}," (and ",{"type":69,"tag":107,"props":6510,"children":6512},{"className":6511},[],[6513],{"type":75,"value":6514},"anthropic()",{"type":75,"value":6516},", etc.) monolithic adapters are\ndeprecated. They take the model in ",{"type":69,"tag":107,"props":6518,"children":6520},{"className":6519},[],[6521],{"type":75,"value":132},{"type":75,"value":6523},", not in the factory.",{"type":69,"tag":136,"props":6525,"children":6527},{"className":138,"code":6526,"language":44,"meta":140,"style":140},"\u002F\u002F WRONG: Legacy monolithic adapter pattern\nimport { openai } from '@tanstack\u002Fai-openai'\nchat({ adapter: openai(), model: 'gpt-5.2', messages })\n\n\u002F\u002F CORRECT: Tree-shakeable adapter, model in factory\nimport { openaiText } from '@tanstack\u002Fai-openai'\nchat({ adapter: openaiText('gpt-5.2'), messages })\n",[6528],{"type":69,"tag":107,"props":6529,"children":6530},{"__ignoreMap":140},[6531,6539,6575,6647,6654,6662,6697],{"type":69,"tag":146,"props":6532,"children":6533},{"class":148,"line":149},[6534],{"type":69,"tag":146,"props":6535,"children":6536},{"style":948},[6537],{"type":75,"value":6538},"\u002F\u002F WRONG: Legacy monolithic adapter pattern\n",{"type":69,"tag":146,"props":6540,"children":6541},{"class":148,"line":207},[6542,6546,6550,6555,6559,6563,6567,6571],{"type":69,"tag":146,"props":6543,"children":6544},{"style":153},[6545],{"type":75,"value":156},{"type":69,"tag":146,"props":6547,"children":6548},{"style":159},[6549],{"type":75,"value":162},{"type":69,"tag":146,"props":6551,"children":6552},{"style":165},[6553],{"type":75,"value":6554}," openai",{"type":69,"tag":146,"props":6556,"children":6557},{"style":159},[6558],{"type":75,"value":183},{"type":69,"tag":146,"props":6560,"children":6561},{"style":153},[6562],{"type":75,"value":188},{"type":69,"tag":146,"props":6564,"children":6565},{"style":159},[6566],{"type":75,"value":193},{"type":69,"tag":146,"props":6568,"children":6569},{"style":196},[6570],{"type":75,"value":238},{"type":69,"tag":146,"props":6572,"children":6573},{"style":159},[6574],{"type":75,"value":204},{"type":69,"tag":146,"props":6576,"children":6577},{"class":148,"line":245},[6578,6582,6586,6590,6594,6598,6602,6606,6610,6615,6619,6623,6627,6631,6635,6639,6643],{"type":69,"tag":146,"props":6579,"children":6580},{"style":275},[6581],{"type":75,"value":4226},{"type":69,"tag":146,"props":6583,"children":6584},{"style":165},[6585],{"type":75,"value":282},{"type":69,"tag":146,"props":6587,"children":6588},{"style":159},[6589],{"type":75,"value":6072},{"type":69,"tag":146,"props":6591,"children":6592},{"style":294},[6593],{"type":75,"value":6077},{"type":69,"tag":146,"props":6595,"children":6596},{"style":159},[6597],{"type":75,"value":134},{"type":69,"tag":146,"props":6599,"children":6600},{"style":275},[6601],{"type":75,"value":6554},{"type":69,"tag":146,"props":6603,"children":6604},{"style":165},[6605],{"type":75,"value":2542},{"type":69,"tag":146,"props":6607,"children":6608},{"style":159},[6609],{"type":75,"value":173},{"type":69,"tag":146,"props":6611,"children":6612},{"style":294},[6613],{"type":75,"value":6614}," model",{"type":69,"tag":146,"props":6616,"children":6617},{"style":159},[6618],{"type":75,"value":134},{"type":69,"tag":146,"props":6620,"children":6621},{"style":159},[6622],{"type":75,"value":193},{"type":69,"tag":146,"props":6624,"children":6625},{"style":196},[6626],{"type":75,"value":319},{"type":69,"tag":146,"props":6628,"children":6629},{"style":159},[6630],{"type":75,"value":314},{"type":69,"tag":146,"props":6632,"children":6633},{"style":159},[6634],{"type":75,"value":173},{"type":69,"tag":146,"props":6636,"children":6637},{"style":165},[6638],{"type":75,"value":6115},{"type":69,"tag":146,"props":6640,"children":6641},{"style":159},[6642],{"type":75,"value":427},{"type":69,"tag":146,"props":6644,"children":6645},{"style":165},[6646],{"type":75,"value":432},{"type":69,"tag":146,"props":6648,"children":6649},{"class":148,"line":255},[6650],{"type":69,"tag":146,"props":6651,"children":6652},{"emptyLinePlaceholder":249},[6653],{"type":75,"value":252},{"type":69,"tag":146,"props":6655,"children":6656},{"class":148,"line":290},[6657],{"type":69,"tag":146,"props":6658,"children":6659},{"style":948},[6660],{"type":75,"value":6661},"\u002F\u002F CORRECT: Tree-shakeable adapter, model in factory\n",{"type":69,"tag":146,"props":6663,"children":6664},{"class":148,"line":336},[6665,6669,6673,6677,6681,6685,6689,6693],{"type":69,"tag":146,"props":6666,"children":6667},{"style":153},[6668],{"type":75,"value":156},{"type":69,"tag":146,"props":6670,"children":6671},{"style":159},[6672],{"type":75,"value":162},{"type":69,"tag":146,"props":6674,"children":6675},{"style":165},[6676],{"type":75,"value":221},{"type":69,"tag":146,"props":6678,"children":6679},{"style":159},[6680],{"type":75,"value":183},{"type":69,"tag":146,"props":6682,"children":6683},{"style":153},[6684],{"type":75,"value":188},{"type":69,"tag":146,"props":6686,"children":6687},{"style":159},[6688],{"type":75,"value":193},{"type":69,"tag":146,"props":6690,"children":6691},{"style":196},[6692],{"type":75,"value":238},{"type":69,"tag":146,"props":6694,"children":6695},{"style":159},[6696],{"type":75,"value":204},{"type":69,"tag":146,"props":6698,"children":6699},{"class":148,"line":349},[6700,6704,6708,6712,6716,6720,6724,6728,6732,6736,6740,6744,6748,6752,6756],{"type":69,"tag":146,"props":6701,"children":6702},{"style":275},[6703],{"type":75,"value":4226},{"type":69,"tag":146,"props":6705,"children":6706},{"style":165},[6707],{"type":75,"value":282},{"type":69,"tag":146,"props":6709,"children":6710},{"style":159},[6711],{"type":75,"value":6072},{"type":69,"tag":146,"props":6713,"children":6714},{"style":294},[6715],{"type":75,"value":6077},{"type":69,"tag":146,"props":6717,"children":6718},{"style":159},[6719],{"type":75,"value":134},{"type":69,"tag":146,"props":6721,"children":6722},{"style":275},[6723],{"type":75,"value":221},{"type":69,"tag":146,"props":6725,"children":6726},{"style":165},[6727],{"type":75,"value":282},{"type":69,"tag":146,"props":6729,"children":6730},{"style":159},[6731],{"type":75,"value":314},{"type":69,"tag":146,"props":6733,"children":6734},{"style":196},[6735],{"type":75,"value":319},{"type":69,"tag":146,"props":6737,"children":6738},{"style":159},[6739],{"type":75,"value":314},{"type":69,"tag":146,"props":6741,"children":6742},{"style":165},[6743],{"type":75,"value":328},{"type":69,"tag":146,"props":6745,"children":6746},{"style":159},[6747],{"type":75,"value":173},{"type":69,"tag":146,"props":6749,"children":6750},{"style":165},[6751],{"type":75,"value":6115},{"type":69,"tag":146,"props":6753,"children":6754},{"style":159},[6755],{"type":75,"value":427},{"type":69,"tag":146,"props":6757,"children":6758},{"style":165},[6759],{"type":75,"value":432},{"type":69,"tag":82,"props":6761,"children":6762},{},[6763],{"type":75,"value":6764},"Source: docs\u002Fmigration\u002Fmigration.md",{"type":69,"tag":538,"props":6766,"children":6768},{"id":6767},"b-medium-wrong-api-key-environment-variable-name",[6769],{"type":75,"value":6770},"b. MEDIUM: Wrong API key environment variable name",{"type":69,"tag":82,"props":6772,"children":6773},{},[6774],{"type":75,"value":6775},"Each provider uses a specific env var name. Using the wrong one causes a\nruntime error:",{"type":69,"tag":550,"props":6777,"children":6778},{},[6779,6799],{"type":69,"tag":554,"props":6780,"children":6781},{},[6782],{"type":69,"tag":558,"props":6783,"children":6784},{},[6785,6789,6794],{"type":69,"tag":562,"props":6786,"children":6787},{},[6788],{"type":75,"value":566},{"type":69,"tag":562,"props":6790,"children":6791},{},[6792],{"type":75,"value":6793},"Correct Env Var",{"type":69,"tag":562,"props":6795,"children":6796},{},[6797],{"type":75,"value":6798},"Common Mistake",{"type":69,"tag":583,"props":6800,"children":6801},{},[6802,6820,6838,6870,6895,6913,6931,6957],{"type":69,"tag":558,"props":6803,"children":6804},{},[6805,6809,6817],{"type":69,"tag":590,"props":6806,"children":6807},{},[6808],{"type":75,"value":594},{"type":69,"tag":590,"props":6810,"children":6811},{},[6812],{"type":69,"tag":107,"props":6813,"children":6815},{"className":6814},[],[6816],{"type":75,"value":620},{"type":69,"tag":590,"props":6818,"children":6819},{},[],{"type":69,"tag":558,"props":6821,"children":6822},{},[6823,6827,6835],{"type":69,"tag":590,"props":6824,"children":6825},{},[6826],{"type":75,"value":628},{"type":69,"tag":590,"props":6828,"children":6829},{},[6830],{"type":69,"tag":107,"props":6831,"children":6833},{"className":6832},[],[6834],{"type":75,"value":655},{"type":69,"tag":590,"props":6836,"children":6837},{},[],{"type":69,"tag":558,"props":6839,"children":6840},{},[6841,6845,6859],{"type":69,"tag":590,"props":6842,"children":6843},{},[6844],{"type":75,"value":663},{"type":69,"tag":590,"props":6846,"children":6847},{},[6848,6853,6854],{"type":69,"tag":107,"props":6849,"children":6851},{"className":6850},[],[6852],{"type":75,"value":690},{"type":75,"value":692},{"type":69,"tag":107,"props":6855,"children":6857},{"className":6856},[],[6858],{"type":75,"value":698},{"type":69,"tag":590,"props":6860,"children":6861},{},[6862,6868],{"type":69,"tag":107,"props":6863,"children":6865},{"className":6864},[],[6866],{"type":75,"value":6867},"GOOGLE_GENAI_API_KEY",{"type":75,"value":6869}," (does not work)",{"type":69,"tag":558,"props":6871,"children":6872},{},[6873,6877,6885],{"type":69,"tag":590,"props":6874,"children":6875},{},[6876],{"type":75,"value":706},{"type":69,"tag":590,"props":6878,"children":6879},{},[6880],{"type":69,"tag":107,"props":6881,"children":6883},{"className":6882},[],[6884],{"type":75,"value":733},{"type":69,"tag":590,"props":6886,"children":6887},{},[6888,6894],{"type":69,"tag":107,"props":6889,"children":6891},{"className":6890},[],[6892],{"type":75,"value":6893},"GROK_API_KEY",{"type":75,"value":6869},{"type":69,"tag":558,"props":6896,"children":6897},{},[6898,6902,6910],{"type":69,"tag":590,"props":6899,"children":6900},{},[6901],{"type":75,"value":741},{"type":69,"tag":590,"props":6903,"children":6904},{},[6905],{"type":69,"tag":107,"props":6906,"children":6908},{"className":6907},[],[6909],{"type":75,"value":768},{"type":69,"tag":590,"props":6911,"children":6912},{},[],{"type":69,"tag":558,"props":6914,"children":6915},{},[6916,6920,6928],{"type":69,"tag":590,"props":6917,"children":6918},{},[6919],{"type":75,"value":776},{"type":69,"tag":590,"props":6921,"children":6922},{},[6923],{"type":69,"tag":107,"props":6924,"children":6926},{"className":6925},[],[6927],{"type":75,"value":803},{"type":69,"tag":590,"props":6929,"children":6930},{},[],{"type":69,"tag":558,"props":6932,"children":6933},{},[6934,6938,6946],{"type":69,"tag":590,"props":6935,"children":6936},{},[6937],{"type":75,"value":811},{"type":69,"tag":590,"props":6939,"children":6940},{},[6941],{"type":69,"tag":107,"props":6942,"children":6944},{"className":6943},[],[6945],{"type":75,"value":838},{"type":69,"tag":590,"props":6947,"children":6948},{},[6949,6951,6956],{"type":75,"value":6950},"No API key needed, just the host URL (default: ",{"type":69,"tag":107,"props":6952,"children":6954},{"className":6953},[],[6955],{"type":75,"value":846},{"type":75,"value":328},{"type":69,"tag":558,"props":6958,"children":6959},{},[6960,6964,6978],{"type":69,"tag":590,"props":6961,"children":6962},{},[6963],{"type":75,"value":855},{"type":69,"tag":590,"props":6965,"children":6966},{},[6967,6972,6973],{"type":69,"tag":107,"props":6968,"children":6970},{"className":6969},[],[6971],{"type":75,"value":882},{"type":75,"value":917},{"type":69,"tag":107,"props":6974,"children":6976},{"className":6975},[],[6977],{"type":75,"value":889},{"type":69,"tag":590,"props":6979,"children":6980},{},[6981],{"type":75,"value":6982},"Falls back to SigV4 credentials when no API key is set",{"type":69,"tag":82,"props":6984,"children":6985},{},[6986,6988,6994],{"type":75,"value":6987},"Source: adapter source code (",{"type":69,"tag":107,"props":6989,"children":6991},{"className":6990},[],[6992],{"type":75,"value":6993},"utils\u002Fclient.ts",{"type":75,"value":6995}," in each adapter package).",{"type":69,"tag":116,"props":6997,"children":6999},{"id":6998},"references",[7000],{"type":75,"value":7001},"References",{"type":69,"tag":82,"props":7003,"children":7004},{},[7005],{"type":75,"value":7006},"Detailed per-adapter reference files:",{"type":69,"tag":1709,"props":7008,"children":7009},{},[7010,7019,7028,7037,7046,7055,7064],{"type":69,"tag":1713,"props":7011,"children":7012},{},[7013],{"type":69,"tag":523,"props":7014,"children":7016},{"href":7015},"references\u002Fopenai-adapter.md",[7017],{"type":75,"value":7018},"OpenAI Adapter",{"type":69,"tag":1713,"props":7020,"children":7021},{},[7022],{"type":69,"tag":523,"props":7023,"children":7025},{"href":7024},"references\u002Fanthropic-adapter.md",[7026],{"type":75,"value":7027},"Anthropic Adapter",{"type":69,"tag":1713,"props":7029,"children":7030},{},[7031],{"type":69,"tag":523,"props":7032,"children":7034},{"href":7033},"references\u002Fgemini-adapter.md",[7035],{"type":75,"value":7036},"Gemini Adapter",{"type":69,"tag":1713,"props":7038,"children":7039},{},[7040],{"type":69,"tag":523,"props":7041,"children":7043},{"href":7042},"references\u002Follama-adapter.md",[7044],{"type":75,"value":7045},"Ollama Adapter",{"type":69,"tag":1713,"props":7047,"children":7048},{},[7049],{"type":69,"tag":523,"props":7050,"children":7052},{"href":7051},"references\u002Fgrok-adapter.md",[7053],{"type":75,"value":7054},"Grok Adapter",{"type":69,"tag":1713,"props":7056,"children":7057},{},[7058],{"type":69,"tag":523,"props":7059,"children":7061},{"href":7060},"references\u002Fgroq-adapter.md",[7062],{"type":75,"value":7063},"Groq Adapter",{"type":69,"tag":1713,"props":7065,"children":7066},{},[7067],{"type":69,"tag":523,"props":7068,"children":7070},{"href":7069},"references\u002Fopenrouter-adapter.md",[7071],{"type":75,"value":7072},"OpenRouter Adapter",{"type":69,"tag":116,"props":7074,"children":7076},{"id":7075},"tension",[7077],{"type":75,"value":7078},"Tension",{"type":69,"tag":82,"props":7080,"children":7081},{},[7082,7087,7089,7094,7096,7101],{"type":69,"tag":86,"props":7083,"children":7084},{},[7085],{"type":75,"value":7086},"HIGH Tension: Type safety vs. quick prototyping",{"type":75,"value":7088}," -- Per-model type safety\nrequires specific model string literals. Quick prototyping wants dynamic\nselection with ",{"type":69,"tag":107,"props":7090,"children":7092},{"className":7091},[],[7093],{"type":75,"value":2072},{"type":75,"value":7095}," variables. Agents optimizing for quick setup silently\nlose type safety. If model names come from user input or config files, use\n",{"type":69,"tag":107,"props":7097,"children":7099},{"className":7098},[],[7100],{"type":75,"value":3672},{"type":75,"value":7102}," to add custom names.",{"type":69,"tag":116,"props":7104,"children":7106},{"id":7105},"cross-references",[7107],{"type":75,"value":7108},"Cross-References",{"type":69,"tag":1709,"props":7110,"children":7111},{},[7112,7125],{"type":69,"tag":1713,"props":7113,"children":7114},{},[7115,7117,7123],{"type":75,"value":7116},"See also: ",{"type":69,"tag":107,"props":7118,"children":7120},{"className":7119},[],[7121],{"type":75,"value":7122},"ai-core\u002Fchat-experience\u002FSKILL.md",{"type":75,"value":7124}," -- Adapter choice affects chat setup",{"type":69,"tag":1713,"props":7126,"children":7127},{},[7128,7129,7135,7137,7142],{"type":75,"value":7116},{"type":69,"tag":107,"props":7130,"children":7132},{"className":7131},[],[7133],{"type":75,"value":7134},"ai-core\u002Fstructured-outputs\u002FSKILL.md",{"type":75,"value":7136}," -- ",{"type":69,"tag":107,"props":7138,"children":7140},{"className":7139},[],[7141],{"type":75,"value":5291},{"type":75,"value":7143}," handles provider differences transparently",{"type":69,"tag":7145,"props":7146,"children":7147},"style",{},[7148],{"type":75,"value":7149},"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":7151,"total":7293},[7152,7168,7180,7192,7207,7219,7229,7239,7252,7262,7273,7283],{"slug":7153,"name":7153,"fn":7154,"description":7155,"org":7156,"tags":7157,"stars":7165,"repoUrl":7166,"updatedAt":7167},"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},[7158,7161,7164],{"name":7159,"slug":7160,"type":16},"Data Analysis","data-analysis",{"name":7162,"slug":7163,"type":16},"Frontend","frontend",{"name":10,"slug":9,"type":16},28175,"https:\u002F\u002Fgithub.com\u002FTanStack\u002Ftable","2026-07-30T05:25:59.429787",{"slug":7169,"name":7169,"fn":7170,"description":7171,"org":7172,"tags":7173,"stars":7165,"repoUrl":7166,"updatedAt":7179},"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},[7174,7177,7178],{"name":7175,"slug":7176,"type":16},"Debugging","debugging",{"name":7162,"slug":7163,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:26:05.418735",{"slug":7181,"name":7181,"fn":7182,"description":7183,"org":7184,"tags":7185,"stars":7165,"repoUrl":7166,"updatedAt":7191},"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},[7186,7187,7188],{"name":7159,"slug":7160,"type":16},{"name":10,"slug":9,"type":16},{"name":7189,"slug":7190,"type":16},"UI Components","ui-components","2026-07-30T05:25:38.403427",{"slug":7193,"name":7193,"fn":7194,"description":7195,"org":7196,"tags":7197,"stars":7165,"repoUrl":7166,"updatedAt":7206},"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},[7198,7201,7202,7205],{"name":7199,"slug":7200,"type":16},"Data Pipeline","data-pipeline",{"name":7162,"slug":7163,"type":16},{"name":7203,"slug":7204,"type":16},"Performance","performance",{"name":10,"slug":9,"type":16},"2026-07-30T05:25:45.400104",{"slug":7208,"name":7208,"fn":7209,"description":7210,"org":7211,"tags":7212,"stars":7165,"repoUrl":7166,"updatedAt":7218},"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},[7213,7216,7217],{"name":7214,"slug":7215,"type":16},"Data Visualization","data-visualization",{"name":7162,"slug":7163,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:25:41.397257",{"slug":7220,"name":7220,"fn":7221,"description":7222,"org":7223,"tags":7224,"stars":7165,"repoUrl":7166,"updatedAt":7228},"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},[7225,7226,7227],{"name":7159,"slug":7160,"type":16},{"name":7162,"slug":7163,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:25:53.391632",{"slug":7230,"name":7230,"fn":7231,"description":7232,"org":7233,"tags":7234,"stars":7165,"repoUrl":7166,"updatedAt":7238},"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},[7235,7236,7237],{"name":7162,"slug":7163,"type":16},{"name":10,"slug":9,"type":16},{"name":7189,"slug":7190,"type":16},"2026-07-30T05:26:03.37801",{"slug":7240,"name":7240,"fn":7241,"description":7242,"org":7243,"tags":7244,"stars":7165,"repoUrl":7166,"updatedAt":7251},"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},[7245,7248,7249,7250],{"name":7246,"slug":7247,"type":16},"CSS","css",{"name":7162,"slug":7163,"type":16},{"name":10,"slug":9,"type":16},{"name":7189,"slug":7190,"type":16},"2026-07-30T05:25:55.377366",{"slug":7253,"name":7253,"fn":7254,"description":7255,"org":7256,"tags":7257,"stars":7165,"repoUrl":7166,"updatedAt":7261},"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},[7258,7259,7260],{"name":7162,"slug":7163,"type":16},{"name":10,"slug":9,"type":16},{"name":7189,"slug":7190,"type":16},"2026-07-30T05:25:51.400011",{"slug":7263,"name":7263,"fn":7264,"description":7265,"org":7266,"tags":7267,"stars":7165,"repoUrl":7166,"updatedAt":7272},"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},[7268,7269,7270,7271],{"name":7246,"slug":7247,"type":16},{"name":7162,"slug":7163,"type":16},{"name":10,"slug":9,"type":16},{"name":7189,"slug":7190,"type":16},"2026-07-30T05:25:48.703799",{"slug":7274,"name":7274,"fn":7275,"description":7276,"org":7277,"tags":7278,"stars":7165,"repoUrl":7166,"updatedAt":7282},"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},[7279,7280,7281],{"name":7162,"slug":7163,"type":16},{"name":10,"slug":9,"type":16},{"name":7189,"slug":7190,"type":16},"2026-07-30T05:25:47.367943",{"slug":7284,"name":7284,"fn":7285,"description":7286,"org":7287,"tags":7288,"stars":7165,"repoUrl":7166,"updatedAt":7292},"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},[7289,7290,7291],{"name":7159,"slug":7160,"type":16},{"name":7162,"slug":7163,"type":16},{"name":7189,"slug":7190,"type":16},"2026-07-30T05:25:52.366295",125,{"items":7295,"total":3186},[7296,7313,7328,7335,7348,7360,7374],{"slug":7297,"name":7297,"fn":7298,"description":7299,"org":7300,"tags":7301,"stars":24,"repoUrl":25,"updatedAt":7312},"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},[7302,7303,7306,7309,7310],{"name":21,"slug":22,"type":16},{"name":7304,"slug":7305,"type":16},"Code Execution","code-execution",{"name":7307,"slug":7308,"type":16},"Sandboxing","sandboxing",{"name":10,"slug":9,"type":16},{"name":7311,"slug":44,"type":16},"TypeScript","2026-07-16T06:04:13.597905",{"slug":7314,"name":7314,"fn":7315,"description":7316,"org":7317,"tags":7318,"stars":24,"repoUrl":25,"updatedAt":7327},"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},[7319,7322,7324],{"name":7320,"slug":7321,"type":16},"Agents","agents",{"name":7323,"slug":30,"type":16},"AI",{"name":7325,"slug":7326,"type":16},"Middleware","middleware","2026-07-30T05:26:10.404565",{"slug":4,"name":5,"fn":6,"description":7,"org":7329,"tags":7330,"stars":24,"repoUrl":25,"updatedAt":26},{"slug":9,"name":10,"logoUrl":11,"githubOrg":10},[7331,7332,7333,7334],{"name":21,"slug":22,"type":16},{"name":14,"slug":15,"type":16},{"name":18,"slug":19,"type":16},{"name":10,"slug":9,"type":16},{"slug":7336,"name":7337,"fn":7338,"description":7339,"org":7340,"tags":7341,"stars":24,"repoUrl":25,"updatedAt":7347},"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},[7342,7345,7346],{"name":7343,"slug":7344,"type":16},"API Development","api-development",{"name":18,"slug":19,"type":16},{"name":10,"slug":9,"type":16},"2026-07-16T06:04:10.093367",{"slug":7349,"name":7350,"fn":7351,"description":7352,"org":7353,"tags":7354,"stars":24,"repoUrl":25,"updatedAt":7359},"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},[7355,7356,7357,7358],{"name":7343,"slug":7344,"type":16},{"name":7162,"slug":7163,"type":16},{"name":18,"slug":19,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:26:11.505241",{"slug":7361,"name":7362,"fn":7363,"description":7364,"org":7365,"tags":7366,"stars":24,"repoUrl":25,"updatedAt":7373},"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},[7367,7368,7369,7372],{"name":7323,"slug":30,"type":16},{"name":7162,"slug":7163,"type":16},{"name":7370,"slug":7371,"type":16},"Persistence","persistence",{"name":10,"slug":9,"type":16},"2026-07-30T05:53:35.503176",{"slug":7375,"name":7376,"fn":7377,"description":7378,"org":7379,"tags":7380,"stars":24,"repoUrl":25,"updatedAt":7387},"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},[7381,7382,7383,7386],{"name":7323,"slug":30,"type":16},{"name":7343,"slug":7344,"type":16},{"name":7384,"slug":7385,"type":16},"Backend","backend",{"name":10,"slug":9,"type":16},"2026-07-17T06:06:39.855351"]