[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill-tanstack-ai-coremedia-generation":3,"mdc--bdyse5-key":59,"related-org-tanstack-ai-coremedia-generation":15083,"related-repo-tanstack-ai-coremedia-generation":15227},{"slug":4,"name":5,"fn":6,"description":7,"org":8,"tags":12,"stars":30,"repoUrl":31,"updatedAt":32,"license":33,"forks":34,"topics":35,"repo":54,"sourceUrl":57,"mdContent":58},"ai-coremedia-generation","ai-core\u002Fmedia-generation","generate media and speech with AI","Image, audio, video, speech (TTS), and transcription generation using activity-specific adapters: generateImage() with openaiImage\u002FgeminiImage, generateAudio() with geminiAudio\u002FfalAudio, generateVideo() with async polling (openaiVideo\u002FgeminiVideo\u002FgrokVideo\u002FfalVideo, per-model typed durations), generateSpeech() with openaiSpeech, generateTranscription() with openaiTranscription. React hooks: useGenerateImage, useGenerateAudio, useGenerateSpeech, useTranscription, useGenerateVideo. TanStack Start server function integration with toServerSentEventsResponse.\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,26,27],{"name":14,"slug":15,"type":16},"Images","images","tag",{"name":18,"slug":19,"type":16},"AI SDK","ai-sdk",{"name":21,"slug":22,"type":16},"Audio","audio",{"name":24,"slug":25,"type":16},"Video","video",{"name":10,"slug":9,"type":16},{"name":28,"slug":29,"type":16},"Speech","speech",2884,"https:\u002F\u002Fgithub.com\u002FTanStack\u002Fai","2026-07-16T06:04:17.479185",null,269,[36,37,19,38,39,40,41,42,43,44,45,46,47,48,49,9,50,51,52,53],"ai","ai-agents","anthropic","chatbot","function-calling","gemini","generative-ai","llm","multimodal","openai","react","solidjs","streaming","svelte","tool-calling","typescript","typescript-sdk","vue",{"repoUrl":31,"stars":30,"forks":34,"topics":55,"description":56},[36,37,19,38,39,40,41,42,43,44,45,46,47,48,49,9,50,51,52,53],"🤖 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\u002Fmedia-generation","---\nname: ai-core\u002Fmedia-generation\ndescription: >\n  Image, audio, video, speech (TTS), and transcription generation using\n  activity-specific adapters: generateImage() with openaiImage\u002FgeminiImage,\n  generateAudio() with geminiAudio\u002FfalAudio, generateVideo() with async\n  polling (openaiVideo\u002FgeminiVideo\u002FgrokVideo\u002FfalVideo, per-model typed\n  durations), generateSpeech() with openaiSpeech, generateTranscription()\n  with openaiTranscription. React hooks: useGenerateImage, useGenerateAudio,\n  useGenerateSpeech, useTranscription, useGenerateVideo.\n  TanStack Start server function integration with toServerSentEventsResponse.\ntype: sub-skill\nlibrary: tanstack-ai\nlibrary_version: '0.10.0'\nsources:\n  - 'TanStack\u002Fai:docs\u002Fmedia\u002Fgenerations.md'\n  - 'TanStack\u002Fai:docs\u002Fmedia\u002Fgeneration-hooks.md'\n  - 'TanStack\u002Fai:docs\u002Fmedia\u002Fimage-generation.md'\n  - 'TanStack\u002Fai:docs\u002Fmedia\u002Faudio-generation.md'\n  - 'TanStack\u002Fai:docs\u002Fmedia\u002Fvideo-generation.md'\n  - 'TanStack\u002Fai:docs\u002Fmedia\u002Ftext-to-speech.md'\n  - 'TanStack\u002Fai:docs\u002Fmedia\u002Ftranscription.md'\n  - 'TanStack\u002Fai:docs\u002Fadvanced\u002Fdebug-logging.md'\n---\n\n# Media Generation\n\n> **Dependency note:** This skill builds on ai-core. Read it first for critical rules.\n\nAll media activities (image, speech, transcription, video) follow the same\nserver\u002Fclient architecture: a `generate*()` function on the server, an SSE\ntransport via `toServerSentEventsResponse()`, and a framework hook on the\nclient.\n\n## Setup -- Image Generation End-to-End\n\n### Server (API route or TanStack Start server function)\n\n```typescript\n\u002F\u002F routes\u002Fapi\u002Fgenerate\u002Fimage.ts\nimport { generateImage, toServerSentEventsResponse } from '@tanstack\u002Fai'\nimport { openaiImage } from '@tanstack\u002Fai-openai'\n\nexport async function POST(req: Request) {\n  const { prompt, size, numberOfImages } = await req.json()\n\n  const stream = generateImage({\n    adapter: openaiImage('gpt-image-1'),\n    prompt,\n    size,\n    numberOfImages,\n    stream: true,\n  })\n\n  return toServerSentEventsResponse(stream)\n}\n```\n\n### Client (React)\n\n```tsx\nimport { useGenerateImage, fetchServerSentEvents } from '@tanstack\u002Fai-react'\nimport { useState } from 'react'\n\nfunction ImageGenerator() {\n  const [prompt, setPrompt] = useState('')\n  const { generate, result, isLoading, error, reset } = useGenerateImage({\n    connection: fetchServerSentEvents('\u002Fapi\u002Fgenerate\u002Fimage'),\n  })\n\n  return (\n    \u003Cdiv>\n      \u003Cinput\n        value={prompt}\n        onChange={(e) => setPrompt(e.target.value)}\n        placeholder=\"Describe an image...\"\n      \u002F>\n      \u003Cbutton\n        onClick={() => generate({ prompt })}\n        disabled={isLoading || !prompt.trim()}\n      >\n        {isLoading ? 'Generating...' : 'Generate'}\n      \u003C\u002Fbutton>\n\n      {error && \u003Cp>Error: {error.message}\u003C\u002Fp>}\n\n      {result?.images.map((img, i) => (\n        \u003Cimg\n          key={i}\n          src={img.url || `data:image\u002Fpng;base64,${img.b64Json}`}\n          alt={img.revisedPrompt || 'Generated image'}\n        \u002F>\n      ))}\n\n      {result && \u003Cbutton onClick={reset}>Clear\u003C\u002Fbutton>}\n    \u003C\u002Fdiv>\n  )\n}\n```\n\n### TanStack Start: Server Function Streaming (recommended)\n\nWhen using TanStack Start, return `toServerSentEventsResponse()` from a\nserver function. The client fetcher receives a `Response` and the hook\nparses it as SSE automatically:\n\n```typescript\n\u002F\u002F lib\u002Fserver-functions.ts\nimport { createServerFn } from '@tanstack\u002Freact-start'\nimport { generateImage, toServerSentEventsResponse } from '@tanstack\u002Fai'\nimport { openaiImage } from '@tanstack\u002Fai-openai'\n\nexport const generateImageStreamFn = createServerFn({ method: 'POST' })\n  .inputValidator((data: { prompt: string; model?: string }) => data)\n  .handler(({ data }) => {\n    return toServerSentEventsResponse(\n      generateImage({\n        adapter: openaiImage(data.model ?? 'gpt-image-1'),\n        prompt: data.prompt,\n        stream: true,\n      }),\n    )\n  })\n```\n\n```tsx\nimport { useGenerateImage } from '@tanstack\u002Fai-react'\nimport { generateImageStreamFn } from '..\u002Flib\u002Fserver-functions'\n\nfunction ImageGenerator() {\n  const { generate, result, isLoading } = useGenerateImage({\n    fetcher: (input) => generateImageStreamFn({ data: input }),\n  })\n\n  return (\n    \u003Cbutton\n      onClick={() => generate({ prompt: 'A sunset over mountains' })}\n      disabled={isLoading}\n    >\n      {isLoading ? 'Generating...' : 'Generate'}\n    \u003C\u002Fbutton>\n  )\n}\n```\n\n---\n\n## Core Patterns\n\n### 1. Image Generation\n\nSupported adapters: `openaiImage` (dall-e-2, dall-e-3, gpt-image-1,\ngpt-image-1-mini, gpt-image-2) and `geminiImage` (gemini-3.1-flash-image-preview,\ngemini-3.1-flash-lite-image, imagen-4.0-generate-001, etc.).\n\n```typescript\nimport { generateImage } from '@tanstack\u002Fai'\nimport { openaiImage } from '@tanstack\u002Fai-openai'\nimport { geminiImage } from '@tanstack\u002Fai-gemini'\n\n\u002F\u002F OpenAI with quality\u002Fbackground options\nconst openaiResult = await generateImage({\n  adapter: openaiImage('gpt-image-1'),\n  prompt: 'A cat wearing a hat',\n  size: '1024x1024',\n  numberOfImages: 2,\n  modelOptions: {\n    quality: 'high',\n    background: 'transparent',\n    outputFormat: 'png',\n  },\n})\n\n\u002F\u002F Gemini native model with aspect-ratio sizes\nconst geminiResult = await generateImage({\n  adapter: geminiImage('gemini-3.1-flash-image-preview'),\n  prompt: 'A futuristic cityscape at night',\n  size: '16:9_4K',\n})\n\n\u002F\u002F Gemini Imagen model\nconst imagenResult = await generateImage({\n  adapter: geminiImage('imagen-4.0-generate-001'),\n  prompt: 'A landscape photo',\n  modelOptions: { aspectRatio: '16:9' },\n})\n```\n\nResult shape: `ImageGenerationResult` with `images` array where each entry\nhas `b64Json?`, `url?`, and `revisedPrompt?`. OpenAI image URLs expire\nafter 1 hour -- download or display immediately.\n\n#### Image-conditioned generation: multimodal `prompt` parts\n\nBoth `generateImage()` and `generateVideo()` accept the `prompt` either as\na plain string or as an ordered array of content parts (`TextPart` \u002F\n`ImagePart` \u002F `VideoPart` \u002F `AudioPart` — the same shapes used elsewhere in\nTanStack AI). Part order is meaningful: natively multimodal providers\n(Gemini, OpenRouter) receive parts in order; named-field providers (OpenAI,\nfal, xAI) extract media parts and flatten the text. Prompt text is always\nsent verbatim — to reference inputs from the prompt, write the provider's\nown syntax (fal `@Image1`, OpenAI \"image 1\" prose); the SDK never injects\nor rewrites markers. Each media part may carry an optional\n`metadata.role` hint that adapters use to route the part to the\nprovider-specific field. The accepted part types are narrowed per model at\ncompile time via the adapter's input-modality map.\n\n```typescript\nimport { generateImage } from '@tanstack\u002Fai'\nimport { openaiImage } from '@tanstack\u002Fai-openai'\n\n\u002F\u002F Image-to-image (OpenAI gpt-image-2 \u002F gpt-image-1, dall-e-2)\nawait generateImage({\n  adapter: openaiImage('gpt-image-2'),\n  prompt: [\n    { type: 'text', content: 'Turn this into a cinematic product photo' },\n    { type: 'image', source: { type: 'url', value: 'https:\u002F\u002F…\u002Fproduct.png' } },\n  ],\n})\n\n\u002F\u002F Multi-reference (up to 16 for gpt-image models; up to ~14 for Gemini native\n\u002F\u002F — a provider limit, not enforced by the SDK)\nawait generateImage({\n  adapter: openaiImage('gpt-image-2'),\n  prompt: [\n    { type: 'text', content: 'Apply the second image as style to the first' },\n    { type: 'image', source: { type: 'url', value: 'https:\u002F\u002F…\u002Fproduct.png' } },\n    { type: 'image', source: { type: 'url', value: 'https:\u002F\u002F…\u002Fstyle.png' } },\n  ],\n})\n\n\u002F\u002F Inpaint via metadata.role === 'mask' (OpenAI gpt-image models, dall-e-2; fal mask_url)\nawait generateImage({\n  adapter: openaiImage('gpt-image-2'),\n  prompt: [\n    { type: 'text', content: 'Replace the masked region with a tree' },\n    { type: 'image', source: { type: 'url', value: photoUrl } },\n    {\n      type: 'image',\n      source: { type: 'url', value: maskUrl },\n      metadata: { role: 'mask' },\n    },\n  ],\n})\n\n\u002F\u002F Image-to-video (OpenAI Sora: single input_reference; fal: image_url + optional end_image_url)\nimport { generateVideo } from '@tanstack\u002Fai'\nimport { falVideo } from '@tanstack\u002Fai-fal'\n\nawait generateVideo({\n  adapter: falVideo('fal-ai\u002Fkling-video\u002Fv3\u002Fpro\u002Fimage-to-video'),\n  prompt: [\n    { type: 'image', source: { type: 'url', value: firstFrameUrl } },\n    { type: 'text', content: 'Slow cinematic push-in' },\n    {\n      type: 'image',\n      source: { type: 'url', value: lastFrameUrl },\n      metadata: { role: 'end_frame' },\n    },\n  ],\n})\n```\n\n**URL inputs that require an upload throw by default.** Most adapters pass a\n`type: 'url'` source straight through to the provider. Three paths can't —\nOpenAI `images.edit()`, OpenAI Sora `input_reference`, and Gemini **Veo** —\nbecause the provider only accepts uploaded bytes (Veo also takes a `gs:\u002F\u002F`\nreference). For those, an HTTP(S) URL would have to be downloaded and buffered\nin memory, which can OOM constrained runtimes, so they **throw** on an HTTP(S)\nURL image input by default. Pass a `data:` URI (or `gs:\u002F\u002F` for Veo), or opt in\nwith `allowUrlFetch: true` on the adapter config\n(`createOpenaiImage(model, apiKey, { allowUrlFetch: true })`, and likewise on\n`createOpenaiVideo` \u002F `createGeminiVideo`). `data:` URIs never need the flag.\n\n**Role hints** (`metadata.role`):\n\n| Role            | Maps to                                                                                               |\n| --------------- | ----------------------------------------------------------------------------------------------------- |\n| `'reference'`   | fal `reference_image_urls`; Gemini multimodal part; positional otherwise                              |\n| `'character'`   | Same as `'reference'`; Veo `referenceImages` slot (planned — no Veo adapter yet)                      |\n| `'mask'`        | OpenAI `mask` (gpt-image-2, gpt-image-1, dall-e-2); fal `mask_url`                                    |\n| `'control'`     | fal `control_image_url` (ControlNet \u002F depth \u002F pose)                                                   |\n| `'start_frame'` | fal `start_image_url` (or the endpoint's field, e.g. `image_url` on Kling i2v); Veo `image` (planned) |\n| `'end_frame'`   | fal `end_image_url` (or e.g. `tail_image_url` \u002F `last_frame_url`); Veo `lastFrame` (planned)          |\n\n**Provider support matrix:**\n\n| Provider   | `generateImage` image parts                                                                                                                                                                              | `generateVideo` image parts                                                                                                                                                                        |\n| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| OpenAI     | gpt-image-2 \u002F gpt-image-1 \u002F -mini → `images.edit()` (up to 16). dall-e-2 → edit (1). dall-e-3 throws.                                                                                                    | Sora-2 \u002F -pro → `input_reference` (single). Throws if >1.                                                                                                                                          |\n| Gemini     | Native (gemini-\\*-flash-image, \"nano-banana\") → multimodal `contents`. Imagen throws.                                                                                                                    | No native Veo adapter yet — deferred to a follow-up.                                                                                                                                               |\n| fal        | Per-endpoint field names from a generated map (`pnpm generate:fal-image-fields`). Defaults: 1 input → `image_url`; >1 → `image_urls`; roles → `mask_url` \u002F `control_image_url` \u002F `reference_image_urls`. | Per-endpoint map (e.g. Kling i2v start frame → `image_url`). Defaults: 1 input → `image_url`; `start_frame`\u002F`end_frame` → `start_image_url`\u002F`end_image_url`; `reference` → `reference_image_urls`. |\n| Grok       | grok-imagine models → `\u002Fv1\u002Fimages\u002Fedits` JSON endpoint (≤3 sources, addressed by xAI in request order; prompt sent verbatim; mask\u002Fcontrol throw). grok-2-image-1212 throws.                              | n\u002Fa                                                                                                                                                                                                |\n| OpenRouter | Prompt parts map 1:1 onto multimodal `text` \u002F `image_url` content parts, preserving interleaved order.                                                                                                   | n\u002Fa                                                                                                                                                                                                |\n| Anthropic  | n\u002Fa (no image generation API).                                                                                                                                                                           | n\u002Fa                                                                                                                                                                                                |\n\nVideo and audio prompt parts follow the same `metadata.role` convention\nfor video-to-video and lipsync flows on fal; other providers throw when\nthey're passed.\n\n### 2. Audio Generation (Music, Sound Effects)\n\nDistinct from TTS — `generateAudio()` produces non-speech audio content.\nSupported adapters: `geminiAudio` (Lyria 3 Pro \u002F Lyria 3 Clip) and\n`falAudio` (MiniMax Music, DiffRhythm, Stable Audio, ElevenLabs SFX, etc.).\n\n```typescript\nimport { generateAudio } from '@tanstack\u002Fai'\nimport { falAudio } from '@tanstack\u002Fai-fal'\n\nconst result = await generateAudio({\n  adapter: falAudio('fal-ai\u002Fdiffrhythm'),\n  prompt: 'An upbeat electronic track with synths',\n  duration: 10,\n})\n\n\u002F\u002F result.audio.url or result.audio.b64Json (provider-dependent)\n\u002F\u002F result.audio.contentType e.g. \"audio\u002Fmpeg\"\n```\n\nClient hook:\n\n```tsx\nimport { useGenerateAudio, fetchServerSentEvents } from '@tanstack\u002Fai-react'\n\nconst { generate, result, isLoading } = useGenerateAudio({\n  connection: fetchServerSentEvents('\u002Fapi\u002Fgenerate\u002Faudio'),\n})\n\n\u002F\u002F Trigger: generate({ prompt: 'Upbeat synths', duration: 10 })\n\u002F\u002F Play:    \u003Caudio src={result.audio.url} controls \u002F>\n```\n\n### 3. Text-to-Speech\n\nAdapter: `openaiSpeech` (tts-1, tts-1-hd, gpt-4o-audio-preview).\n\n```typescript\nimport { generateSpeech } from '@tanstack\u002Fai'\nimport { openaiSpeech } from '@tanstack\u002Fai-openai'\n\nconst result = await generateSpeech({\n  adapter: openaiSpeech('tts-1-hd'),\n  text: 'Hello, welcome to TanStack AI!',\n  voice: 'alloy', \u002F\u002F alloy | echo | fable | onyx | nova | shimmer | ash | ballad | coral | sage | verse\n  format: 'mp3', \u002F\u002F mp3 | opus | aac | flac | wav | pcm\n  speed: 1.0, \u002F\u002F 0.25 to 4.0\n})\n\n\u002F\u002F result.audio is base64-encoded audio\n\u002F\u002F result.format is the output format string\n\u002F\u002F result.contentType is the MIME type (e.g. \"audio\u002Fmpeg\")\n```\n\nClient hook:\n\n```tsx\nimport { useGenerateSpeech, fetchServerSentEvents } from '@tanstack\u002Fai-react'\n\nconst { generate, result, isLoading } = useGenerateSpeech({\n  connection: fetchServerSentEvents('\u002Fapi\u002Fgenerate\u002Fspeech'),\n})\n\n\u002F\u002F Trigger: generate({ text: 'Hello!', voice: 'alloy' })\n\u002F\u002F Play:   \u003Caudio src={`data:audio\u002F${result.format};base64,${result.audio}`} controls \u002F>\n```\n\n### 4. Audio Transcription\n\nAdapter: `openaiTranscription` (whisper-1, gpt-4o-transcribe,\ngpt-4o-mini-transcribe, gpt-4o-transcribe-diarize).\n\n> **Capturing audio in the browser:** Use `useAudioRecorder` from `@tanstack\u002Fai-react` to record directly in the browser, then pass the recording as the `audio` input to `generate()`, or use `recording.part` as a prompt part in chat\u002Fgeneration calls. No transcoding or extra dependencies required — the recorder returns the native browser format (`audio\u002Fwebm` or `audio\u002Fmp4`). For transcription, wrap it as a `data:` URL so the provider gets the real content type; passing raw `recording.base64` makes the adapter assume `audio\u002Fmpeg` and mislabel the webm\u002Fmp4 bytes.\n>\n> ```typescript\n> const { isRecording, start, stop } = useAudioRecorder()\n> const { generate } = useTranscription({\n>   connection: fetchServerSentEvents('\u002Fapi\u002Ftranscribe'),\n> })\n> \u002F\u002F ...\n> const recording = await stop()\n> const mimeType = recording.mimeType.split(';')[0] \u002F\u002F strip ;codecs=...\n> await generate({ audio: `data:${mimeType};base64,${recording.base64}` })\n> ```\n\n```typescript\nimport { generateTranscription } from '@tanstack\u002Fai'\nimport { openaiTranscription } from '@tanstack\u002Fai-openai'\n\nconst result = await generateTranscription({\n  adapter: openaiTranscription('whisper-1'),\n  audio: audioFile, \u002F\u002F File, Blob, base64 string, or data URL\n  language: 'en',\n  responseFormat: 'verbose_json',\n  modelOptions: {\n    timestamp_granularities: ['word', 'segment'],\n  },\n})\n\n\u002F\u002F result.text       -- full transcribed text\n\u002F\u002F result.language   -- detected\u002Fspecified language\n\u002F\u002F result.duration   -- audio duration in seconds\n\u002F\u002F result.segments   -- timestamped segments (word-level timestamps are in result.words)\n```\n\nFor speaker diarization, use `openaiTranscription('gpt-4o-transcribe-diarize')`.\nWhen no response format is given it defaults the request to `response_format: 'diarized_json'`\nand `chunking_strategy: 'auto'` (a top-level `responseFormat` of `'json'`\u002F`'text'` opts out of\nspeaker segments); do not pass `prompt`, `include`, or `timestamp_granularities` with this model.\n\nClient hook:\n\n```tsx\nimport { useTranscription, fetchServerSentEvents } from '@tanstack\u002Fai-react'\n\nconst { generate, result, isLoading } = useTranscription({\n  connection: fetchServerSentEvents('\u002Fapi\u002Ftranscribe'),\n})\n\n\u002F\u002F Trigger: generate({ audio: dataUrl, language: 'en' })\n```\n\n### 5. Video Generation (Experimental -- async polling)\n\nVideo generation uses a jobs\u002Fpolling architecture. The server creates a job,\npolls for status, and streams updates to the client.\n\n```typescript\nimport {\n  generateVideo,\n  getVideoJobStatus,\n  toServerSentEventsResponse,\n} from '@tanstack\u002Fai'\nimport { openaiVideo } from '@tanstack\u002Fai-openai'\n\n\u002F\u002F Non-streaming: manual polling loop\nconst { jobId } = await generateVideo({\n  adapter: openaiVideo('sora-2'),\n  prompt: 'A golden retriever playing in sunflowers',\n  size: '1280x720',\n  duration: 8,\n})\n\nlet status = await getVideoJobStatus({ adapter: openaiVideo('sora-2'), jobId })\nwhile (status.status !== 'completed' && status.status !== 'failed') {\n  await new Promise((r) => setTimeout(r, 5000))\n  status = await getVideoJobStatus({ adapter: openaiVideo('sora-2'), jobId })\n}\n\n\u002F\u002F Streaming: server handles polling, client gets real-time updates\nconst stream = generateVideo({\n  adapter: openaiVideo('sora-2'),\n  prompt: 'A flying car over a city',\n  stream: true,\n  pollingInterval: 3000,\n  maxDuration: 600_000,\n})\nreturn toServerSentEventsResponse(stream)\n```\n\nGoogle Veo (`@tanstack\u002Fai-gemini`) uses the same jobs\u002Fpolling flow. Its\n`duration` option is typed per model (`4 | 6 | 8` for the Veo 3.1 models);\nuse `adapter.snapDuration(seconds)` to coerce raw\nseconds and `adapter.availableDurations()` to enumerate the valid set.\nImage prompt parts route by `metadata.role`: first un-roled \u002F\n`'start_frame'` image → input image, `'end_frame'` → `lastFrame`,\n`'reference'` \u002F `'character'` → `referenceImages`:\n\n```typescript\nimport { geminiVideo } from '@tanstack\u002Fai-gemini'\n\nconst adapter = geminiVideo('veo-3.1-generate-preview')\nadapter.availableDurations() \u002F\u002F { kind: 'discrete', values: [4, 6, 8] }\n\nconst { jobId } = await generateVideo({\n  adapter,\n  prompt: 'A golden retriever playing in sunflowers',\n  size: '16:9', \u002F\u002F Veo sizes are aspect ratios: '16:9' | '9:16'\n  duration: adapter.snapDuration(7), \u002F\u002F 6\n  modelOptions: { resolution: '1080p', generateAudio: true },\n})\n\u002F\u002F Note: Veo result URLs require the Google API key to download\n\u002F\u002F (x-goog-api-key header or ?key= query parameter).\n```\n\nGemini Omni Flash (`geminiVideo('gemini-omni-flash-preview')`) is served by\nthe Interactions API instead of Veo's operations flow — same adapter, routed\nby model. Clips are 720p; `duration` is any number of seconds in the 3–10\nrange (fractional ok, default 10 — availableDurations() reports the range),\n`size` is the aspect ratio (`'16:9' | '9:16'`), and the finished video arrives\n**inline** as a `data:video\u002Fmp4;base64,…` URL (no key needed to use it).\nImage\u002Fvideo prompt parts are sent as interaction content blocks, grouped\nas images, then videos, then text (no\n`metadata.role` routing); `data` sources go inline, `url` sources pass\nthrough as-is (never downloaded — use Gemini Files API URIs for remote\nmedia). For conversational editing, pass a prior generation's `jobId` as\n`modelOptions.previous_interaction_id` with a prompt describing the change:\n\n```typescript\nimport { geminiVideo } from '@tanstack\u002Fai-gemini'\n\nconst omni = geminiVideo('gemini-omni-flash-preview')\nconst first = await generateVideo({\n  adapter: omni,\n  prompt: 'A violinist outdoors',\n})\n\u002F\u002F …poll first.jobId to completion, then edit it:\nconst edited = await generateVideo({\n  adapter: omni,\n  prompt: 'Make the violin invisible',\n  modelOptions: { previous_interaction_id: first.jobId },\n})\n```\n\nOther video adapters: `openaiVideo('sora-2')` (pixel sizes like `'1280x720'`,\ndurations 4\u002F8\u002F12s, single `input_reference` image prompt part), `grokVideo(...)`\n(`grok-imagine-video` does text-to-video + image-to-video; `grok-imagine-video-1.5` is\nimage-to-video only — needs an `image` prompt part as the starting frame, text-only throws;\naspect-ratio size template like `'16:9_720p'`, integer durations 1-15s, reports\n`usage.unitsBilled` seconds and exact `usage.cost`), and `falVideo(...)` (hosted models, see cost tracking below).\n\nClient hook with job tracking:\n\n```tsx\nimport { useGenerateVideo, fetchServerSentEvents } from '@tanstack\u002Fai-react'\n\nconst { generate, result, jobId, videoStatus, isLoading } = useGenerateVideo({\n  connection: fetchServerSentEvents('\u002Fapi\u002Fgenerate\u002Fvideo'),\n  onJobCreated: (id) => console.log('Job created:', id),\n  onStatusUpdate: (status) =>\n    console.log(`${status.status} (${status.progress}%)`),\n})\n\n\u002F\u002F videoStatus: { jobId, status, progress?, url?, error?, usage? }\n\u002F\u002F result (on completion): { url }\n```\n\n### 6. Cost tracking (fal billable units)\n\nfal bills media generation by usage-based units, not tokens. Every fal media\nadapter (`falImage`, `falAudio`, `falSpeech`, `falTranscription`, `falVideo`)\nsurfaces the real billed quantity on the result as `usage.unitsBilled`, read\nfrom fal's `x-fal-billable-units` response header — no `fetch` interceptor\nneeded. It rides on the canonical `TokenUsage` shape (token fields are `0` for\nmedia), mirroring how duration-billed transcription surfaces `durationSeconds`.\n\n```typescript\nimport { generateImage } from '@tanstack\u002Fai'\nimport { falImage } from '@tanstack\u002Fai-fal'\n\nconst result = await generateImage({\n  adapter: falImage('fal-ai\u002Fflux\u002Fdev'),\n  prompt: 'a serene mountain lake',\n})\n\n\u002F\u002F usage.unitsBilled is the priced quantity. Multiply by the endpoint unit\n\u002F\u002F price (GET https:\u002F\u002Fapi.fal.ai\u002Fv1\u002Fmodels\u002Fpricing?endpoint_id=…) for exact cost.\nif (result.usage?.unitsBilled != null) {\n  const cost = result.usage.unitsBilled * unitPrice\n}\n```\n\nFor video, the units arrive with the completed result: `getVideoJobStatus()`\nreturns `usage` and emits a `video:usage` devtools event when fal reports it.\n\n---\n\n## Common Hook API\n\nAll generation hooks return the same shape:\n\n| Property    | Type                       | Description                                      |\n| ----------- | -------------------------- | ------------------------------------------------ |\n| `generate`  | `(input) => Promise\u003Cvoid>` | Trigger generation                               |\n| `result`    | `T \\| null`                | Result (optionally transformed via `onResult`)   |\n| `isLoading` | `boolean`                  | Whether generation is in progress                |\n| `error`     | `Error \\| undefined`       | Current error                                    |\n| `status`    | `GenerationClientState`    | `'idle' \\| 'generating' \\| 'success' \\| 'error'` |\n| `stop`      | `() => void`               | Abort current generation                         |\n| `reset`     | `() => void`               | Clear state, return to idle                      |\n\nProvide either `connection` (streaming SSE transport) or `fetcher`\n(direct async call \u002F server function returning `Response`). Use `onResult`\nto transform what is stored:\n\n```tsx\nconst { result } = useGenerateSpeech({\n  connection: fetchServerSentEvents('\u002Fapi\u002Fgenerate\u002Fspeech'),\n  onResult: (raw) => ({\n    audioUrl: `data:${raw.contentType};base64,${raw.audio}`,\n    duration: raw.duration,\n  }),\n})\n\u002F\u002F result is typed as { audioUrl: string; duration?: number } | null\n```\n\n---\n\n## Common Mistakes\n\n### a. HIGH: Using the removed `embedding()` function\n\nThe `embedding()` function and `openaiEmbed` adapter were removed in v0.5.0.\nAgents trained on older code may still generate this pattern.\n\n**Wrong:**\n\n```typescript\nimport { embedding } from '@tanstack\u002Fai'\nimport { openaiEmbed } from '@tanstack\u002Fai-openai'\n\nconst result = await embedding({\n  adapter: openaiEmbed(),\n  model: 'text-embedding-3-small',\n  input: 'Hello, world!',\n})\n```\n\n**Correct -- use the provider SDK directly:**\n\n```typescript\nimport OpenAI from 'openai'\n\nconst openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY })\n\nconst result = await openai.embeddings.create({\n  model: 'text-embedding-3-small',\n  input: 'Hello, world!',\n})\n```\n\n> Source: docs\u002Fmigration\u002Fmigration.md. Note: Fixed in v0.5.0 but agents\n> trained on older code may still generate this pattern.\n\n### b. HIGH: Forgetting `toServerSentEventsResponse` with TanStack Start server functions\n\nWhen using TanStack Start server functions with `stream: true`, you MUST\nwrap the stream with `toServerSentEventsResponse()`. Returning the raw\nstream from a server function will not work.\n\n**Wrong:**\n\n```typescript\nexport const generateImageStreamFn = createServerFn({ method: 'POST' }).handler(\n  ({ data }) => {\n    \u002F\u002F BUG: returning raw stream -- client cannot parse this\n    return generateImage({\n      adapter: openaiImage('gpt-image-1'),\n      prompt: data.prompt,\n      stream: true,\n    })\n  },\n)\n```\n\n**Correct:**\n\n```typescript\nimport { generateImage, toServerSentEventsResponse } from '@tanstack\u002Fai'\nimport { openaiImage } from '@tanstack\u002Fai-openai'\n\nexport const generateImageStreamFn = createServerFn({ method: 'POST' }).handler(\n  ({ data }) => {\n    return toServerSentEventsResponse(\n      generateImage({\n        adapter: openaiImage('gpt-image-1'),\n        prompt: data.prompt,\n        stream: true,\n      }),\n    )\n  },\n)\n```\n\n> Source: maintainer interview.\n\n### c. MEDIUM: Not downloading OpenAI image URLs before they expire\n\nOpenAI image URLs expire after 1 hour. If you store the URL and display it\nlater, the image will silently break. Always download or display the image\nimmediately, or convert to base64 for persistence.\n\n```typescript\nconst result = await generateImage({\n  adapter: openaiImage('dall-e-3'),\n  prompt: 'A mountain landscape',\n})\n\n\u002F\u002F GOOD: download immediately\nfor (const img of result.images) {\n  if (img.url) {\n    const response = await fetch(img.url)\n    const blob = await response.blob()\n    \u002F\u002F Save blob to storage...\n  }\n}\n\n\u002F\u002F GOOD: use b64Json when available (no expiration)\n\u002F\u002F gpt-image-1 returns b64Json by default\n```\n\n> Source: docs\u002Fmedia\u002Fimage-generation.md.\n\n### d. MEDIUM: Using `stream: true` for activities that do not support streaming\n\nNot all generation activities support streaming. Passing `stream: true` to\nan activity that does not support it may hang or produce unexpected results.\nCheck the activity documentation before enabling streaming. All built-in\nactivities (`generateImage`, `generateAudio`, `generateSpeech`,\n`generateTranscription`, `generateVideo`, `summarize`) support `stream: true`,\nbut custom `useGeneration` setups may not.\n\n> Source: docs\u002Fmedia\u002Fgenerations.md.\n\n### e. HIGH: Passing `responseMimeType` or `negativePrompt` to Gemini Lyria\n\nGemini's `GenerateContentConfig` (used by Lyria 3 Pro \u002F Lyria 3 Clip) does\n**not** support `responseMimeType` or `negativePrompt`. Lyria 3 Clip always\nreturns 30-second `audio\u002Fmp3`; Lyria 3 Pro returns `audio\u002Fmp3`. These fields\nare not in `GeminiAudioProviderOptions` — don't reach for them via `as any`.\n\n```typescript\n\u002F\u002F WRONG — both fields are silently ignored or rejected by the SDK\ngenerateAudio({\n  adapter: geminiAudio('lyria-3-pro-preview'),\n  prompt: 'ambient piano',\n  modelOptions: {\n    responseMimeType: 'audio\u002Fwav', \u002F\u002F unsupported\n    negativePrompt: 'vocals', \u002F\u002F unsupported\n  } as any,\n})\n\n\u002F\u002F CORRECT — shape the prompt itself for what you want\ngenerateAudio({\n  adapter: geminiAudio('lyria-3-pro-preview'),\n  prompt: 'ambient piano, no vocals',\n})\n```\n\n> Source: Gemini API `GenerateContentConfig` type; docs\u002Fmedia\u002Faudio-generation.md.\n\n### f. MEDIUM: Passing `duration` to Lyria expecting it to control length\n\nLyria 3 Clip is fixed at 30 seconds — the `duration` option is ignored on\nthat model. Lyria 3 Pro accepts duration via natural-language in the\n**prompt** (\"2-minute ambient track with a 30-second build\"), not via the\n`duration` field. `duration` works for fal audio models (mapped to each\nmodel's native field like `music_length_ms` or `seconds_total`), but not\nfor Lyria.\n\n```typescript\n\u002F\u002F For Lyria: put length guidance in the prompt\ngenerateAudio({\n  adapter: geminiAudio('lyria-3-pro-preview'),\n  prompt: 'A 2-minute ambient piano piece with gentle strings',\n  \u002F\u002F duration: 120  \u002F\u002F ← does nothing; rely on the prompt\n})\n\n\u002F\u002F For fal: duration works and is translated per-model\ngenerateAudio({\n  adapter: falAudio('fal-ai\u002Fminimax-music\u002Fv2'),\n  prompt: 'upbeat synth melody',\n  duration: 60, \u002F\u002F → music_length_ms: 60_000\n})\n```\n\n> Source: Google Lyria 3 docs; docs\u002Fmedia\u002Faudio-generation.md.\n\n### g. MEDIUM: Gemini TTS multi-speaker with 0 or 3+ speakers\n\n`multiSpeakerVoiceConfig.speakerVoiceConfigs` is validated to be length 1 or 2. Passing an empty array or three+ entries throws at the adapter boundary\n(not at Gemini's API) with a clear error. Don't try to work around it with\n`as any`.\n\n```typescript\ngenerateSpeech({\n  adapter: geminiSpeech('gemini-2.5-pro-preview-tts'),\n  text: '[Alice] Hi. [Bob] Hello!',\n  modelOptions: {\n    multiSpeakerVoiceConfig: {\n      speakerVoiceConfigs: [\n        {\n          speaker: 'Alice',\n          voiceConfig: { prebuiltVoiceConfig: { voiceName: 'Kore' } },\n        },\n        {\n          speaker: 'Bob',\n          voiceConfig: { prebuiltVoiceConfig: { voiceName: 'Puck' } },\n        },\n      ],\n    },\n  },\n})\n```\n\n> Source: Gemini TTS adapter validation; CodeRabbit review of PR #463.\n\n### h. HIGH: Passing image prompt parts to a model that doesn't support image-conditioned generation\n\nNot every model accepts image-conditioned prompts. The `prompt` type is\nnarrowed per model, so passing an image part to a text-only model\n(dall-e-3, Imagen, grok-2-image) is a **compile-time error**; adapters\nalso throw a clear runtime error as a backstop, so users learn at call\ntime rather than getting silently wrong output.\n\n```typescript\n\u002F\u002F WRONG — dall-e-3 has no edit\u002Finputs API; image parts are a type error\ngenerateImage({\n  adapter: openaiImage('dall-e-3'),\n  prompt: [\n    { type: 'text', content: 'Edit this' },\n    { type: 'image', source: { type: 'url', value: url } }, \u002F\u002F ❌ type error\n  ],\n})\n\n\u002F\u002F WRONG — Imagen is text-to-image only; same compile-time rejection\ngenerateImage({\n  adapter: geminiImage('imagen-4.0-generate-001'),\n  prompt: [\n    { type: 'text', content: 'Edit this' },\n    { type: 'image', source: { type: 'url', value: url } }, \u002F\u002F ❌ type error\n  ],\n})\n\n\u002F\u002F CORRECT — use a model that supports image-conditioned generation\ngenerateImage({\n  adapter: openaiImage('gpt-image-2'), \u002F\u002F edits up to 16 images\n  prompt: [\n    { type: 'text', content: 'Edit this' },\n    { type: 'image', source: { type: 'url', value: url } },\n  ],\n})\n\ngenerateImage({\n  adapter: geminiImage('gemini-3.1-flash-image-preview'), \u002F\u002F native multimodal\n  prompt: [\n    { type: 'text', content: 'Edit this' },\n    { type: 'image', source: { type: 'url', value: url } },\n  ],\n})\n```\n\n> Source: docs\u002Fmedia\u002Fimage-generation.md, docs\u002Fmedia\u002Fvideo-generation.md.\n\n### i. LOW: Writing a logging middleware to see media chunks flow through\n\nEvery media activity — `generateAudio`, `generateSpeech`,\n`generateTranscription`, `generateImage`, `generateVideo` — accepts the\nsame `debug?: DebugOption` option that `chat()` does. Reach for `debug`\ninstead of wiring up logging middleware.\n\n```typescript\n\u002F\u002F When a speech generation sounds wrong or a transcription returns garbage\ngenerateSpeech({\n  adapter: openaiSpeech('tts-1'),\n  text: 'Hello',\n  debug: { provider: true, output: true }, \u002F\u002F raw SDK chunks + yielded chunks\n})\n```\n\nSee the `ai-core\u002Fdebug-logging` sub-skill for full details on categories\nand piping into a custom logger.\n\n> Source: docs\u002Fadvanced\u002Fdebug-logging.md.\n\n---\n\n## Cross-References\n\n- See also: **ai-core\u002Fadapter-configuration\u002FSKILL.md** -- Each media\n  activity requires a specific activity adapter (e.g., `openaiImage` for\n  images, `openaiSpeech` for speech, `openaiTranscription` for transcription,\n  `openaiVideo` for video). The adapter-configuration skill covers provider\n  setup, API keys, and model selection.\n- See also: **ai-core\u002Fdebug-logging\u002FSKILL.md** -- When a media request\n  returns unexpected output or fails mid-stream, toggle `debug: true` on\n  any `generate*()` call to see request metadata, raw provider chunks, and\n  errors. Covers per-category toggling and piping into pino\u002Fwinston.\n",{"data":60,"body":73},{"name":5,"description":7,"type":61,"library":62,"library_version":63,"sources":64},"sub-skill","tanstack-ai","0.10.0",[65,66,67,68,69,70,71,72],"TanStack\u002Fai:docs\u002Fmedia\u002Fgenerations.md","TanStack\u002Fai:docs\u002Fmedia\u002Fgeneration-hooks.md","TanStack\u002Fai:docs\u002Fmedia\u002Fimage-generation.md","TanStack\u002Fai:docs\u002Fmedia\u002Faudio-generation.md","TanStack\u002Fai:docs\u002Fmedia\u002Fvideo-generation.md","TanStack\u002Fai:docs\u002Fmedia\u002Ftext-to-speech.md","TanStack\u002Fai:docs\u002Fmedia\u002Ftranscription.md","TanStack\u002Fai:docs\u002Fadvanced\u002Fdebug-logging.md",{"type":74,"children":75},"root",[76,85,101,123,130,137,595,601,1679,1685,1705,2197,2626,2630,2636,2642,2663,3389,3433,3447,3522,5123,5232,5248,5472,5480,5761,5773,5779,5808,6049,6054,6239,6245,6258,6580,6584,6767,6773,6785,7216,7583,7657,7661,7834,7840,7845,8664,8752,9116,9204,9525,9616,9621,10008,10014,10099,10420,10448,10451,10457,10462,10676,10711,10961,10964,10970,10983,11003,11011,11220,11228,11466,11474,11488,11508,11515,11758,11766,12103,12111,12117,12122,12458,12466,12479,12547,12555,12576,12639,12960,12975,12988,13035,13290,13298,13304,13321,13698,13706,13712,13731,14737,14745,14751,14811,14975,14988,14996,14999,15005,15077],{"type":77,"tag":78,"props":79,"children":81},"element","h1",{"id":80},"media-generation",[82],{"type":83,"value":84},"text","Media Generation",{"type":77,"tag":86,"props":87,"children":88},"blockquote",{},[89],{"type":77,"tag":90,"props":91,"children":92},"p",{},[93,99],{"type":77,"tag":94,"props":95,"children":96},"strong",{},[97],{"type":83,"value":98},"Dependency note:",{"type":83,"value":100}," This skill builds on ai-core. Read it first for critical rules.",{"type":77,"tag":90,"props":102,"children":103},{},[104,106,113,115,121],{"type":83,"value":105},"All media activities (image, speech, transcription, video) follow the same\nserver\u002Fclient architecture: a ",{"type":77,"tag":107,"props":108,"children":110},"code",{"className":109},[],[111],{"type":83,"value":112},"generate*()",{"type":83,"value":114}," function on the server, an SSE\ntransport via ",{"type":77,"tag":107,"props":116,"children":118},{"className":117},[],[119],{"type":83,"value":120},"toServerSentEventsResponse()",{"type":83,"value":122},", and a framework hook on the\nclient.",{"type":77,"tag":124,"props":125,"children":127},"h2",{"id":126},"setup-image-generation-end-to-end",[128],{"type":83,"value":129},"Setup -- Image Generation End-to-End",{"type":77,"tag":131,"props":132,"children":134},"h3",{"id":133},"server-api-route-or-tanstack-start-server-function",[135],{"type":83,"value":136},"Server (API route or TanStack Start server function)",{"type":77,"tag":138,"props":139,"children":143},"pre",{"className":140,"code":141,"language":51,"meta":142,"style":142},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u002F\u002F routes\u002Fapi\u002Fgenerate\u002Fimage.ts\nimport { generateImage, toServerSentEventsResponse } from '@tanstack\u002Fai'\nimport { openaiImage } from '@tanstack\u002Fai-openai'\n\nexport async function POST(req: Request) {\n  const { prompt, size, numberOfImages } = await req.json()\n\n  const stream = generateImage({\n    adapter: openaiImage('gpt-image-1'),\n    prompt,\n    size,\n    numberOfImages,\n    stream: true,\n  })\n\n  return toServerSentEventsResponse(stream)\n}\n","",[144],{"type":77,"tag":107,"props":145,"children":146},{"__ignoreMap":142},[147,159,217,255,265,323,394,402,432,476,489,502,515,538,552,560,586],{"type":77,"tag":148,"props":149,"children":152},"span",{"class":150,"line":151},"line",1,[153],{"type":77,"tag":148,"props":154,"children":156},{"style":155},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic",[157],{"type":83,"value":158},"\u002F\u002F routes\u002Fapi\u002Fgenerate\u002Fimage.ts\n",{"type":77,"tag":148,"props":160,"children":162},{"class":150,"line":161},2,[163,169,175,181,186,191,196,201,206,212],{"type":77,"tag":148,"props":164,"children":166},{"style":165},"--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic",[167],{"type":83,"value":168},"import",{"type":77,"tag":148,"props":170,"children":172},{"style":171},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[173],{"type":83,"value":174}," {",{"type":77,"tag":148,"props":176,"children":178},{"style":177},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[179],{"type":83,"value":180}," generateImage",{"type":77,"tag":148,"props":182,"children":183},{"style":171},[184],{"type":83,"value":185},",",{"type":77,"tag":148,"props":187,"children":188},{"style":177},[189],{"type":83,"value":190}," toServerSentEventsResponse",{"type":77,"tag":148,"props":192,"children":193},{"style":171},[194],{"type":83,"value":195}," }",{"type":77,"tag":148,"props":197,"children":198},{"style":165},[199],{"type":83,"value":200}," from",{"type":77,"tag":148,"props":202,"children":203},{"style":171},[204],{"type":83,"value":205}," '",{"type":77,"tag":148,"props":207,"children":209},{"style":208},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[210],{"type":83,"value":211},"@tanstack\u002Fai",{"type":77,"tag":148,"props":213,"children":214},{"style":171},[215],{"type":83,"value":216},"'\n",{"type":77,"tag":148,"props":218,"children":220},{"class":150,"line":219},3,[221,225,229,234,238,242,246,251],{"type":77,"tag":148,"props":222,"children":223},{"style":165},[224],{"type":83,"value":168},{"type":77,"tag":148,"props":226,"children":227},{"style":171},[228],{"type":83,"value":174},{"type":77,"tag":148,"props":230,"children":231},{"style":177},[232],{"type":83,"value":233}," openaiImage",{"type":77,"tag":148,"props":235,"children":236},{"style":171},[237],{"type":83,"value":195},{"type":77,"tag":148,"props":239,"children":240},{"style":165},[241],{"type":83,"value":200},{"type":77,"tag":148,"props":243,"children":244},{"style":171},[245],{"type":83,"value":205},{"type":77,"tag":148,"props":247,"children":248},{"style":208},[249],{"type":83,"value":250},"@tanstack\u002Fai-openai",{"type":77,"tag":148,"props":252,"children":253},{"style":171},[254],{"type":83,"value":216},{"type":77,"tag":148,"props":256,"children":258},{"class":150,"line":257},4,[259],{"type":77,"tag":148,"props":260,"children":262},{"emptyLinePlaceholder":261},true,[263],{"type":83,"value":264},"\n",{"type":77,"tag":148,"props":266,"children":268},{"class":150,"line":267},5,[269,274,280,285,291,296,302,307,313,318],{"type":77,"tag":148,"props":270,"children":271},{"style":165},[272],{"type":83,"value":273},"export",{"type":77,"tag":148,"props":275,"children":277},{"style":276},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[278],{"type":83,"value":279}," async",{"type":77,"tag":148,"props":281,"children":282},{"style":276},[283],{"type":83,"value":284}," function",{"type":77,"tag":148,"props":286,"children":288},{"style":287},"--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF",[289],{"type":83,"value":290}," POST",{"type":77,"tag":148,"props":292,"children":293},{"style":171},[294],{"type":83,"value":295},"(",{"type":77,"tag":148,"props":297,"children":299},{"style":298},"--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic",[300],{"type":83,"value":301},"req",{"type":77,"tag":148,"props":303,"children":304},{"style":171},[305],{"type":83,"value":306},":",{"type":77,"tag":148,"props":308,"children":310},{"style":309},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[311],{"type":83,"value":312}," Request",{"type":77,"tag":148,"props":314,"children":315},{"style":171},[316],{"type":83,"value":317},")",{"type":77,"tag":148,"props":319,"children":320},{"style":171},[321],{"type":83,"value":322}," {\n",{"type":77,"tag":148,"props":324,"children":326},{"class":150,"line":325},6,[327,332,336,341,345,350,354,359,363,368,373,378,383,388],{"type":77,"tag":148,"props":328,"children":329},{"style":276},[330],{"type":83,"value":331},"  const",{"type":77,"tag":148,"props":333,"children":334},{"style":171},[335],{"type":83,"value":174},{"type":77,"tag":148,"props":337,"children":338},{"style":177},[339],{"type":83,"value":340}," prompt",{"type":77,"tag":148,"props":342,"children":343},{"style":171},[344],{"type":83,"value":185},{"type":77,"tag":148,"props":346,"children":347},{"style":177},[348],{"type":83,"value":349}," size",{"type":77,"tag":148,"props":351,"children":352},{"style":171},[353],{"type":83,"value":185},{"type":77,"tag":148,"props":355,"children":356},{"style":177},[357],{"type":83,"value":358}," numberOfImages",{"type":77,"tag":148,"props":360,"children":361},{"style":171},[362],{"type":83,"value":195},{"type":77,"tag":148,"props":364,"children":365},{"style":171},[366],{"type":83,"value":367}," =",{"type":77,"tag":148,"props":369,"children":370},{"style":165},[371],{"type":83,"value":372}," await",{"type":77,"tag":148,"props":374,"children":375},{"style":177},[376],{"type":83,"value":377}," req",{"type":77,"tag":148,"props":379,"children":380},{"style":171},[381],{"type":83,"value":382},".",{"type":77,"tag":148,"props":384,"children":385},{"style":287},[386],{"type":83,"value":387},"json",{"type":77,"tag":148,"props":389,"children":391},{"style":390},"--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178",[392],{"type":83,"value":393},"()\n",{"type":77,"tag":148,"props":395,"children":397},{"class":150,"line":396},7,[398],{"type":77,"tag":148,"props":399,"children":400},{"emptyLinePlaceholder":261},[401],{"type":83,"value":264},{"type":77,"tag":148,"props":403,"children":405},{"class":150,"line":404},8,[406,410,415,419,423,427],{"type":77,"tag":148,"props":407,"children":408},{"style":276},[409],{"type":83,"value":331},{"type":77,"tag":148,"props":411,"children":412},{"style":177},[413],{"type":83,"value":414}," stream",{"type":77,"tag":148,"props":416,"children":417},{"style":171},[418],{"type":83,"value":367},{"type":77,"tag":148,"props":420,"children":421},{"style":287},[422],{"type":83,"value":180},{"type":77,"tag":148,"props":424,"children":425},{"style":390},[426],{"type":83,"value":295},{"type":77,"tag":148,"props":428,"children":429},{"style":171},[430],{"type":83,"value":431},"{\n",{"type":77,"tag":148,"props":433,"children":435},{"class":150,"line":434},9,[436,441,445,449,453,458,463,467,471],{"type":77,"tag":148,"props":437,"children":438},{"style":390},[439],{"type":83,"value":440},"    adapter",{"type":77,"tag":148,"props":442,"children":443},{"style":171},[444],{"type":83,"value":306},{"type":77,"tag":148,"props":446,"children":447},{"style":287},[448],{"type":83,"value":233},{"type":77,"tag":148,"props":450,"children":451},{"style":390},[452],{"type":83,"value":295},{"type":77,"tag":148,"props":454,"children":455},{"style":171},[456],{"type":83,"value":457},"'",{"type":77,"tag":148,"props":459,"children":460},{"style":208},[461],{"type":83,"value":462},"gpt-image-1",{"type":77,"tag":148,"props":464,"children":465},{"style":171},[466],{"type":83,"value":457},{"type":77,"tag":148,"props":468,"children":469},{"style":390},[470],{"type":83,"value":317},{"type":77,"tag":148,"props":472,"children":473},{"style":171},[474],{"type":83,"value":475},",\n",{"type":77,"tag":148,"props":477,"children":479},{"class":150,"line":478},10,[480,485],{"type":77,"tag":148,"props":481,"children":482},{"style":177},[483],{"type":83,"value":484},"    prompt",{"type":77,"tag":148,"props":486,"children":487},{"style":171},[488],{"type":83,"value":475},{"type":77,"tag":148,"props":490,"children":492},{"class":150,"line":491},11,[493,498],{"type":77,"tag":148,"props":494,"children":495},{"style":177},[496],{"type":83,"value":497},"    size",{"type":77,"tag":148,"props":499,"children":500},{"style":171},[501],{"type":83,"value":475},{"type":77,"tag":148,"props":503,"children":505},{"class":150,"line":504},12,[506,511],{"type":77,"tag":148,"props":507,"children":508},{"style":177},[509],{"type":83,"value":510},"    numberOfImages",{"type":77,"tag":148,"props":512,"children":513},{"style":171},[514],{"type":83,"value":475},{"type":77,"tag":148,"props":516,"children":518},{"class":150,"line":517},13,[519,524,528,534],{"type":77,"tag":148,"props":520,"children":521},{"style":390},[522],{"type":83,"value":523},"    stream",{"type":77,"tag":148,"props":525,"children":526},{"style":171},[527],{"type":83,"value":306},{"type":77,"tag":148,"props":529,"children":531},{"style":530},"--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC",[532],{"type":83,"value":533}," true",{"type":77,"tag":148,"props":535,"children":536},{"style":171},[537],{"type":83,"value":475},{"type":77,"tag":148,"props":539,"children":541},{"class":150,"line":540},14,[542,547],{"type":77,"tag":148,"props":543,"children":544},{"style":171},[545],{"type":83,"value":546},"  }",{"type":77,"tag":148,"props":548,"children":549},{"style":390},[550],{"type":83,"value":551},")\n",{"type":77,"tag":148,"props":553,"children":555},{"class":150,"line":554},15,[556],{"type":77,"tag":148,"props":557,"children":558},{"emptyLinePlaceholder":261},[559],{"type":83,"value":264},{"type":77,"tag":148,"props":561,"children":563},{"class":150,"line":562},16,[564,569,573,577,582],{"type":77,"tag":148,"props":565,"children":566},{"style":165},[567],{"type":83,"value":568},"  return",{"type":77,"tag":148,"props":570,"children":571},{"style":287},[572],{"type":83,"value":190},{"type":77,"tag":148,"props":574,"children":575},{"style":390},[576],{"type":83,"value":295},{"type":77,"tag":148,"props":578,"children":579},{"style":177},[580],{"type":83,"value":581},"stream",{"type":77,"tag":148,"props":583,"children":584},{"style":390},[585],{"type":83,"value":551},{"type":77,"tag":148,"props":587,"children":589},{"class":150,"line":588},17,[590],{"type":77,"tag":148,"props":591,"children":592},{"style":171},[593],{"type":83,"value":594},"}\n",{"type":77,"tag":131,"props":596,"children":598},{"id":597},"client-react",[599],{"type":83,"value":600},"Client (React)",{"type":77,"tag":138,"props":602,"children":606},{"className":603,"code":604,"language":605,"meta":142,"style":142},"language-tsx shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { useGenerateImage, fetchServerSentEvents } from '@tanstack\u002Fai-react'\nimport { useState } from 'react'\n\nfunction ImageGenerator() {\n  const [prompt, setPrompt] = useState('')\n  const { generate, result, isLoading, error, reset } = useGenerateImage({\n    connection: fetchServerSentEvents('\u002Fapi\u002Fgenerate\u002Fimage'),\n  })\n\n  return (\n    \u003Cdiv>\n      \u003Cinput\n        value={prompt}\n        onChange={(e) => setPrompt(e.target.value)}\n        placeholder=\"Describe an image...\"\n      \u002F>\n      \u003Cbutton\n        onClick={() => generate({ prompt })}\n        disabled={isLoading || !prompt.trim()}\n      >\n        {isLoading ? 'Generating...' : 'Generate'}\n      \u003C\u002Fbutton>\n\n      {error && \u003Cp>Error: {error.message}\u003C\u002Fp>}\n\n      {result?.images.map((img, i) => (\n        \u003Cimg\n          key={i}\n          src={img.url || `data:image\u002Fpng;base64,${img.b64Json}`}\n          alt={img.revisedPrompt || 'Generated image'}\n        \u002F>\n      ))}\n\n      {result && \u003Cbutton onClick={reset}>Clear\u003C\u002Fbutton>}\n    \u003C\u002Fdiv>\n  )\n}\n","tsx",[607],{"type":77,"tag":107,"props":608,"children":609},{"__ignoreMap":142},[610,656,692,699,721,773,845,886,897,904,916,934,947,968,1026,1054,1062,1074,1123,1172,1181,1234,1252,1260,1330,1338,1403,1417,1439,1506,1553,1562,1575,1583,1645,1662,1671],{"type":77,"tag":148,"props":611,"children":612},{"class":150,"line":151},[613,617,621,626,630,635,639,643,647,652],{"type":77,"tag":148,"props":614,"children":615},{"style":165},[616],{"type":83,"value":168},{"type":77,"tag":148,"props":618,"children":619},{"style":171},[620],{"type":83,"value":174},{"type":77,"tag":148,"props":622,"children":623},{"style":177},[624],{"type":83,"value":625}," useGenerateImage",{"type":77,"tag":148,"props":627,"children":628},{"style":171},[629],{"type":83,"value":185},{"type":77,"tag":148,"props":631,"children":632},{"style":177},[633],{"type":83,"value":634}," fetchServerSentEvents",{"type":77,"tag":148,"props":636,"children":637},{"style":171},[638],{"type":83,"value":195},{"type":77,"tag":148,"props":640,"children":641},{"style":165},[642],{"type":83,"value":200},{"type":77,"tag":148,"props":644,"children":645},{"style":171},[646],{"type":83,"value":205},{"type":77,"tag":148,"props":648,"children":649},{"style":208},[650],{"type":83,"value":651},"@tanstack\u002Fai-react",{"type":77,"tag":148,"props":653,"children":654},{"style":171},[655],{"type":83,"value":216},{"type":77,"tag":148,"props":657,"children":658},{"class":150,"line":161},[659,663,667,672,676,680,684,688],{"type":77,"tag":148,"props":660,"children":661},{"style":165},[662],{"type":83,"value":168},{"type":77,"tag":148,"props":664,"children":665},{"style":171},[666],{"type":83,"value":174},{"type":77,"tag":148,"props":668,"children":669},{"style":177},[670],{"type":83,"value":671}," useState",{"type":77,"tag":148,"props":673,"children":674},{"style":171},[675],{"type":83,"value":195},{"type":77,"tag":148,"props":677,"children":678},{"style":165},[679],{"type":83,"value":200},{"type":77,"tag":148,"props":681,"children":682},{"style":171},[683],{"type":83,"value":205},{"type":77,"tag":148,"props":685,"children":686},{"style":208},[687],{"type":83,"value":46},{"type":77,"tag":148,"props":689,"children":690},{"style":171},[691],{"type":83,"value":216},{"type":77,"tag":148,"props":693,"children":694},{"class":150,"line":219},[695],{"type":77,"tag":148,"props":696,"children":697},{"emptyLinePlaceholder":261},[698],{"type":83,"value":264},{"type":77,"tag":148,"props":700,"children":701},{"class":150,"line":257},[702,707,712,717],{"type":77,"tag":148,"props":703,"children":704},{"style":276},[705],{"type":83,"value":706},"function",{"type":77,"tag":148,"props":708,"children":709},{"style":287},[710],{"type":83,"value":711}," ImageGenerator",{"type":77,"tag":148,"props":713,"children":714},{"style":171},[715],{"type":83,"value":716},"()",{"type":77,"tag":148,"props":718,"children":719},{"style":171},[720],{"type":83,"value":322},{"type":77,"tag":148,"props":722,"children":723},{"class":150,"line":267},[724,728,733,738,742,747,752,756,760,764,769],{"type":77,"tag":148,"props":725,"children":726},{"style":276},[727],{"type":83,"value":331},{"type":77,"tag":148,"props":729,"children":730},{"style":171},[731],{"type":83,"value":732}," [",{"type":77,"tag":148,"props":734,"children":735},{"style":177},[736],{"type":83,"value":737},"prompt",{"type":77,"tag":148,"props":739,"children":740},{"style":171},[741],{"type":83,"value":185},{"type":77,"tag":148,"props":743,"children":744},{"style":177},[745],{"type":83,"value":746}," setPrompt",{"type":77,"tag":148,"props":748,"children":749},{"style":171},[750],{"type":83,"value":751},"]",{"type":77,"tag":148,"props":753,"children":754},{"style":171},[755],{"type":83,"value":367},{"type":77,"tag":148,"props":757,"children":758},{"style":287},[759],{"type":83,"value":671},{"type":77,"tag":148,"props":761,"children":762},{"style":390},[763],{"type":83,"value":295},{"type":77,"tag":148,"props":765,"children":766},{"style":171},[767],{"type":83,"value":768},"''",{"type":77,"tag":148,"props":770,"children":771},{"style":390},[772],{"type":83,"value":551},{"type":77,"tag":148,"props":774,"children":775},{"class":150,"line":325},[776,780,784,789,793,798,802,807,811,816,820,825,829,833,837,841],{"type":77,"tag":148,"props":777,"children":778},{"style":276},[779],{"type":83,"value":331},{"type":77,"tag":148,"props":781,"children":782},{"style":171},[783],{"type":83,"value":174},{"type":77,"tag":148,"props":785,"children":786},{"style":177},[787],{"type":83,"value":788}," generate",{"type":77,"tag":148,"props":790,"children":791},{"style":171},[792],{"type":83,"value":185},{"type":77,"tag":148,"props":794,"children":795},{"style":177},[796],{"type":83,"value":797}," result",{"type":77,"tag":148,"props":799,"children":800},{"style":171},[801],{"type":83,"value":185},{"type":77,"tag":148,"props":803,"children":804},{"style":177},[805],{"type":83,"value":806}," isLoading",{"type":77,"tag":148,"props":808,"children":809},{"style":171},[810],{"type":83,"value":185},{"type":77,"tag":148,"props":812,"children":813},{"style":177},[814],{"type":83,"value":815}," error",{"type":77,"tag":148,"props":817,"children":818},{"style":171},[819],{"type":83,"value":185},{"type":77,"tag":148,"props":821,"children":822},{"style":177},[823],{"type":83,"value":824}," reset",{"type":77,"tag":148,"props":826,"children":827},{"style":171},[828],{"type":83,"value":195},{"type":77,"tag":148,"props":830,"children":831},{"style":171},[832],{"type":83,"value":367},{"type":77,"tag":148,"props":834,"children":835},{"style":287},[836],{"type":83,"value":625},{"type":77,"tag":148,"props":838,"children":839},{"style":390},[840],{"type":83,"value":295},{"type":77,"tag":148,"props":842,"children":843},{"style":171},[844],{"type":83,"value":431},{"type":77,"tag":148,"props":846,"children":847},{"class":150,"line":396},[848,853,857,861,865,869,874,878,882],{"type":77,"tag":148,"props":849,"children":850},{"style":390},[851],{"type":83,"value":852},"    connection",{"type":77,"tag":148,"props":854,"children":855},{"style":171},[856],{"type":83,"value":306},{"type":77,"tag":148,"props":858,"children":859},{"style":287},[860],{"type":83,"value":634},{"type":77,"tag":148,"props":862,"children":863},{"style":390},[864],{"type":83,"value":295},{"type":77,"tag":148,"props":866,"children":867},{"style":171},[868],{"type":83,"value":457},{"type":77,"tag":148,"props":870,"children":871},{"style":208},[872],{"type":83,"value":873},"\u002Fapi\u002Fgenerate\u002Fimage",{"type":77,"tag":148,"props":875,"children":876},{"style":171},[877],{"type":83,"value":457},{"type":77,"tag":148,"props":879,"children":880},{"style":390},[881],{"type":83,"value":317},{"type":77,"tag":148,"props":883,"children":884},{"style":171},[885],{"type":83,"value":475},{"type":77,"tag":148,"props":887,"children":888},{"class":150,"line":404},[889,893],{"type":77,"tag":148,"props":890,"children":891},{"style":171},[892],{"type":83,"value":546},{"type":77,"tag":148,"props":894,"children":895},{"style":390},[896],{"type":83,"value":551},{"type":77,"tag":148,"props":898,"children":899},{"class":150,"line":434},[900],{"type":77,"tag":148,"props":901,"children":902},{"emptyLinePlaceholder":261},[903],{"type":83,"value":264},{"type":77,"tag":148,"props":905,"children":906},{"class":150,"line":478},[907,911],{"type":77,"tag":148,"props":908,"children":909},{"style":165},[910],{"type":83,"value":568},{"type":77,"tag":148,"props":912,"children":913},{"style":390},[914],{"type":83,"value":915}," (\n",{"type":77,"tag":148,"props":917,"children":918},{"class":150,"line":491},[919,924,929],{"type":77,"tag":148,"props":920,"children":921},{"style":171},[922],{"type":83,"value":923},"    \u003C",{"type":77,"tag":148,"props":925,"children":926},{"style":390},[927],{"type":83,"value":928},"div",{"type":77,"tag":148,"props":930,"children":931},{"style":171},[932],{"type":83,"value":933},">\n",{"type":77,"tag":148,"props":935,"children":936},{"class":150,"line":504},[937,942],{"type":77,"tag":148,"props":938,"children":939},{"style":171},[940],{"type":83,"value":941},"      \u003C",{"type":77,"tag":148,"props":943,"children":944},{"style":390},[945],{"type":83,"value":946},"input\n",{"type":77,"tag":148,"props":948,"children":949},{"class":150,"line":517},[950,955,960,964],{"type":77,"tag":148,"props":951,"children":952},{"style":276},[953],{"type":83,"value":954},"        value",{"type":77,"tag":148,"props":956,"children":957},{"style":171},[958],{"type":83,"value":959},"={",{"type":77,"tag":148,"props":961,"children":962},{"style":177},[963],{"type":83,"value":737},{"type":77,"tag":148,"props":965,"children":966},{"style":171},[967],{"type":83,"value":594},{"type":77,"tag":148,"props":969,"children":970},{"class":150,"line":540},[971,976,981,986,990,995,999,1004,1008,1013,1017,1022],{"type":77,"tag":148,"props":972,"children":973},{"style":276},[974],{"type":83,"value":975},"        onChange",{"type":77,"tag":148,"props":977,"children":978},{"style":171},[979],{"type":83,"value":980},"={(",{"type":77,"tag":148,"props":982,"children":983},{"style":298},[984],{"type":83,"value":985},"e",{"type":77,"tag":148,"props":987,"children":988},{"style":171},[989],{"type":83,"value":317},{"type":77,"tag":148,"props":991,"children":992},{"style":276},[993],{"type":83,"value":994}," =>",{"type":77,"tag":148,"props":996,"children":997},{"style":287},[998],{"type":83,"value":746},{"type":77,"tag":148,"props":1000,"children":1001},{"style":177},[1002],{"type":83,"value":1003},"(e",{"type":77,"tag":148,"props":1005,"children":1006},{"style":171},[1007],{"type":83,"value":382},{"type":77,"tag":148,"props":1009,"children":1010},{"style":177},[1011],{"type":83,"value":1012},"target",{"type":77,"tag":148,"props":1014,"children":1015},{"style":171},[1016],{"type":83,"value":382},{"type":77,"tag":148,"props":1018,"children":1019},{"style":177},[1020],{"type":83,"value":1021},"value)",{"type":77,"tag":148,"props":1023,"children":1024},{"style":171},[1025],{"type":83,"value":594},{"type":77,"tag":148,"props":1027,"children":1028},{"class":150,"line":554},[1029,1034,1039,1044,1049],{"type":77,"tag":148,"props":1030,"children":1031},{"style":276},[1032],{"type":83,"value":1033},"        placeholder",{"type":77,"tag":148,"props":1035,"children":1036},{"style":171},[1037],{"type":83,"value":1038},"=",{"type":77,"tag":148,"props":1040,"children":1041},{"style":171},[1042],{"type":83,"value":1043},"\"",{"type":77,"tag":148,"props":1045,"children":1046},{"style":208},[1047],{"type":83,"value":1048},"Describe an image...",{"type":77,"tag":148,"props":1050,"children":1051},{"style":171},[1052],{"type":83,"value":1053},"\"\n",{"type":77,"tag":148,"props":1055,"children":1056},{"class":150,"line":562},[1057],{"type":77,"tag":148,"props":1058,"children":1059},{"style":171},[1060],{"type":83,"value":1061},"      \u002F>\n",{"type":77,"tag":148,"props":1063,"children":1064},{"class":150,"line":588},[1065,1069],{"type":77,"tag":148,"props":1066,"children":1067},{"style":171},[1068],{"type":83,"value":941},{"type":77,"tag":148,"props":1070,"children":1071},{"style":390},[1072],{"type":83,"value":1073},"button\n",{"type":77,"tag":148,"props":1075,"children":1077},{"class":150,"line":1076},18,[1078,1083,1088,1092,1096,1100,1105,1110,1115,1119],{"type":77,"tag":148,"props":1079,"children":1080},{"style":276},[1081],{"type":83,"value":1082},"        onClick",{"type":77,"tag":148,"props":1084,"children":1085},{"style":171},[1086],{"type":83,"value":1087},"={()",{"type":77,"tag":148,"props":1089,"children":1090},{"style":276},[1091],{"type":83,"value":994},{"type":77,"tag":148,"props":1093,"children":1094},{"style":287},[1095],{"type":83,"value":788},{"type":77,"tag":148,"props":1097,"children":1098},{"style":177},[1099],{"type":83,"value":295},{"type":77,"tag":148,"props":1101,"children":1102},{"style":171},[1103],{"type":83,"value":1104},"{",{"type":77,"tag":148,"props":1106,"children":1107},{"style":177},[1108],{"type":83,"value":1109}," prompt ",{"type":77,"tag":148,"props":1111,"children":1112},{"style":171},[1113],{"type":83,"value":1114},"}",{"type":77,"tag":148,"props":1116,"children":1117},{"style":177},[1118],{"type":83,"value":317},{"type":77,"tag":148,"props":1120,"children":1121},{"style":171},[1122],{"type":83,"value":594},{"type":77,"tag":148,"props":1124,"children":1126},{"class":150,"line":1125},19,[1127,1132,1136,1141,1146,1151,1155,1159,1164,1168],{"type":77,"tag":148,"props":1128,"children":1129},{"style":276},[1130],{"type":83,"value":1131},"        disabled",{"type":77,"tag":148,"props":1133,"children":1134},{"style":171},[1135],{"type":83,"value":959},{"type":77,"tag":148,"props":1137,"children":1138},{"style":177},[1139],{"type":83,"value":1140},"isLoading ",{"type":77,"tag":148,"props":1142,"children":1143},{"style":171},[1144],{"type":83,"value":1145},"||",{"type":77,"tag":148,"props":1147,"children":1148},{"style":171},[1149],{"type":83,"value":1150}," !",{"type":77,"tag":148,"props":1152,"children":1153},{"style":177},[1154],{"type":83,"value":737},{"type":77,"tag":148,"props":1156,"children":1157},{"style":171},[1158],{"type":83,"value":382},{"type":77,"tag":148,"props":1160,"children":1161},{"style":287},[1162],{"type":83,"value":1163},"trim",{"type":77,"tag":148,"props":1165,"children":1166},{"style":177},[1167],{"type":83,"value":716},{"type":77,"tag":148,"props":1169,"children":1170},{"style":171},[1171],{"type":83,"value":594},{"type":77,"tag":148,"props":1173,"children":1175},{"class":150,"line":1174},20,[1176],{"type":77,"tag":148,"props":1177,"children":1178},{"style":171},[1179],{"type":83,"value":1180},"      >\n",{"type":77,"tag":148,"props":1182,"children":1184},{"class":150,"line":1183},21,[1185,1190,1194,1199,1203,1208,1212,1217,1221,1226,1230],{"type":77,"tag":148,"props":1186,"children":1187},{"style":171},[1188],{"type":83,"value":1189},"        {",{"type":77,"tag":148,"props":1191,"children":1192},{"style":177},[1193],{"type":83,"value":1140},{"type":77,"tag":148,"props":1195,"children":1196},{"style":171},[1197],{"type":83,"value":1198},"?",{"type":77,"tag":148,"props":1200,"children":1201},{"style":171},[1202],{"type":83,"value":205},{"type":77,"tag":148,"props":1204,"children":1205},{"style":208},[1206],{"type":83,"value":1207},"Generating...",{"type":77,"tag":148,"props":1209,"children":1210},{"style":171},[1211],{"type":83,"value":457},{"type":77,"tag":148,"props":1213,"children":1214},{"style":171},[1215],{"type":83,"value":1216}," :",{"type":77,"tag":148,"props":1218,"children":1219},{"style":171},[1220],{"type":83,"value":205},{"type":77,"tag":148,"props":1222,"children":1223},{"style":208},[1224],{"type":83,"value":1225},"Generate",{"type":77,"tag":148,"props":1227,"children":1228},{"style":171},[1229],{"type":83,"value":457},{"type":77,"tag":148,"props":1231,"children":1232},{"style":171},[1233],{"type":83,"value":594},{"type":77,"tag":148,"props":1235,"children":1237},{"class":150,"line":1236},22,[1238,1243,1248],{"type":77,"tag":148,"props":1239,"children":1240},{"style":171},[1241],{"type":83,"value":1242},"      \u003C\u002F",{"type":77,"tag":148,"props":1244,"children":1245},{"style":390},[1246],{"type":83,"value":1247},"button",{"type":77,"tag":148,"props":1249,"children":1250},{"style":171},[1251],{"type":83,"value":933},{"type":77,"tag":148,"props":1253,"children":1255},{"class":150,"line":1254},23,[1256],{"type":77,"tag":148,"props":1257,"children":1258},{"emptyLinePlaceholder":261},[1259],{"type":83,"value":264},{"type":77,"tag":148,"props":1261,"children":1263},{"class":150,"line":1262},24,[1264,1269,1274,1279,1284,1288,1293,1298,1302,1307,1311,1316,1321,1325],{"type":77,"tag":148,"props":1265,"children":1266},{"style":171},[1267],{"type":83,"value":1268},"      {",{"type":77,"tag":148,"props":1270,"children":1271},{"style":177},[1272],{"type":83,"value":1273},"error ",{"type":77,"tag":148,"props":1275,"children":1276},{"style":171},[1277],{"type":83,"value":1278},"&&",{"type":77,"tag":148,"props":1280,"children":1281},{"style":171},[1282],{"type":83,"value":1283}," \u003C",{"type":77,"tag":148,"props":1285,"children":1286},{"style":390},[1287],{"type":83,"value":90},{"type":77,"tag":148,"props":1289,"children":1290},{"style":171},[1291],{"type":83,"value":1292},">",{"type":77,"tag":148,"props":1294,"children":1295},{"style":177},[1296],{"type":83,"value":1297},"Error: ",{"type":77,"tag":148,"props":1299,"children":1300},{"style":171},[1301],{"type":83,"value":1104},{"type":77,"tag":148,"props":1303,"children":1304},{"style":177},[1305],{"type":83,"value":1306},"error",{"type":77,"tag":148,"props":1308,"children":1309},{"style":171},[1310],{"type":83,"value":382},{"type":77,"tag":148,"props":1312,"children":1313},{"style":177},[1314],{"type":83,"value":1315},"message",{"type":77,"tag":148,"props":1317,"children":1318},{"style":171},[1319],{"type":83,"value":1320},"}\u003C\u002F",{"type":77,"tag":148,"props":1322,"children":1323},{"style":390},[1324],{"type":83,"value":90},{"type":77,"tag":148,"props":1326,"children":1327},{"style":171},[1328],{"type":83,"value":1329},">}\n",{"type":77,"tag":148,"props":1331,"children":1333},{"class":150,"line":1332},25,[1334],{"type":77,"tag":148,"props":1335,"children":1336},{"emptyLinePlaceholder":261},[1337],{"type":83,"value":264},{"type":77,"tag":148,"props":1339,"children":1341},{"class":150,"line":1340},26,[1342,1346,1351,1356,1360,1364,1369,1373,1377,1382,1386,1391,1395,1399],{"type":77,"tag":148,"props":1343,"children":1344},{"style":171},[1345],{"type":83,"value":1268},{"type":77,"tag":148,"props":1347,"children":1348},{"style":177},[1349],{"type":83,"value":1350},"result",{"type":77,"tag":148,"props":1352,"children":1353},{"style":171},[1354],{"type":83,"value":1355},"?.",{"type":77,"tag":148,"props":1357,"children":1358},{"style":177},[1359],{"type":83,"value":15},{"type":77,"tag":148,"props":1361,"children":1362},{"style":171},[1363],{"type":83,"value":382},{"type":77,"tag":148,"props":1365,"children":1366},{"style":287},[1367],{"type":83,"value":1368},"map",{"type":77,"tag":148,"props":1370,"children":1371},{"style":177},[1372],{"type":83,"value":295},{"type":77,"tag":148,"props":1374,"children":1375},{"style":171},[1376],{"type":83,"value":295},{"type":77,"tag":148,"props":1378,"children":1379},{"style":298},[1380],{"type":83,"value":1381},"img",{"type":77,"tag":148,"props":1383,"children":1384},{"style":171},[1385],{"type":83,"value":185},{"type":77,"tag":148,"props":1387,"children":1388},{"style":298},[1389],{"type":83,"value":1390}," i",{"type":77,"tag":148,"props":1392,"children":1393},{"style":171},[1394],{"type":83,"value":317},{"type":77,"tag":148,"props":1396,"children":1397},{"style":276},[1398],{"type":83,"value":994},{"type":77,"tag":148,"props":1400,"children":1401},{"style":177},[1402],{"type":83,"value":915},{"type":77,"tag":148,"props":1404,"children":1406},{"class":150,"line":1405},27,[1407,1412],{"type":77,"tag":148,"props":1408,"children":1409},{"style":171},[1410],{"type":83,"value":1411},"        \u003C",{"type":77,"tag":148,"props":1413,"children":1414},{"style":390},[1415],{"type":83,"value":1416},"img\n",{"type":77,"tag":148,"props":1418,"children":1420},{"class":150,"line":1419},28,[1421,1426,1430,1435],{"type":77,"tag":148,"props":1422,"children":1423},{"style":276},[1424],{"type":83,"value":1425},"          key",{"type":77,"tag":148,"props":1427,"children":1428},{"style":171},[1429],{"type":83,"value":959},{"type":77,"tag":148,"props":1431,"children":1432},{"style":177},[1433],{"type":83,"value":1434},"i",{"type":77,"tag":148,"props":1436,"children":1437},{"style":171},[1438],{"type":83,"value":594},{"type":77,"tag":148,"props":1440,"children":1442},{"class":150,"line":1441},29,[1443,1448,1452,1456,1460,1465,1469,1474,1479,1484,1488,1492,1497,1502],{"type":77,"tag":148,"props":1444,"children":1445},{"style":276},[1446],{"type":83,"value":1447},"          src",{"type":77,"tag":148,"props":1449,"children":1450},{"style":171},[1451],{"type":83,"value":959},{"type":77,"tag":148,"props":1453,"children":1454},{"style":177},[1455],{"type":83,"value":1381},{"type":77,"tag":148,"props":1457,"children":1458},{"style":171},[1459],{"type":83,"value":382},{"type":77,"tag":148,"props":1461,"children":1462},{"style":177},[1463],{"type":83,"value":1464},"url ",{"type":77,"tag":148,"props":1466,"children":1467},{"style":171},[1468],{"type":83,"value":1145},{"type":77,"tag":148,"props":1470,"children":1471},{"style":171},[1472],{"type":83,"value":1473}," `",{"type":77,"tag":148,"props":1475,"children":1476},{"style":208},[1477],{"type":83,"value":1478},"data:image\u002Fpng;base64,",{"type":77,"tag":148,"props":1480,"children":1481},{"style":171},[1482],{"type":83,"value":1483},"${",{"type":77,"tag":148,"props":1485,"children":1486},{"style":177},[1487],{"type":83,"value":1381},{"type":77,"tag":148,"props":1489,"children":1490},{"style":171},[1491],{"type":83,"value":382},{"type":77,"tag":148,"props":1493,"children":1494},{"style":177},[1495],{"type":83,"value":1496},"b64Json",{"type":77,"tag":148,"props":1498,"children":1499},{"style":171},[1500],{"type":83,"value":1501},"}`",{"type":77,"tag":148,"props":1503,"children":1504},{"style":171},[1505],{"type":83,"value":594},{"type":77,"tag":148,"props":1507,"children":1509},{"class":150,"line":1508},30,[1510,1515,1519,1523,1527,1532,1536,1540,1545,1549],{"type":77,"tag":148,"props":1511,"children":1512},{"style":276},[1513],{"type":83,"value":1514},"          alt",{"type":77,"tag":148,"props":1516,"children":1517},{"style":171},[1518],{"type":83,"value":959},{"type":77,"tag":148,"props":1520,"children":1521},{"style":177},[1522],{"type":83,"value":1381},{"type":77,"tag":148,"props":1524,"children":1525},{"style":171},[1526],{"type":83,"value":382},{"type":77,"tag":148,"props":1528,"children":1529},{"style":177},[1530],{"type":83,"value":1531},"revisedPrompt ",{"type":77,"tag":148,"props":1533,"children":1534},{"style":171},[1535],{"type":83,"value":1145},{"type":77,"tag":148,"props":1537,"children":1538},{"style":171},[1539],{"type":83,"value":205},{"type":77,"tag":148,"props":1541,"children":1542},{"style":208},[1543],{"type":83,"value":1544},"Generated image",{"type":77,"tag":148,"props":1546,"children":1547},{"style":171},[1548],{"type":83,"value":457},{"type":77,"tag":148,"props":1550,"children":1551},{"style":171},[1552],{"type":83,"value":594},{"type":77,"tag":148,"props":1554,"children":1556},{"class":150,"line":1555},31,[1557],{"type":77,"tag":148,"props":1558,"children":1559},{"style":171},[1560],{"type":83,"value":1561},"        \u002F>\n",{"type":77,"tag":148,"props":1563,"children":1565},{"class":150,"line":1564},32,[1566,1571],{"type":77,"tag":148,"props":1567,"children":1568},{"style":177},[1569],{"type":83,"value":1570},"      ))",{"type":77,"tag":148,"props":1572,"children":1573},{"style":171},[1574],{"type":83,"value":594},{"type":77,"tag":148,"props":1576,"children":1578},{"class":150,"line":1577},33,[1579],{"type":77,"tag":148,"props":1580,"children":1581},{"emptyLinePlaceholder":261},[1582],{"type":83,"value":264},{"type":77,"tag":148,"props":1584,"children":1586},{"class":150,"line":1585},34,[1587,1591,1596,1600,1604,1608,1613,1617,1622,1627,1632,1637,1641],{"type":77,"tag":148,"props":1588,"children":1589},{"style":171},[1590],{"type":83,"value":1268},{"type":77,"tag":148,"props":1592,"children":1593},{"style":177},[1594],{"type":83,"value":1595},"result ",{"type":77,"tag":148,"props":1597,"children":1598},{"style":171},[1599],{"type":83,"value":1278},{"type":77,"tag":148,"props":1601,"children":1602},{"style":171},[1603],{"type":83,"value":1283},{"type":77,"tag":148,"props":1605,"children":1606},{"style":390},[1607],{"type":83,"value":1247},{"type":77,"tag":148,"props":1609,"children":1610},{"style":276},[1611],{"type":83,"value":1612}," onClick",{"type":77,"tag":148,"props":1614,"children":1615},{"style":171},[1616],{"type":83,"value":959},{"type":77,"tag":148,"props":1618,"children":1619},{"style":177},[1620],{"type":83,"value":1621},"reset",{"type":77,"tag":148,"props":1623,"children":1624},{"style":171},[1625],{"type":83,"value":1626},"}>",{"type":77,"tag":148,"props":1628,"children":1629},{"style":177},[1630],{"type":83,"value":1631},"Clear",{"type":77,"tag":148,"props":1633,"children":1634},{"style":171},[1635],{"type":83,"value":1636},"\u003C\u002F",{"type":77,"tag":148,"props":1638,"children":1639},{"style":390},[1640],{"type":83,"value":1247},{"type":77,"tag":148,"props":1642,"children":1643},{"style":171},[1644],{"type":83,"value":1329},{"type":77,"tag":148,"props":1646,"children":1648},{"class":150,"line":1647},35,[1649,1654,1658],{"type":77,"tag":148,"props":1650,"children":1651},{"style":171},[1652],{"type":83,"value":1653},"    \u003C\u002F",{"type":77,"tag":148,"props":1655,"children":1656},{"style":390},[1657],{"type":83,"value":928},{"type":77,"tag":148,"props":1659,"children":1660},{"style":171},[1661],{"type":83,"value":933},{"type":77,"tag":148,"props":1663,"children":1665},{"class":150,"line":1664},36,[1666],{"type":77,"tag":148,"props":1667,"children":1668},{"style":390},[1669],{"type":83,"value":1670},"  )\n",{"type":77,"tag":148,"props":1672,"children":1674},{"class":150,"line":1673},37,[1675],{"type":77,"tag":148,"props":1676,"children":1677},{"style":171},[1678],{"type":83,"value":594},{"type":77,"tag":131,"props":1680,"children":1682},{"id":1681},"tanstack-start-server-function-streaming-recommended",[1683],{"type":83,"value":1684},"TanStack Start: Server Function Streaming (recommended)",{"type":77,"tag":90,"props":1686,"children":1687},{},[1688,1690,1695,1697,1703],{"type":83,"value":1689},"When using TanStack Start, return ",{"type":77,"tag":107,"props":1691,"children":1693},{"className":1692},[],[1694],{"type":83,"value":120},{"type":83,"value":1696}," from a\nserver function. The client fetcher receives a ",{"type":77,"tag":107,"props":1698,"children":1700},{"className":1699},[],[1701],{"type":83,"value":1702},"Response",{"type":83,"value":1704}," and the hook\nparses it as SSE automatically:",{"type":77,"tag":138,"props":1706,"children":1708},{"className":140,"code":1707,"language":51,"meta":142,"style":142},"\u002F\u002F lib\u002Fserver-functions.ts\nimport { createServerFn } from '@tanstack\u002Freact-start'\nimport { generateImage, toServerSentEventsResponse } from '@tanstack\u002Fai'\nimport { openaiImage } from '@tanstack\u002Fai-openai'\n\nexport const generateImageStreamFn = createServerFn({ method: 'POST' })\n  .inputValidator((data: { prompt: string; model?: string }) => data)\n  .handler(({ data }) => {\n    return toServerSentEventsResponse(\n      generateImage({\n        adapter: openaiImage(data.model ?? 'gpt-image-1'),\n        prompt: data.prompt,\n        stream: true,\n      }),\n    )\n  })\n",[1709],{"type":77,"tag":107,"props":1710,"children":1711},{"__ignoreMap":142},[1712,1720,1757,1800,1835,1842,1905,1985,2023,2040,2056,2114,2142,2162,2178,2186],{"type":77,"tag":148,"props":1713,"children":1714},{"class":150,"line":151},[1715],{"type":77,"tag":148,"props":1716,"children":1717},{"style":155},[1718],{"type":83,"value":1719},"\u002F\u002F lib\u002Fserver-functions.ts\n",{"type":77,"tag":148,"props":1721,"children":1722},{"class":150,"line":161},[1723,1727,1731,1736,1740,1744,1748,1753],{"type":77,"tag":148,"props":1724,"children":1725},{"style":165},[1726],{"type":83,"value":168},{"type":77,"tag":148,"props":1728,"children":1729},{"style":171},[1730],{"type":83,"value":174},{"type":77,"tag":148,"props":1732,"children":1733},{"style":177},[1734],{"type":83,"value":1735}," createServerFn",{"type":77,"tag":148,"props":1737,"children":1738},{"style":171},[1739],{"type":83,"value":195},{"type":77,"tag":148,"props":1741,"children":1742},{"style":165},[1743],{"type":83,"value":200},{"type":77,"tag":148,"props":1745,"children":1746},{"style":171},[1747],{"type":83,"value":205},{"type":77,"tag":148,"props":1749,"children":1750},{"style":208},[1751],{"type":83,"value":1752},"@tanstack\u002Freact-start",{"type":77,"tag":148,"props":1754,"children":1755},{"style":171},[1756],{"type":83,"value":216},{"type":77,"tag":148,"props":1758,"children":1759},{"class":150,"line":219},[1760,1764,1768,1772,1776,1780,1784,1788,1792,1796],{"type":77,"tag":148,"props":1761,"children":1762},{"style":165},[1763],{"type":83,"value":168},{"type":77,"tag":148,"props":1765,"children":1766},{"style":171},[1767],{"type":83,"value":174},{"type":77,"tag":148,"props":1769,"children":1770},{"style":177},[1771],{"type":83,"value":180},{"type":77,"tag":148,"props":1773,"children":1774},{"style":171},[1775],{"type":83,"value":185},{"type":77,"tag":148,"props":1777,"children":1778},{"style":177},[1779],{"type":83,"value":190},{"type":77,"tag":148,"props":1781,"children":1782},{"style":171},[1783],{"type":83,"value":195},{"type":77,"tag":148,"props":1785,"children":1786},{"style":165},[1787],{"type":83,"value":200},{"type":77,"tag":148,"props":1789,"children":1790},{"style":171},[1791],{"type":83,"value":205},{"type":77,"tag":148,"props":1793,"children":1794},{"style":208},[1795],{"type":83,"value":211},{"type":77,"tag":148,"props":1797,"children":1798},{"style":171},[1799],{"type":83,"value":216},{"type":77,"tag":148,"props":1801,"children":1802},{"class":150,"line":257},[1803,1807,1811,1815,1819,1823,1827,1831],{"type":77,"tag":148,"props":1804,"children":1805},{"style":165},[1806],{"type":83,"value":168},{"type":77,"tag":148,"props":1808,"children":1809},{"style":171},[1810],{"type":83,"value":174},{"type":77,"tag":148,"props":1812,"children":1813},{"style":177},[1814],{"type":83,"value":233},{"type":77,"tag":148,"props":1816,"children":1817},{"style":171},[1818],{"type":83,"value":195},{"type":77,"tag":148,"props":1820,"children":1821},{"style":165},[1822],{"type":83,"value":200},{"type":77,"tag":148,"props":1824,"children":1825},{"style":171},[1826],{"type":83,"value":205},{"type":77,"tag":148,"props":1828,"children":1829},{"style":208},[1830],{"type":83,"value":250},{"type":77,"tag":148,"props":1832,"children":1833},{"style":171},[1834],{"type":83,"value":216},{"type":77,"tag":148,"props":1836,"children":1837},{"class":150,"line":267},[1838],{"type":77,"tag":148,"props":1839,"children":1840},{"emptyLinePlaceholder":261},[1841],{"type":83,"value":264},{"type":77,"tag":148,"props":1843,"children":1844},{"class":150,"line":325},[1845,1849,1854,1859,1863,1867,1871,1875,1880,1884,1888,1893,1897,1901],{"type":77,"tag":148,"props":1846,"children":1847},{"style":165},[1848],{"type":83,"value":273},{"type":77,"tag":148,"props":1850,"children":1851},{"style":276},[1852],{"type":83,"value":1853}," const",{"type":77,"tag":148,"props":1855,"children":1856},{"style":177},[1857],{"type":83,"value":1858}," generateImageStreamFn ",{"type":77,"tag":148,"props":1860,"children":1861},{"style":171},[1862],{"type":83,"value":1038},{"type":77,"tag":148,"props":1864,"children":1865},{"style":287},[1866],{"type":83,"value":1735},{"type":77,"tag":148,"props":1868,"children":1869},{"style":177},[1870],{"type":83,"value":295},{"type":77,"tag":148,"props":1872,"children":1873},{"style":171},[1874],{"type":83,"value":1104},{"type":77,"tag":148,"props":1876,"children":1877},{"style":390},[1878],{"type":83,"value":1879}," method",{"type":77,"tag":148,"props":1881,"children":1882},{"style":171},[1883],{"type":83,"value":306},{"type":77,"tag":148,"props":1885,"children":1886},{"style":171},[1887],{"type":83,"value":205},{"type":77,"tag":148,"props":1889,"children":1890},{"style":208},[1891],{"type":83,"value":1892},"POST",{"type":77,"tag":148,"props":1894,"children":1895},{"style":171},[1896],{"type":83,"value":457},{"type":77,"tag":148,"props":1898,"children":1899},{"style":171},[1900],{"type":83,"value":195},{"type":77,"tag":148,"props":1902,"children":1903},{"style":177},[1904],{"type":83,"value":551},{"type":77,"tag":148,"props":1906,"children":1907},{"class":150,"line":396},[1908,1913,1918,1922,1926,1931,1935,1939,1943,1947,1952,1957,1962,1967,1971,1976,1980],{"type":77,"tag":148,"props":1909,"children":1910},{"style":171},[1911],{"type":83,"value":1912},"  .",{"type":77,"tag":148,"props":1914,"children":1915},{"style":287},[1916],{"type":83,"value":1917},"inputValidator",{"type":77,"tag":148,"props":1919,"children":1920},{"style":177},[1921],{"type":83,"value":295},{"type":77,"tag":148,"props":1923,"children":1924},{"style":171},[1925],{"type":83,"value":295},{"type":77,"tag":148,"props":1927,"children":1928},{"style":298},[1929],{"type":83,"value":1930},"data",{"type":77,"tag":148,"props":1932,"children":1933},{"style":171},[1934],{"type":83,"value":306},{"type":77,"tag":148,"props":1936,"children":1937},{"style":171},[1938],{"type":83,"value":174},{"type":77,"tag":148,"props":1940,"children":1941},{"style":390},[1942],{"type":83,"value":340},{"type":77,"tag":148,"props":1944,"children":1945},{"style":171},[1946],{"type":83,"value":306},{"type":77,"tag":148,"props":1948,"children":1949},{"style":309},[1950],{"type":83,"value":1951}," string",{"type":77,"tag":148,"props":1953,"children":1954},{"style":171},[1955],{"type":83,"value":1956},";",{"type":77,"tag":148,"props":1958,"children":1959},{"style":390},[1960],{"type":83,"value":1961}," model",{"type":77,"tag":148,"props":1963,"children":1964},{"style":171},[1965],{"type":83,"value":1966},"?:",{"type":77,"tag":148,"props":1968,"children":1969},{"style":309},[1970],{"type":83,"value":1951},{"type":77,"tag":148,"props":1972,"children":1973},{"style":171},[1974],{"type":83,"value":1975}," })",{"type":77,"tag":148,"props":1977,"children":1978},{"style":276},[1979],{"type":83,"value":994},{"type":77,"tag":148,"props":1981,"children":1982},{"style":177},[1983],{"type":83,"value":1984}," data)\n",{"type":77,"tag":148,"props":1986,"children":1987},{"class":150,"line":404},[1988,1992,1997,2001,2006,2011,2015,2019],{"type":77,"tag":148,"props":1989,"children":1990},{"style":171},[1991],{"type":83,"value":1912},{"type":77,"tag":148,"props":1993,"children":1994},{"style":287},[1995],{"type":83,"value":1996},"handler",{"type":77,"tag":148,"props":1998,"children":1999},{"style":177},[2000],{"type":83,"value":295},{"type":77,"tag":148,"props":2002,"children":2003},{"style":171},[2004],{"type":83,"value":2005},"({",{"type":77,"tag":148,"props":2007,"children":2008},{"style":298},[2009],{"type":83,"value":2010}," data",{"type":77,"tag":148,"props":2012,"children":2013},{"style":171},[2014],{"type":83,"value":1975},{"type":77,"tag":148,"props":2016,"children":2017},{"style":276},[2018],{"type":83,"value":994},{"type":77,"tag":148,"props":2020,"children":2021},{"style":171},[2022],{"type":83,"value":322},{"type":77,"tag":148,"props":2024,"children":2025},{"class":150,"line":434},[2026,2031,2035],{"type":77,"tag":148,"props":2027,"children":2028},{"style":165},[2029],{"type":83,"value":2030},"    return",{"type":77,"tag":148,"props":2032,"children":2033},{"style":287},[2034],{"type":83,"value":190},{"type":77,"tag":148,"props":2036,"children":2037},{"style":390},[2038],{"type":83,"value":2039},"(\n",{"type":77,"tag":148,"props":2041,"children":2042},{"class":150,"line":478},[2043,2048,2052],{"type":77,"tag":148,"props":2044,"children":2045},{"style":287},[2046],{"type":83,"value":2047},"      generateImage",{"type":77,"tag":148,"props":2049,"children":2050},{"style":390},[2051],{"type":83,"value":295},{"type":77,"tag":148,"props":2053,"children":2054},{"style":171},[2055],{"type":83,"value":431},{"type":77,"tag":148,"props":2057,"children":2058},{"class":150,"line":491},[2059,2064,2068,2072,2076,2080,2084,2089,2094,2098,2102,2106,2110],{"type":77,"tag":148,"props":2060,"children":2061},{"style":390},[2062],{"type":83,"value":2063},"        adapter",{"type":77,"tag":148,"props":2065,"children":2066},{"style":171},[2067],{"type":83,"value":306},{"type":77,"tag":148,"props":2069,"children":2070},{"style":287},[2071],{"type":83,"value":233},{"type":77,"tag":148,"props":2073,"children":2074},{"style":390},[2075],{"type":83,"value":295},{"type":77,"tag":148,"props":2077,"children":2078},{"style":177},[2079],{"type":83,"value":1930},{"type":77,"tag":148,"props":2081,"children":2082},{"style":171},[2083],{"type":83,"value":382},{"type":77,"tag":148,"props":2085,"children":2086},{"style":177},[2087],{"type":83,"value":2088},"model",{"type":77,"tag":148,"props":2090,"children":2091},{"style":171},[2092],{"type":83,"value":2093}," ??",{"type":77,"tag":148,"props":2095,"children":2096},{"style":171},[2097],{"type":83,"value":205},{"type":77,"tag":148,"props":2099,"children":2100},{"style":208},[2101],{"type":83,"value":462},{"type":77,"tag":148,"props":2103,"children":2104},{"style":171},[2105],{"type":83,"value":457},{"type":77,"tag":148,"props":2107,"children":2108},{"style":390},[2109],{"type":83,"value":317},{"type":77,"tag":148,"props":2111,"children":2112},{"style":171},[2113],{"type":83,"value":475},{"type":77,"tag":148,"props":2115,"children":2116},{"class":150,"line":504},[2117,2122,2126,2130,2134,2138],{"type":77,"tag":148,"props":2118,"children":2119},{"style":390},[2120],{"type":83,"value":2121},"        prompt",{"type":77,"tag":148,"props":2123,"children":2124},{"style":171},[2125],{"type":83,"value":306},{"type":77,"tag":148,"props":2127,"children":2128},{"style":177},[2129],{"type":83,"value":2010},{"type":77,"tag":148,"props":2131,"children":2132},{"style":171},[2133],{"type":83,"value":382},{"type":77,"tag":148,"props":2135,"children":2136},{"style":177},[2137],{"type":83,"value":737},{"type":77,"tag":148,"props":2139,"children":2140},{"style":171},[2141],{"type":83,"value":475},{"type":77,"tag":148,"props":2143,"children":2144},{"class":150,"line":517},[2145,2150,2154,2158],{"type":77,"tag":148,"props":2146,"children":2147},{"style":390},[2148],{"type":83,"value":2149},"        stream",{"type":77,"tag":148,"props":2151,"children":2152},{"style":171},[2153],{"type":83,"value":306},{"type":77,"tag":148,"props":2155,"children":2156},{"style":530},[2157],{"type":83,"value":533},{"type":77,"tag":148,"props":2159,"children":2160},{"style":171},[2161],{"type":83,"value":475},{"type":77,"tag":148,"props":2163,"children":2164},{"class":150,"line":540},[2165,2170,2174],{"type":77,"tag":148,"props":2166,"children":2167},{"style":171},[2168],{"type":83,"value":2169},"      }",{"type":77,"tag":148,"props":2171,"children":2172},{"style":390},[2173],{"type":83,"value":317},{"type":77,"tag":148,"props":2175,"children":2176},{"style":171},[2177],{"type":83,"value":475},{"type":77,"tag":148,"props":2179,"children":2180},{"class":150,"line":554},[2181],{"type":77,"tag":148,"props":2182,"children":2183},{"style":390},[2184],{"type":83,"value":2185},"    )\n",{"type":77,"tag":148,"props":2187,"children":2188},{"class":150,"line":562},[2189,2193],{"type":77,"tag":148,"props":2190,"children":2191},{"style":171},[2192],{"type":83,"value":546},{"type":77,"tag":148,"props":2194,"children":2195},{"style":177},[2196],{"type":83,"value":551},{"type":77,"tag":138,"props":2198,"children":2200},{"className":603,"code":2199,"language":605,"meta":142,"style":142},"import { useGenerateImage } from '@tanstack\u002Fai-react'\nimport { generateImageStreamFn } from '..\u002Flib\u002Fserver-functions'\n\nfunction ImageGenerator() {\n  const { generate, result, isLoading } = useGenerateImage({\n    fetcher: (input) => generateImageStreamFn({ data: input }),\n  })\n\n  return (\n    \u003Cbutton\n      onClick={() => generate({ prompt: 'A sunset over mountains' })}\n      disabled={isLoading}\n    >\n      {isLoading ? 'Generating...' : 'Generate'}\n    \u003C\u002Fbutton>\n  )\n}\n",[2201],{"type":77,"tag":107,"props":2202,"children":2203},{"__ignoreMap":142},[2204,2239,2276,2283,2302,2353,2420,2431,2438,2449,2460,2521,2542,2550,2597,2612,2619],{"type":77,"tag":148,"props":2205,"children":2206},{"class":150,"line":151},[2207,2211,2215,2219,2223,2227,2231,2235],{"type":77,"tag":148,"props":2208,"children":2209},{"style":165},[2210],{"type":83,"value":168},{"type":77,"tag":148,"props":2212,"children":2213},{"style":171},[2214],{"type":83,"value":174},{"type":77,"tag":148,"props":2216,"children":2217},{"style":177},[2218],{"type":83,"value":625},{"type":77,"tag":148,"props":2220,"children":2221},{"style":171},[2222],{"type":83,"value":195},{"type":77,"tag":148,"props":2224,"children":2225},{"style":165},[2226],{"type":83,"value":200},{"type":77,"tag":148,"props":2228,"children":2229},{"style":171},[2230],{"type":83,"value":205},{"type":77,"tag":148,"props":2232,"children":2233},{"style":208},[2234],{"type":83,"value":651},{"type":77,"tag":148,"props":2236,"children":2237},{"style":171},[2238],{"type":83,"value":216},{"type":77,"tag":148,"props":2240,"children":2241},{"class":150,"line":161},[2242,2246,2250,2255,2259,2263,2267,2272],{"type":77,"tag":148,"props":2243,"children":2244},{"style":165},[2245],{"type":83,"value":168},{"type":77,"tag":148,"props":2247,"children":2248},{"style":171},[2249],{"type":83,"value":174},{"type":77,"tag":148,"props":2251,"children":2252},{"style":177},[2253],{"type":83,"value":2254}," generateImageStreamFn",{"type":77,"tag":148,"props":2256,"children":2257},{"style":171},[2258],{"type":83,"value":195},{"type":77,"tag":148,"props":2260,"children":2261},{"style":165},[2262],{"type":83,"value":200},{"type":77,"tag":148,"props":2264,"children":2265},{"style":171},[2266],{"type":83,"value":205},{"type":77,"tag":148,"props":2268,"children":2269},{"style":208},[2270],{"type":83,"value":2271},"..\u002Flib\u002Fserver-functions",{"type":77,"tag":148,"props":2273,"children":2274},{"style":171},[2275],{"type":83,"value":216},{"type":77,"tag":148,"props":2277,"children":2278},{"class":150,"line":219},[2279],{"type":77,"tag":148,"props":2280,"children":2281},{"emptyLinePlaceholder":261},[2282],{"type":83,"value":264},{"type":77,"tag":148,"props":2284,"children":2285},{"class":150,"line":257},[2286,2290,2294,2298],{"type":77,"tag":148,"props":2287,"children":2288},{"style":276},[2289],{"type":83,"value":706},{"type":77,"tag":148,"props":2291,"children":2292},{"style":287},[2293],{"type":83,"value":711},{"type":77,"tag":148,"props":2295,"children":2296},{"style":171},[2297],{"type":83,"value":716},{"type":77,"tag":148,"props":2299,"children":2300},{"style":171},[2301],{"type":83,"value":322},{"type":77,"tag":148,"props":2303,"children":2304},{"class":150,"line":267},[2305,2309,2313,2317,2321,2325,2329,2333,2337,2341,2345,2349],{"type":77,"tag":148,"props":2306,"children":2307},{"style":276},[2308],{"type":83,"value":331},{"type":77,"tag":148,"props":2310,"children":2311},{"style":171},[2312],{"type":83,"value":174},{"type":77,"tag":148,"props":2314,"children":2315},{"style":177},[2316],{"type":83,"value":788},{"type":77,"tag":148,"props":2318,"children":2319},{"style":171},[2320],{"type":83,"value":185},{"type":77,"tag":148,"props":2322,"children":2323},{"style":177},[2324],{"type":83,"value":797},{"type":77,"tag":148,"props":2326,"children":2327},{"style":171},[2328],{"type":83,"value":185},{"type":77,"tag":148,"props":2330,"children":2331},{"style":177},[2332],{"type":83,"value":806},{"type":77,"tag":148,"props":2334,"children":2335},{"style":171},[2336],{"type":83,"value":195},{"type":77,"tag":148,"props":2338,"children":2339},{"style":171},[2340],{"type":83,"value":367},{"type":77,"tag":148,"props":2342,"children":2343},{"style":287},[2344],{"type":83,"value":625},{"type":77,"tag":148,"props":2346,"children":2347},{"style":390},[2348],{"type":83,"value":295},{"type":77,"tag":148,"props":2350,"children":2351},{"style":171},[2352],{"type":83,"value":431},{"type":77,"tag":148,"props":2354,"children":2355},{"class":150,"line":325},[2356,2361,2365,2370,2375,2379,2383,2387,2391,2395,2399,2403,2408,2412,2416],{"type":77,"tag":148,"props":2357,"children":2358},{"style":287},[2359],{"type":83,"value":2360},"    fetcher",{"type":77,"tag":148,"props":2362,"children":2363},{"style":171},[2364],{"type":83,"value":306},{"type":77,"tag":148,"props":2366,"children":2367},{"style":171},[2368],{"type":83,"value":2369}," (",{"type":77,"tag":148,"props":2371,"children":2372},{"style":298},[2373],{"type":83,"value":2374},"input",{"type":77,"tag":148,"props":2376,"children":2377},{"style":171},[2378],{"type":83,"value":317},{"type":77,"tag":148,"props":2380,"children":2381},{"style":276},[2382],{"type":83,"value":994},{"type":77,"tag":148,"props":2384,"children":2385},{"style":287},[2386],{"type":83,"value":2254},{"type":77,"tag":148,"props":2388,"children":2389},{"style":390},[2390],{"type":83,"value":295},{"type":77,"tag":148,"props":2392,"children":2393},{"style":171},[2394],{"type":83,"value":1104},{"type":77,"tag":148,"props":2396,"children":2397},{"style":390},[2398],{"type":83,"value":2010},{"type":77,"tag":148,"props":2400,"children":2401},{"style":171},[2402],{"type":83,"value":306},{"type":77,"tag":148,"props":2404,"children":2405},{"style":177},[2406],{"type":83,"value":2407}," input",{"type":77,"tag":148,"props":2409,"children":2410},{"style":171},[2411],{"type":83,"value":195},{"type":77,"tag":148,"props":2413,"children":2414},{"style":390},[2415],{"type":83,"value":317},{"type":77,"tag":148,"props":2417,"children":2418},{"style":171},[2419],{"type":83,"value":475},{"type":77,"tag":148,"props":2421,"children":2422},{"class":150,"line":396},[2423,2427],{"type":77,"tag":148,"props":2424,"children":2425},{"style":171},[2426],{"type":83,"value":546},{"type":77,"tag":148,"props":2428,"children":2429},{"style":390},[2430],{"type":83,"value":551},{"type":77,"tag":148,"props":2432,"children":2433},{"class":150,"line":404},[2434],{"type":77,"tag":148,"props":2435,"children":2436},{"emptyLinePlaceholder":261},[2437],{"type":83,"value":264},{"type":77,"tag":148,"props":2439,"children":2440},{"class":150,"line":434},[2441,2445],{"type":77,"tag":148,"props":2442,"children":2443},{"style":165},[2444],{"type":83,"value":568},{"type":77,"tag":148,"props":2446,"children":2447},{"style":390},[2448],{"type":83,"value":915},{"type":77,"tag":148,"props":2450,"children":2451},{"class":150,"line":478},[2452,2456],{"type":77,"tag":148,"props":2453,"children":2454},{"style":171},[2455],{"type":83,"value":923},{"type":77,"tag":148,"props":2457,"children":2458},{"style":390},[2459],{"type":83,"value":1073},{"type":77,"tag":148,"props":2461,"children":2462},{"class":150,"line":491},[2463,2468,2472,2476,2480,2484,2488,2492,2496,2500,2505,2509,2513,2517],{"type":77,"tag":148,"props":2464,"children":2465},{"style":276},[2466],{"type":83,"value":2467},"      onClick",{"type":77,"tag":148,"props":2469,"children":2470},{"style":171},[2471],{"type":83,"value":1087},{"type":77,"tag":148,"props":2473,"children":2474},{"style":276},[2475],{"type":83,"value":994},{"type":77,"tag":148,"props":2477,"children":2478},{"style":287},[2479],{"type":83,"value":788},{"type":77,"tag":148,"props":2481,"children":2482},{"style":177},[2483],{"type":83,"value":295},{"type":77,"tag":148,"props":2485,"children":2486},{"style":171},[2487],{"type":83,"value":1104},{"type":77,"tag":148,"props":2489,"children":2490},{"style":390},[2491],{"type":83,"value":340},{"type":77,"tag":148,"props":2493,"children":2494},{"style":171},[2495],{"type":83,"value":306},{"type":77,"tag":148,"props":2497,"children":2498},{"style":171},[2499],{"type":83,"value":205},{"type":77,"tag":148,"props":2501,"children":2502},{"style":208},[2503],{"type":83,"value":2504},"A sunset over mountains",{"type":77,"tag":148,"props":2506,"children":2507},{"style":171},[2508],{"type":83,"value":457},{"type":77,"tag":148,"props":2510,"children":2511},{"style":171},[2512],{"type":83,"value":195},{"type":77,"tag":148,"props":2514,"children":2515},{"style":177},[2516],{"type":83,"value":317},{"type":77,"tag":148,"props":2518,"children":2519},{"style":171},[2520],{"type":83,"value":594},{"type":77,"tag":148,"props":2522,"children":2523},{"class":150,"line":504},[2524,2529,2533,2538],{"type":77,"tag":148,"props":2525,"children":2526},{"style":276},[2527],{"type":83,"value":2528},"      disabled",{"type":77,"tag":148,"props":2530,"children":2531},{"style":171},[2532],{"type":83,"value":959},{"type":77,"tag":148,"props":2534,"children":2535},{"style":177},[2536],{"type":83,"value":2537},"isLoading",{"type":77,"tag":148,"props":2539,"children":2540},{"style":171},[2541],{"type":83,"value":594},{"type":77,"tag":148,"props":2543,"children":2544},{"class":150,"line":517},[2545],{"type":77,"tag":148,"props":2546,"children":2547},{"style":171},[2548],{"type":83,"value":2549},"    >\n",{"type":77,"tag":148,"props":2551,"children":2552},{"class":150,"line":540},[2553,2557,2561,2565,2569,2573,2577,2581,2585,2589,2593],{"type":77,"tag":148,"props":2554,"children":2555},{"style":171},[2556],{"type":83,"value":1268},{"type":77,"tag":148,"props":2558,"children":2559},{"style":177},[2560],{"type":83,"value":1140},{"type":77,"tag":148,"props":2562,"children":2563},{"style":171},[2564],{"type":83,"value":1198},{"type":77,"tag":148,"props":2566,"children":2567},{"style":171},[2568],{"type":83,"value":205},{"type":77,"tag":148,"props":2570,"children":2571},{"style":208},[2572],{"type":83,"value":1207},{"type":77,"tag":148,"props":2574,"children":2575},{"style":171},[2576],{"type":83,"value":457},{"type":77,"tag":148,"props":2578,"children":2579},{"style":171},[2580],{"type":83,"value":1216},{"type":77,"tag":148,"props":2582,"children":2583},{"style":171},[2584],{"type":83,"value":205},{"type":77,"tag":148,"props":2586,"children":2587},{"style":208},[2588],{"type":83,"value":1225},{"type":77,"tag":148,"props":2590,"children":2591},{"style":171},[2592],{"type":83,"value":457},{"type":77,"tag":148,"props":2594,"children":2595},{"style":171},[2596],{"type":83,"value":594},{"type":77,"tag":148,"props":2598,"children":2599},{"class":150,"line":554},[2600,2604,2608],{"type":77,"tag":148,"props":2601,"children":2602},{"style":171},[2603],{"type":83,"value":1653},{"type":77,"tag":148,"props":2605,"children":2606},{"style":390},[2607],{"type":83,"value":1247},{"type":77,"tag":148,"props":2609,"children":2610},{"style":171},[2611],{"type":83,"value":933},{"type":77,"tag":148,"props":2613,"children":2614},{"class":150,"line":562},[2615],{"type":77,"tag":148,"props":2616,"children":2617},{"style":390},[2618],{"type":83,"value":1670},{"type":77,"tag":148,"props":2620,"children":2621},{"class":150,"line":588},[2622],{"type":77,"tag":148,"props":2623,"children":2624},{"style":171},[2625],{"type":83,"value":594},{"type":77,"tag":2627,"props":2628,"children":2629},"hr",{},[],{"type":77,"tag":124,"props":2631,"children":2633},{"id":2632},"core-patterns",[2634],{"type":83,"value":2635},"Core Patterns",{"type":77,"tag":131,"props":2637,"children":2639},{"id":2638},"_1-image-generation",[2640],{"type":83,"value":2641},"1. Image Generation",{"type":77,"tag":90,"props":2643,"children":2644},{},[2645,2647,2653,2655,2661],{"type":83,"value":2646},"Supported adapters: ",{"type":77,"tag":107,"props":2648,"children":2650},{"className":2649},[],[2651],{"type":83,"value":2652},"openaiImage",{"type":83,"value":2654}," (dall-e-2, dall-e-3, gpt-image-1,\ngpt-image-1-mini, gpt-image-2) and ",{"type":77,"tag":107,"props":2656,"children":2658},{"className":2657},[],[2659],{"type":83,"value":2660},"geminiImage",{"type":83,"value":2662}," (gemini-3.1-flash-image-preview,\ngemini-3.1-flash-lite-image, imagen-4.0-generate-001, etc.).",{"type":77,"tag":138,"props":2664,"children":2666},{"className":140,"code":2665,"language":51,"meta":142,"style":142},"import { generateImage } from '@tanstack\u002Fai'\nimport { openaiImage } from '@tanstack\u002Fai-openai'\nimport { geminiImage } from '@tanstack\u002Fai-gemini'\n\n\u002F\u002F OpenAI with quality\u002Fbackground options\nconst openaiResult = await generateImage({\n  adapter: openaiImage('gpt-image-1'),\n  prompt: 'A cat wearing a hat',\n  size: '1024x1024',\n  numberOfImages: 2,\n  modelOptions: {\n    quality: 'high',\n    background: 'transparent',\n    outputFormat: 'png',\n  },\n})\n\n\u002F\u002F Gemini native model with aspect-ratio sizes\nconst geminiResult = await generateImage({\n  adapter: geminiImage('gemini-3.1-flash-image-preview'),\n  prompt: 'A futuristic cityscape at night',\n  size: '16:9_4K',\n})\n\n\u002F\u002F Gemini Imagen model\nconst imagenResult = await generateImage({\n  adapter: geminiImage('imagen-4.0-generate-001'),\n  prompt: 'A landscape photo',\n  modelOptions: { aspectRatio: '16:9' },\n})\n",[2667],{"type":77,"tag":107,"props":2668,"children":2669},{"__ignoreMap":142},[2670,2705,2740,2777,2784,2792,2825,2865,2894,2923,2945,2961,2990,3019,3048,3056,3067,3074,3082,3114,3154,3182,3210,3221,3228,3236,3268,3308,3336,3378],{"type":77,"tag":148,"props":2671,"children":2672},{"class":150,"line":151},[2673,2677,2681,2685,2689,2693,2697,2701],{"type":77,"tag":148,"props":2674,"children":2675},{"style":165},[2676],{"type":83,"value":168},{"type":77,"tag":148,"props":2678,"children":2679},{"style":171},[2680],{"type":83,"value":174},{"type":77,"tag":148,"props":2682,"children":2683},{"style":177},[2684],{"type":83,"value":180},{"type":77,"tag":148,"props":2686,"children":2687},{"style":171},[2688],{"type":83,"value":195},{"type":77,"tag":148,"props":2690,"children":2691},{"style":165},[2692],{"type":83,"value":200},{"type":77,"tag":148,"props":2694,"children":2695},{"style":171},[2696],{"type":83,"value":205},{"type":77,"tag":148,"props":2698,"children":2699},{"style":208},[2700],{"type":83,"value":211},{"type":77,"tag":148,"props":2702,"children":2703},{"style":171},[2704],{"type":83,"value":216},{"type":77,"tag":148,"props":2706,"children":2707},{"class":150,"line":161},[2708,2712,2716,2720,2724,2728,2732,2736],{"type":77,"tag":148,"props":2709,"children":2710},{"style":165},[2711],{"type":83,"value":168},{"type":77,"tag":148,"props":2713,"children":2714},{"style":171},[2715],{"type":83,"value":174},{"type":77,"tag":148,"props":2717,"children":2718},{"style":177},[2719],{"type":83,"value":233},{"type":77,"tag":148,"props":2721,"children":2722},{"style":171},[2723],{"type":83,"value":195},{"type":77,"tag":148,"props":2725,"children":2726},{"style":165},[2727],{"type":83,"value":200},{"type":77,"tag":148,"props":2729,"children":2730},{"style":171},[2731],{"type":83,"value":205},{"type":77,"tag":148,"props":2733,"children":2734},{"style":208},[2735],{"type":83,"value":250},{"type":77,"tag":148,"props":2737,"children":2738},{"style":171},[2739],{"type":83,"value":216},{"type":77,"tag":148,"props":2741,"children":2742},{"class":150,"line":219},[2743,2747,2751,2756,2760,2764,2768,2773],{"type":77,"tag":148,"props":2744,"children":2745},{"style":165},[2746],{"type":83,"value":168},{"type":77,"tag":148,"props":2748,"children":2749},{"style":171},[2750],{"type":83,"value":174},{"type":77,"tag":148,"props":2752,"children":2753},{"style":177},[2754],{"type":83,"value":2755}," geminiImage",{"type":77,"tag":148,"props":2757,"children":2758},{"style":171},[2759],{"type":83,"value":195},{"type":77,"tag":148,"props":2761,"children":2762},{"style":165},[2763],{"type":83,"value":200},{"type":77,"tag":148,"props":2765,"children":2766},{"style":171},[2767],{"type":83,"value":205},{"type":77,"tag":148,"props":2769,"children":2770},{"style":208},[2771],{"type":83,"value":2772},"@tanstack\u002Fai-gemini",{"type":77,"tag":148,"props":2774,"children":2775},{"style":171},[2776],{"type":83,"value":216},{"type":77,"tag":148,"props":2778,"children":2779},{"class":150,"line":257},[2780],{"type":77,"tag":148,"props":2781,"children":2782},{"emptyLinePlaceholder":261},[2783],{"type":83,"value":264},{"type":77,"tag":148,"props":2785,"children":2786},{"class":150,"line":267},[2787],{"type":77,"tag":148,"props":2788,"children":2789},{"style":155},[2790],{"type":83,"value":2791},"\u002F\u002F OpenAI with quality\u002Fbackground options\n",{"type":77,"tag":148,"props":2793,"children":2794},{"class":150,"line":325},[2795,2800,2805,2809,2813,2817,2821],{"type":77,"tag":148,"props":2796,"children":2797},{"style":276},[2798],{"type":83,"value":2799},"const",{"type":77,"tag":148,"props":2801,"children":2802},{"style":177},[2803],{"type":83,"value":2804}," openaiResult ",{"type":77,"tag":148,"props":2806,"children":2807},{"style":171},[2808],{"type":83,"value":1038},{"type":77,"tag":148,"props":2810,"children":2811},{"style":165},[2812],{"type":83,"value":372},{"type":77,"tag":148,"props":2814,"children":2815},{"style":287},[2816],{"type":83,"value":180},{"type":77,"tag":148,"props":2818,"children":2819},{"style":177},[2820],{"type":83,"value":295},{"type":77,"tag":148,"props":2822,"children":2823},{"style":171},[2824],{"type":83,"value":431},{"type":77,"tag":148,"props":2826,"children":2827},{"class":150,"line":396},[2828,2833,2837,2841,2845,2849,2853,2857,2861],{"type":77,"tag":148,"props":2829,"children":2830},{"style":390},[2831],{"type":83,"value":2832},"  adapter",{"type":77,"tag":148,"props":2834,"children":2835},{"style":171},[2836],{"type":83,"value":306},{"type":77,"tag":148,"props":2838,"children":2839},{"style":287},[2840],{"type":83,"value":233},{"type":77,"tag":148,"props":2842,"children":2843},{"style":177},[2844],{"type":83,"value":295},{"type":77,"tag":148,"props":2846,"children":2847},{"style":171},[2848],{"type":83,"value":457},{"type":77,"tag":148,"props":2850,"children":2851},{"style":208},[2852],{"type":83,"value":462},{"type":77,"tag":148,"props":2854,"children":2855},{"style":171},[2856],{"type":83,"value":457},{"type":77,"tag":148,"props":2858,"children":2859},{"style":177},[2860],{"type":83,"value":317},{"type":77,"tag":148,"props":2862,"children":2863},{"style":171},[2864],{"type":83,"value":475},{"type":77,"tag":148,"props":2866,"children":2867},{"class":150,"line":404},[2868,2873,2877,2881,2886,2890],{"type":77,"tag":148,"props":2869,"children":2870},{"style":390},[2871],{"type":83,"value":2872},"  prompt",{"type":77,"tag":148,"props":2874,"children":2875},{"style":171},[2876],{"type":83,"value":306},{"type":77,"tag":148,"props":2878,"children":2879},{"style":171},[2880],{"type":83,"value":205},{"type":77,"tag":148,"props":2882,"children":2883},{"style":208},[2884],{"type":83,"value":2885},"A cat wearing a hat",{"type":77,"tag":148,"props":2887,"children":2888},{"style":171},[2889],{"type":83,"value":457},{"type":77,"tag":148,"props":2891,"children":2892},{"style":171},[2893],{"type":83,"value":475},{"type":77,"tag":148,"props":2895,"children":2896},{"class":150,"line":434},[2897,2902,2906,2910,2915,2919],{"type":77,"tag":148,"props":2898,"children":2899},{"style":390},[2900],{"type":83,"value":2901},"  size",{"type":77,"tag":148,"props":2903,"children":2904},{"style":171},[2905],{"type":83,"value":306},{"type":77,"tag":148,"props":2907,"children":2908},{"style":171},[2909],{"type":83,"value":205},{"type":77,"tag":148,"props":2911,"children":2912},{"style":208},[2913],{"type":83,"value":2914},"1024x1024",{"type":77,"tag":148,"props":2916,"children":2917},{"style":171},[2918],{"type":83,"value":457},{"type":77,"tag":148,"props":2920,"children":2921},{"style":171},[2922],{"type":83,"value":475},{"type":77,"tag":148,"props":2924,"children":2925},{"class":150,"line":478},[2926,2931,2935,2941],{"type":77,"tag":148,"props":2927,"children":2928},{"style":390},[2929],{"type":83,"value":2930},"  numberOfImages",{"type":77,"tag":148,"props":2932,"children":2933},{"style":171},[2934],{"type":83,"value":306},{"type":77,"tag":148,"props":2936,"children":2938},{"style":2937},"--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C",[2939],{"type":83,"value":2940}," 2",{"type":77,"tag":148,"props":2942,"children":2943},{"style":171},[2944],{"type":83,"value":475},{"type":77,"tag":148,"props":2946,"children":2947},{"class":150,"line":491},[2948,2953,2957],{"type":77,"tag":148,"props":2949,"children":2950},{"style":390},[2951],{"type":83,"value":2952},"  modelOptions",{"type":77,"tag":148,"props":2954,"children":2955},{"style":171},[2956],{"type":83,"value":306},{"type":77,"tag":148,"props":2958,"children":2959},{"style":171},[2960],{"type":83,"value":322},{"type":77,"tag":148,"props":2962,"children":2963},{"class":150,"line":504},[2964,2969,2973,2977,2982,2986],{"type":77,"tag":148,"props":2965,"children":2966},{"style":390},[2967],{"type":83,"value":2968},"    quality",{"type":77,"tag":148,"props":2970,"children":2971},{"style":171},[2972],{"type":83,"value":306},{"type":77,"tag":148,"props":2974,"children":2975},{"style":171},[2976],{"type":83,"value":205},{"type":77,"tag":148,"props":2978,"children":2979},{"style":208},[2980],{"type":83,"value":2981},"high",{"type":77,"tag":148,"props":2983,"children":2984},{"style":171},[2985],{"type":83,"value":457},{"type":77,"tag":148,"props":2987,"children":2988},{"style":171},[2989],{"type":83,"value":475},{"type":77,"tag":148,"props":2991,"children":2992},{"class":150,"line":517},[2993,2998,3002,3006,3011,3015],{"type":77,"tag":148,"props":2994,"children":2995},{"style":390},[2996],{"type":83,"value":2997},"    background",{"type":77,"tag":148,"props":2999,"children":3000},{"style":171},[3001],{"type":83,"value":306},{"type":77,"tag":148,"props":3003,"children":3004},{"style":171},[3005],{"type":83,"value":205},{"type":77,"tag":148,"props":3007,"children":3008},{"style":208},[3009],{"type":83,"value":3010},"transparent",{"type":77,"tag":148,"props":3012,"children":3013},{"style":171},[3014],{"type":83,"value":457},{"type":77,"tag":148,"props":3016,"children":3017},{"style":171},[3018],{"type":83,"value":475},{"type":77,"tag":148,"props":3020,"children":3021},{"class":150,"line":540},[3022,3027,3031,3035,3040,3044],{"type":77,"tag":148,"props":3023,"children":3024},{"style":390},[3025],{"type":83,"value":3026},"    outputFormat",{"type":77,"tag":148,"props":3028,"children":3029},{"style":171},[3030],{"type":83,"value":306},{"type":77,"tag":148,"props":3032,"children":3033},{"style":171},[3034],{"type":83,"value":205},{"type":77,"tag":148,"props":3036,"children":3037},{"style":208},[3038],{"type":83,"value":3039},"png",{"type":77,"tag":148,"props":3041,"children":3042},{"style":171},[3043],{"type":83,"value":457},{"type":77,"tag":148,"props":3045,"children":3046},{"style":171},[3047],{"type":83,"value":475},{"type":77,"tag":148,"props":3049,"children":3050},{"class":150,"line":554},[3051],{"type":77,"tag":148,"props":3052,"children":3053},{"style":171},[3054],{"type":83,"value":3055},"  },\n",{"type":77,"tag":148,"props":3057,"children":3058},{"class":150,"line":562},[3059,3063],{"type":77,"tag":148,"props":3060,"children":3061},{"style":171},[3062],{"type":83,"value":1114},{"type":77,"tag":148,"props":3064,"children":3065},{"style":177},[3066],{"type":83,"value":551},{"type":77,"tag":148,"props":3068,"children":3069},{"class":150,"line":588},[3070],{"type":77,"tag":148,"props":3071,"children":3072},{"emptyLinePlaceholder":261},[3073],{"type":83,"value":264},{"type":77,"tag":148,"props":3075,"children":3076},{"class":150,"line":1076},[3077],{"type":77,"tag":148,"props":3078,"children":3079},{"style":155},[3080],{"type":83,"value":3081},"\u002F\u002F Gemini native model with aspect-ratio sizes\n",{"type":77,"tag":148,"props":3083,"children":3084},{"class":150,"line":1125},[3085,3089,3094,3098,3102,3106,3110],{"type":77,"tag":148,"props":3086,"children":3087},{"style":276},[3088],{"type":83,"value":2799},{"type":77,"tag":148,"props":3090,"children":3091},{"style":177},[3092],{"type":83,"value":3093}," geminiResult ",{"type":77,"tag":148,"props":3095,"children":3096},{"style":171},[3097],{"type":83,"value":1038},{"type":77,"tag":148,"props":3099,"children":3100},{"style":165},[3101],{"type":83,"value":372},{"type":77,"tag":148,"props":3103,"children":3104},{"style":287},[3105],{"type":83,"value":180},{"type":77,"tag":148,"props":3107,"children":3108},{"style":177},[3109],{"type":83,"value":295},{"type":77,"tag":148,"props":3111,"children":3112},{"style":171},[3113],{"type":83,"value":431},{"type":77,"tag":148,"props":3115,"children":3116},{"class":150,"line":1174},[3117,3121,3125,3129,3133,3137,3142,3146,3150],{"type":77,"tag":148,"props":3118,"children":3119},{"style":390},[3120],{"type":83,"value":2832},{"type":77,"tag":148,"props":3122,"children":3123},{"style":171},[3124],{"type":83,"value":306},{"type":77,"tag":148,"props":3126,"children":3127},{"style":287},[3128],{"type":83,"value":2755},{"type":77,"tag":148,"props":3130,"children":3131},{"style":177},[3132],{"type":83,"value":295},{"type":77,"tag":148,"props":3134,"children":3135},{"style":171},[3136],{"type":83,"value":457},{"type":77,"tag":148,"props":3138,"children":3139},{"style":208},[3140],{"type":83,"value":3141},"gemini-3.1-flash-image-preview",{"type":77,"tag":148,"props":3143,"children":3144},{"style":171},[3145],{"type":83,"value":457},{"type":77,"tag":148,"props":3147,"children":3148},{"style":177},[3149],{"type":83,"value":317},{"type":77,"tag":148,"props":3151,"children":3152},{"style":171},[3153],{"type":83,"value":475},{"type":77,"tag":148,"props":3155,"children":3156},{"class":150,"line":1183},[3157,3161,3165,3169,3174,3178],{"type":77,"tag":148,"props":3158,"children":3159},{"style":390},[3160],{"type":83,"value":2872},{"type":77,"tag":148,"props":3162,"children":3163},{"style":171},[3164],{"type":83,"value":306},{"type":77,"tag":148,"props":3166,"children":3167},{"style":171},[3168],{"type":83,"value":205},{"type":77,"tag":148,"props":3170,"children":3171},{"style":208},[3172],{"type":83,"value":3173},"A futuristic cityscape at night",{"type":77,"tag":148,"props":3175,"children":3176},{"style":171},[3177],{"type":83,"value":457},{"type":77,"tag":148,"props":3179,"children":3180},{"style":171},[3181],{"type":83,"value":475},{"type":77,"tag":148,"props":3183,"children":3184},{"class":150,"line":1236},[3185,3189,3193,3197,3202,3206],{"type":77,"tag":148,"props":3186,"children":3187},{"style":390},[3188],{"type":83,"value":2901},{"type":77,"tag":148,"props":3190,"children":3191},{"style":171},[3192],{"type":83,"value":306},{"type":77,"tag":148,"props":3194,"children":3195},{"style":171},[3196],{"type":83,"value":205},{"type":77,"tag":148,"props":3198,"children":3199},{"style":208},[3200],{"type":83,"value":3201},"16:9_4K",{"type":77,"tag":148,"props":3203,"children":3204},{"style":171},[3205],{"type":83,"value":457},{"type":77,"tag":148,"props":3207,"children":3208},{"style":171},[3209],{"type":83,"value":475},{"type":77,"tag":148,"props":3211,"children":3212},{"class":150,"line":1254},[3213,3217],{"type":77,"tag":148,"props":3214,"children":3215},{"style":171},[3216],{"type":83,"value":1114},{"type":77,"tag":148,"props":3218,"children":3219},{"style":177},[3220],{"type":83,"value":551},{"type":77,"tag":148,"props":3222,"children":3223},{"class":150,"line":1262},[3224],{"type":77,"tag":148,"props":3225,"children":3226},{"emptyLinePlaceholder":261},[3227],{"type":83,"value":264},{"type":77,"tag":148,"props":3229,"children":3230},{"class":150,"line":1332},[3231],{"type":77,"tag":148,"props":3232,"children":3233},{"style":155},[3234],{"type":83,"value":3235},"\u002F\u002F Gemini Imagen model\n",{"type":77,"tag":148,"props":3237,"children":3238},{"class":150,"line":1340},[3239,3243,3248,3252,3256,3260,3264],{"type":77,"tag":148,"props":3240,"children":3241},{"style":276},[3242],{"type":83,"value":2799},{"type":77,"tag":148,"props":3244,"children":3245},{"style":177},[3246],{"type":83,"value":3247}," imagenResult ",{"type":77,"tag":148,"props":3249,"children":3250},{"style":171},[3251],{"type":83,"value":1038},{"type":77,"tag":148,"props":3253,"children":3254},{"style":165},[3255],{"type":83,"value":372},{"type":77,"tag":148,"props":3257,"children":3258},{"style":287},[3259],{"type":83,"value":180},{"type":77,"tag":148,"props":3261,"children":3262},{"style":177},[3263],{"type":83,"value":295},{"type":77,"tag":148,"props":3265,"children":3266},{"style":171},[3267],{"type":83,"value":431},{"type":77,"tag":148,"props":3269,"children":3270},{"class":150,"line":1405},[3271,3275,3279,3283,3287,3291,3296,3300,3304],{"type":77,"tag":148,"props":3272,"children":3273},{"style":390},[3274],{"type":83,"value":2832},{"type":77,"tag":148,"props":3276,"children":3277},{"style":171},[3278],{"type":83,"value":306},{"type":77,"tag":148,"props":3280,"children":3281},{"style":287},[3282],{"type":83,"value":2755},{"type":77,"tag":148,"props":3284,"children":3285},{"style":177},[3286],{"type":83,"value":295},{"type":77,"tag":148,"props":3288,"children":3289},{"style":171},[3290],{"type":83,"value":457},{"type":77,"tag":148,"props":3292,"children":3293},{"style":208},[3294],{"type":83,"value":3295},"imagen-4.0-generate-001",{"type":77,"tag":148,"props":3297,"children":3298},{"style":171},[3299],{"type":83,"value":457},{"type":77,"tag":148,"props":3301,"children":3302},{"style":177},[3303],{"type":83,"value":317},{"type":77,"tag":148,"props":3305,"children":3306},{"style":171},[3307],{"type":83,"value":475},{"type":77,"tag":148,"props":3309,"children":3310},{"class":150,"line":1419},[3311,3315,3319,3323,3328,3332],{"type":77,"tag":148,"props":3312,"children":3313},{"style":390},[3314],{"type":83,"value":2872},{"type":77,"tag":148,"props":3316,"children":3317},{"style":171},[3318],{"type":83,"value":306},{"type":77,"tag":148,"props":3320,"children":3321},{"style":171},[3322],{"type":83,"value":205},{"type":77,"tag":148,"props":3324,"children":3325},{"style":208},[3326],{"type":83,"value":3327},"A landscape photo",{"type":77,"tag":148,"props":3329,"children":3330},{"style":171},[3331],{"type":83,"value":457},{"type":77,"tag":148,"props":3333,"children":3334},{"style":171},[3335],{"type":83,"value":475},{"type":77,"tag":148,"props":3337,"children":3338},{"class":150,"line":1441},[3339,3343,3347,3351,3356,3360,3364,3369,3373],{"type":77,"tag":148,"props":3340,"children":3341},{"style":390},[3342],{"type":83,"value":2952},{"type":77,"tag":148,"props":3344,"children":3345},{"style":171},[3346],{"type":83,"value":306},{"type":77,"tag":148,"props":3348,"children":3349},{"style":171},[3350],{"type":83,"value":174},{"type":77,"tag":148,"props":3352,"children":3353},{"style":390},[3354],{"type":83,"value":3355}," aspectRatio",{"type":77,"tag":148,"props":3357,"children":3358},{"style":171},[3359],{"type":83,"value":306},{"type":77,"tag":148,"props":3361,"children":3362},{"style":171},[3363],{"type":83,"value":205},{"type":77,"tag":148,"props":3365,"children":3366},{"style":208},[3367],{"type":83,"value":3368},"16:9",{"type":77,"tag":148,"props":3370,"children":3371},{"style":171},[3372],{"type":83,"value":457},{"type":77,"tag":148,"props":3374,"children":3375},{"style":171},[3376],{"type":83,"value":3377}," },\n",{"type":77,"tag":148,"props":3379,"children":3380},{"class":150,"line":1508},[3381,3385],{"type":77,"tag":148,"props":3382,"children":3383},{"style":171},[3384],{"type":83,"value":1114},{"type":77,"tag":148,"props":3386,"children":3387},{"style":177},[3388],{"type":83,"value":551},{"type":77,"tag":90,"props":3390,"children":3391},{},[3392,3394,3400,3402,3407,3409,3415,3417,3423,3425,3431],{"type":83,"value":3393},"Result shape: ",{"type":77,"tag":107,"props":3395,"children":3397},{"className":3396},[],[3398],{"type":83,"value":3399},"ImageGenerationResult",{"type":83,"value":3401}," with ",{"type":77,"tag":107,"props":3403,"children":3405},{"className":3404},[],[3406],{"type":83,"value":15},{"type":83,"value":3408}," array where each entry\nhas ",{"type":77,"tag":107,"props":3410,"children":3412},{"className":3411},[],[3413],{"type":83,"value":3414},"b64Json?",{"type":83,"value":3416},", ",{"type":77,"tag":107,"props":3418,"children":3420},{"className":3419},[],[3421],{"type":83,"value":3422},"url?",{"type":83,"value":3424},", and ",{"type":77,"tag":107,"props":3426,"children":3428},{"className":3427},[],[3429],{"type":83,"value":3430},"revisedPrompt?",{"type":83,"value":3432},". OpenAI image URLs expire\nafter 1 hour -- download or display immediately.",{"type":77,"tag":3434,"props":3435,"children":3437},"h4",{"id":3436},"image-conditioned-generation-multimodal-prompt-parts",[3438,3440,3445],{"type":83,"value":3439},"Image-conditioned generation: multimodal ",{"type":77,"tag":107,"props":3441,"children":3443},{"className":3442},[],[3444],{"type":83,"value":737},{"type":83,"value":3446}," parts",{"type":77,"tag":90,"props":3448,"children":3449},{},[3450,3452,3458,3460,3466,3468,3473,3475,3481,3483,3489,3491,3497,3498,3504,3506,3512,3514,3520],{"type":83,"value":3451},"Both ",{"type":77,"tag":107,"props":3453,"children":3455},{"className":3454},[],[3456],{"type":83,"value":3457},"generateImage()",{"type":83,"value":3459}," and ",{"type":77,"tag":107,"props":3461,"children":3463},{"className":3462},[],[3464],{"type":83,"value":3465},"generateVideo()",{"type":83,"value":3467}," accept the ",{"type":77,"tag":107,"props":3469,"children":3471},{"className":3470},[],[3472],{"type":83,"value":737},{"type":83,"value":3474}," either as\na plain string or as an ordered array of content parts (",{"type":77,"tag":107,"props":3476,"children":3478},{"className":3477},[],[3479],{"type":83,"value":3480},"TextPart",{"type":83,"value":3482}," \u002F\n",{"type":77,"tag":107,"props":3484,"children":3486},{"className":3485},[],[3487],{"type":83,"value":3488},"ImagePart",{"type":83,"value":3490}," \u002F ",{"type":77,"tag":107,"props":3492,"children":3494},{"className":3493},[],[3495],{"type":83,"value":3496},"VideoPart",{"type":83,"value":3490},{"type":77,"tag":107,"props":3499,"children":3501},{"className":3500},[],[3502],{"type":83,"value":3503},"AudioPart",{"type":83,"value":3505}," — the same shapes used elsewhere in\nTanStack AI). Part order is meaningful: natively multimodal providers\n(Gemini, OpenRouter) receive parts in order; named-field providers (OpenAI,\nfal, xAI) extract media parts and flatten the text. Prompt text is always\nsent verbatim — to reference inputs from the prompt, write the provider's\nown syntax (fal ",{"type":77,"tag":107,"props":3507,"children":3509},{"className":3508},[],[3510],{"type":83,"value":3511},"@Image1",{"type":83,"value":3513},", OpenAI \"image 1\" prose); the SDK never injects\nor rewrites markers. Each media part may carry an optional\n",{"type":77,"tag":107,"props":3515,"children":3517},{"className":3516},[],[3518],{"type":83,"value":3519},"metadata.role",{"type":83,"value":3521}," hint that adapters use to route the part to the\nprovider-specific field. The accepted part types are narrowed per model at\ncompile time via the adapter's input-modality map.",{"type":77,"tag":138,"props":3523,"children":3525},{"className":140,"code":3524,"language":51,"meta":142,"style":142},"import { generateImage } from '@tanstack\u002Fai'\nimport { openaiImage } from '@tanstack\u002Fai-openai'\n\n\u002F\u002F Image-to-image (OpenAI gpt-image-2 \u002F gpt-image-1, dall-e-2)\nawait generateImage({\n  adapter: openaiImage('gpt-image-2'),\n  prompt: [\n    { type: 'text', content: 'Turn this into a cinematic product photo' },\n    { type: 'image', source: { type: 'url', value: 'https:\u002F\u002F…\u002Fproduct.png' } },\n  ],\n})\n\n\u002F\u002F Multi-reference (up to 16 for gpt-image models; up to ~14 for Gemini native\n\u002F\u002F — a provider limit, not enforced by the SDK)\nawait generateImage({\n  adapter: openaiImage('gpt-image-2'),\n  prompt: [\n    { type: 'text', content: 'Apply the second image as style to the first' },\n    { type: 'image', source: { type: 'url', value: 'https:\u002F\u002F…\u002Fproduct.png' } },\n    { type: 'image', source: { type: 'url', value: 'https:\u002F\u002F…\u002Fstyle.png' } },\n  ],\n})\n\n\u002F\u002F Inpaint via metadata.role === 'mask' (OpenAI gpt-image models, dall-e-2; fal mask_url)\nawait generateImage({\n  adapter: openaiImage('gpt-image-2'),\n  prompt: [\n    { type: 'text', content: 'Replace the masked region with a tree' },\n    { type: 'image', source: { type: 'url', value: photoUrl } },\n    {\n      type: 'image',\n      source: { type: 'url', value: maskUrl },\n      metadata: { role: 'mask' },\n    },\n  ],\n})\n\n\u002F\u002F Image-to-video (OpenAI Sora: single input_reference; fal: image_url + optional end_image_url)\nimport { generateVideo } from '@tanstack\u002Fai'\nimport { falVideo } from '@tanstack\u002Fai-fal'\n\nawait generateVideo({\n  adapter: falVideo('fal-ai\u002Fkling-video\u002Fv3\u002Fpro\u002Fimage-to-video'),\n  prompt: [\n    { type: 'image', source: { type: 'url', value: firstFrameUrl } },\n    { type: 'text', content: 'Slow cinematic push-in' },\n    {\n      type: 'image',\n      source: { type: 'url', value: lastFrameUrl },\n      metadata: { role: 'end_frame' },\n    },\n  ],\n})\n",[3526],{"type":77,"tag":107,"props":3527,"children":3528},{"__ignoreMap":142},[3529,3564,3599,3606,3614,3634,3674,3690,3749,3849,3861,3872,3879,3887,3895,3914,3953,3968,4024,4119,4215,4226,4237,4244,4252,4271,4310,4325,4381,4469,4477,4505,4563,4605,4613,4624,4635,4642,4651,4688,4726,4734,4754,4795,4811,4900,4957,4965,4993,5050,5091,5099,5111],{"type":77,"tag":148,"props":3530,"children":3531},{"class":150,"line":151},[3532,3536,3540,3544,3548,3552,3556,3560],{"type":77,"tag":148,"props":3533,"children":3534},{"style":165},[3535],{"type":83,"value":168},{"type":77,"tag":148,"props":3537,"children":3538},{"style":171},[3539],{"type":83,"value":174},{"type":77,"tag":148,"props":3541,"children":3542},{"style":177},[3543],{"type":83,"value":180},{"type":77,"tag":148,"props":3545,"children":3546},{"style":171},[3547],{"type":83,"value":195},{"type":77,"tag":148,"props":3549,"children":3550},{"style":165},[3551],{"type":83,"value":200},{"type":77,"tag":148,"props":3553,"children":3554},{"style":171},[3555],{"type":83,"value":205},{"type":77,"tag":148,"props":3557,"children":3558},{"style":208},[3559],{"type":83,"value":211},{"type":77,"tag":148,"props":3561,"children":3562},{"style":171},[3563],{"type":83,"value":216},{"type":77,"tag":148,"props":3565,"children":3566},{"class":150,"line":161},[3567,3571,3575,3579,3583,3587,3591,3595],{"type":77,"tag":148,"props":3568,"children":3569},{"style":165},[3570],{"type":83,"value":168},{"type":77,"tag":148,"props":3572,"children":3573},{"style":171},[3574],{"type":83,"value":174},{"type":77,"tag":148,"props":3576,"children":3577},{"style":177},[3578],{"type":83,"value":233},{"type":77,"tag":148,"props":3580,"children":3581},{"style":171},[3582],{"type":83,"value":195},{"type":77,"tag":148,"props":3584,"children":3585},{"style":165},[3586],{"type":83,"value":200},{"type":77,"tag":148,"props":3588,"children":3589},{"style":171},[3590],{"type":83,"value":205},{"type":77,"tag":148,"props":3592,"children":3593},{"style":208},[3594],{"type":83,"value":250},{"type":77,"tag":148,"props":3596,"children":3597},{"style":171},[3598],{"type":83,"value":216},{"type":77,"tag":148,"props":3600,"children":3601},{"class":150,"line":219},[3602],{"type":77,"tag":148,"props":3603,"children":3604},{"emptyLinePlaceholder":261},[3605],{"type":83,"value":264},{"type":77,"tag":148,"props":3607,"children":3608},{"class":150,"line":257},[3609],{"type":77,"tag":148,"props":3610,"children":3611},{"style":155},[3612],{"type":83,"value":3613},"\u002F\u002F Image-to-image (OpenAI gpt-image-2 \u002F gpt-image-1, dall-e-2)\n",{"type":77,"tag":148,"props":3615,"children":3616},{"class":150,"line":267},[3617,3622,3626,3630],{"type":77,"tag":148,"props":3618,"children":3619},{"style":165},[3620],{"type":83,"value":3621},"await",{"type":77,"tag":148,"props":3623,"children":3624},{"style":287},[3625],{"type":83,"value":180},{"type":77,"tag":148,"props":3627,"children":3628},{"style":177},[3629],{"type":83,"value":295},{"type":77,"tag":148,"props":3631,"children":3632},{"style":171},[3633],{"type":83,"value":431},{"type":77,"tag":148,"props":3635,"children":3636},{"class":150,"line":325},[3637,3641,3645,3649,3653,3657,3662,3666,3670],{"type":77,"tag":148,"props":3638,"children":3639},{"style":390},[3640],{"type":83,"value":2832},{"type":77,"tag":148,"props":3642,"children":3643},{"style":171},[3644],{"type":83,"value":306},{"type":77,"tag":148,"props":3646,"children":3647},{"style":287},[3648],{"type":83,"value":233},{"type":77,"tag":148,"props":3650,"children":3651},{"style":177},[3652],{"type":83,"value":295},{"type":77,"tag":148,"props":3654,"children":3655},{"style":171},[3656],{"type":83,"value":457},{"type":77,"tag":148,"props":3658,"children":3659},{"style":208},[3660],{"type":83,"value":3661},"gpt-image-2",{"type":77,"tag":148,"props":3663,"children":3664},{"style":171},[3665],{"type":83,"value":457},{"type":77,"tag":148,"props":3667,"children":3668},{"style":177},[3669],{"type":83,"value":317},{"type":77,"tag":148,"props":3671,"children":3672},{"style":171},[3673],{"type":83,"value":475},{"type":77,"tag":148,"props":3675,"children":3676},{"class":150,"line":396},[3677,3681,3685],{"type":77,"tag":148,"props":3678,"children":3679},{"style":390},[3680],{"type":83,"value":2872},{"type":77,"tag":148,"props":3682,"children":3683},{"style":171},[3684],{"type":83,"value":306},{"type":77,"tag":148,"props":3686,"children":3687},{"style":177},[3688],{"type":83,"value":3689}," [\n",{"type":77,"tag":148,"props":3691,"children":3692},{"class":150,"line":404},[3693,3698,3703,3707,3711,3715,3719,3723,3728,3732,3736,3741,3745],{"type":77,"tag":148,"props":3694,"children":3695},{"style":171},[3696],{"type":83,"value":3697},"    {",{"type":77,"tag":148,"props":3699,"children":3700},{"style":390},[3701],{"type":83,"value":3702}," type",{"type":77,"tag":148,"props":3704,"children":3705},{"style":171},[3706],{"type":83,"value":306},{"type":77,"tag":148,"props":3708,"children":3709},{"style":171},[3710],{"type":83,"value":205},{"type":77,"tag":148,"props":3712,"children":3713},{"style":208},[3714],{"type":83,"value":83},{"type":77,"tag":148,"props":3716,"children":3717},{"style":171},[3718],{"type":83,"value":457},{"type":77,"tag":148,"props":3720,"children":3721},{"style":171},[3722],{"type":83,"value":185},{"type":77,"tag":148,"props":3724,"children":3725},{"style":390},[3726],{"type":83,"value":3727}," content",{"type":77,"tag":148,"props":3729,"children":3730},{"style":171},[3731],{"type":83,"value":306},{"type":77,"tag":148,"props":3733,"children":3734},{"style":171},[3735],{"type":83,"value":205},{"type":77,"tag":148,"props":3737,"children":3738},{"style":208},[3739],{"type":83,"value":3740},"Turn this into a cinematic product photo",{"type":77,"tag":148,"props":3742,"children":3743},{"style":171},[3744],{"type":83,"value":457},{"type":77,"tag":148,"props":3746,"children":3747},{"style":171},[3748],{"type":83,"value":3377},{"type":77,"tag":148,"props":3750,"children":3751},{"class":150,"line":434},[3752,3756,3760,3764,3768,3773,3777,3781,3786,3790,3794,3798,3802,3806,3811,3815,3819,3824,3828,3832,3837,3841,3845],{"type":77,"tag":148,"props":3753,"children":3754},{"style":171},[3755],{"type":83,"value":3697},{"type":77,"tag":148,"props":3757,"children":3758},{"style":390},[3759],{"type":83,"value":3702},{"type":77,"tag":148,"props":3761,"children":3762},{"style":171},[3763],{"type":83,"value":306},{"type":77,"tag":148,"props":3765,"children":3766},{"style":171},[3767],{"type":83,"value":205},{"type":77,"tag":148,"props":3769,"children":3770},{"style":208},[3771],{"type":83,"value":3772},"image",{"type":77,"tag":148,"props":3774,"children":3775},{"style":171},[3776],{"type":83,"value":457},{"type":77,"tag":148,"props":3778,"children":3779},{"style":171},[3780],{"type":83,"value":185},{"type":77,"tag":148,"props":3782,"children":3783},{"style":390},[3784],{"type":83,"value":3785}," source",{"type":77,"tag":148,"props":3787,"children":3788},{"style":171},[3789],{"type":83,"value":306},{"type":77,"tag":148,"props":3791,"children":3792},{"style":171},[3793],{"type":83,"value":174},{"type":77,"tag":148,"props":3795,"children":3796},{"style":390},[3797],{"type":83,"value":3702},{"type":77,"tag":148,"props":3799,"children":3800},{"style":171},[3801],{"type":83,"value":306},{"type":77,"tag":148,"props":3803,"children":3804},{"style":171},[3805],{"type":83,"value":205},{"type":77,"tag":148,"props":3807,"children":3808},{"style":208},[3809],{"type":83,"value":3810},"url",{"type":77,"tag":148,"props":3812,"children":3813},{"style":171},[3814],{"type":83,"value":457},{"type":77,"tag":148,"props":3816,"children":3817},{"style":171},[3818],{"type":83,"value":185},{"type":77,"tag":148,"props":3820,"children":3821},{"style":390},[3822],{"type":83,"value":3823}," value",{"type":77,"tag":148,"props":3825,"children":3826},{"style":171},[3827],{"type":83,"value":306},{"type":77,"tag":148,"props":3829,"children":3830},{"style":171},[3831],{"type":83,"value":205},{"type":77,"tag":148,"props":3833,"children":3834},{"style":208},[3835],{"type":83,"value":3836},"https:\u002F\u002F…\u002Fproduct.png",{"type":77,"tag":148,"props":3838,"children":3839},{"style":171},[3840],{"type":83,"value":457},{"type":77,"tag":148,"props":3842,"children":3843},{"style":171},[3844],{"type":83,"value":195},{"type":77,"tag":148,"props":3846,"children":3847},{"style":171},[3848],{"type":83,"value":3377},{"type":77,"tag":148,"props":3850,"children":3851},{"class":150,"line":478},[3852,3857],{"type":77,"tag":148,"props":3853,"children":3854},{"style":177},[3855],{"type":83,"value":3856},"  ]",{"type":77,"tag":148,"props":3858,"children":3859},{"style":171},[3860],{"type":83,"value":475},{"type":77,"tag":148,"props":3862,"children":3863},{"class":150,"line":491},[3864,3868],{"type":77,"tag":148,"props":3865,"children":3866},{"style":171},[3867],{"type":83,"value":1114},{"type":77,"tag":148,"props":3869,"children":3870},{"style":177},[3871],{"type":83,"value":551},{"type":77,"tag":148,"props":3873,"children":3874},{"class":150,"line":504},[3875],{"type":77,"tag":148,"props":3876,"children":3877},{"emptyLinePlaceholder":261},[3878],{"type":83,"value":264},{"type":77,"tag":148,"props":3880,"children":3881},{"class":150,"line":517},[3882],{"type":77,"tag":148,"props":3883,"children":3884},{"style":155},[3885],{"type":83,"value":3886},"\u002F\u002F Multi-reference (up to 16 for gpt-image models; up to ~14 for Gemini native\n",{"type":77,"tag":148,"props":3888,"children":3889},{"class":150,"line":540},[3890],{"type":77,"tag":148,"props":3891,"children":3892},{"style":155},[3893],{"type":83,"value":3894},"\u002F\u002F — a provider limit, not enforced by the SDK)\n",{"type":77,"tag":148,"props":3896,"children":3897},{"class":150,"line":554},[3898,3902,3906,3910],{"type":77,"tag":148,"props":3899,"children":3900},{"style":165},[3901],{"type":83,"value":3621},{"type":77,"tag":148,"props":3903,"children":3904},{"style":287},[3905],{"type":83,"value":180},{"type":77,"tag":148,"props":3907,"children":3908},{"style":177},[3909],{"type":83,"value":295},{"type":77,"tag":148,"props":3911,"children":3912},{"style":171},[3913],{"type":83,"value":431},{"type":77,"tag":148,"props":3915,"children":3916},{"class":150,"line":562},[3917,3921,3925,3929,3933,3937,3941,3945,3949],{"type":77,"tag":148,"props":3918,"children":3919},{"style":390},[3920],{"type":83,"value":2832},{"type":77,"tag":148,"props":3922,"children":3923},{"style":171},[3924],{"type":83,"value":306},{"type":77,"tag":148,"props":3926,"children":3927},{"style":287},[3928],{"type":83,"value":233},{"type":77,"tag":148,"props":3930,"children":3931},{"style":177},[3932],{"type":83,"value":295},{"type":77,"tag":148,"props":3934,"children":3935},{"style":171},[3936],{"type":83,"value":457},{"type":77,"tag":148,"props":3938,"children":3939},{"style":208},[3940],{"type":83,"value":3661},{"type":77,"tag":148,"props":3942,"children":3943},{"style":171},[3944],{"type":83,"value":457},{"type":77,"tag":148,"props":3946,"children":3947},{"style":177},[3948],{"type":83,"value":317},{"type":77,"tag":148,"props":3950,"children":3951},{"style":171},[3952],{"type":83,"value":475},{"type":77,"tag":148,"props":3954,"children":3955},{"class":150,"line":588},[3956,3960,3964],{"type":77,"tag":148,"props":3957,"children":3958},{"style":390},[3959],{"type":83,"value":2872},{"type":77,"tag":148,"props":3961,"children":3962},{"style":171},[3963],{"type":83,"value":306},{"type":77,"tag":148,"props":3965,"children":3966},{"style":177},[3967],{"type":83,"value":3689},{"type":77,"tag":148,"props":3969,"children":3970},{"class":150,"line":1076},[3971,3975,3979,3983,3987,3991,3995,3999,4003,4007,4011,4016,4020],{"type":77,"tag":148,"props":3972,"children":3973},{"style":171},[3974],{"type":83,"value":3697},{"type":77,"tag":148,"props":3976,"children":3977},{"style":390},[3978],{"type":83,"value":3702},{"type":77,"tag":148,"props":3980,"children":3981},{"style":171},[3982],{"type":83,"value":306},{"type":77,"tag":148,"props":3984,"children":3985},{"style":171},[3986],{"type":83,"value":205},{"type":77,"tag":148,"props":3988,"children":3989},{"style":208},[3990],{"type":83,"value":83},{"type":77,"tag":148,"props":3992,"children":3993},{"style":171},[3994],{"type":83,"value":457},{"type":77,"tag":148,"props":3996,"children":3997},{"style":171},[3998],{"type":83,"value":185},{"type":77,"tag":148,"props":4000,"children":4001},{"style":390},[4002],{"type":83,"value":3727},{"type":77,"tag":148,"props":4004,"children":4005},{"style":171},[4006],{"type":83,"value":306},{"type":77,"tag":148,"props":4008,"children":4009},{"style":171},[4010],{"type":83,"value":205},{"type":77,"tag":148,"props":4012,"children":4013},{"style":208},[4014],{"type":83,"value":4015},"Apply the second image as style to the first",{"type":77,"tag":148,"props":4017,"children":4018},{"style":171},[4019],{"type":83,"value":457},{"type":77,"tag":148,"props":4021,"children":4022},{"style":171},[4023],{"type":83,"value":3377},{"type":77,"tag":148,"props":4025,"children":4026},{"class":150,"line":1125},[4027,4031,4035,4039,4043,4047,4051,4055,4059,4063,4067,4071,4075,4079,4083,4087,4091,4095,4099,4103,4107,4111,4115],{"type":77,"tag":148,"props":4028,"children":4029},{"style":171},[4030],{"type":83,"value":3697},{"type":77,"tag":148,"props":4032,"children":4033},{"style":390},[4034],{"type":83,"value":3702},{"type":77,"tag":148,"props":4036,"children":4037},{"style":171},[4038],{"type":83,"value":306},{"type":77,"tag":148,"props":4040,"children":4041},{"style":171},[4042],{"type":83,"value":205},{"type":77,"tag":148,"props":4044,"children":4045},{"style":208},[4046],{"type":83,"value":3772},{"type":77,"tag":148,"props":4048,"children":4049},{"style":171},[4050],{"type":83,"value":457},{"type":77,"tag":148,"props":4052,"children":4053},{"style":171},[4054],{"type":83,"value":185},{"type":77,"tag":148,"props":4056,"children":4057},{"style":390},[4058],{"type":83,"value":3785},{"type":77,"tag":148,"props":4060,"children":4061},{"style":171},[4062],{"type":83,"value":306},{"type":77,"tag":148,"props":4064,"children":4065},{"style":171},[4066],{"type":83,"value":174},{"type":77,"tag":148,"props":4068,"children":4069},{"style":390},[4070],{"type":83,"value":3702},{"type":77,"tag":148,"props":4072,"children":4073},{"style":171},[4074],{"type":83,"value":306},{"type":77,"tag":148,"props":4076,"children":4077},{"style":171},[4078],{"type":83,"value":205},{"type":77,"tag":148,"props":4080,"children":4081},{"style":208},[4082],{"type":83,"value":3810},{"type":77,"tag":148,"props":4084,"children":4085},{"style":171},[4086],{"type":83,"value":457},{"type":77,"tag":148,"props":4088,"children":4089},{"style":171},[4090],{"type":83,"value":185},{"type":77,"tag":148,"props":4092,"children":4093},{"style":390},[4094],{"type":83,"value":3823},{"type":77,"tag":148,"props":4096,"children":4097},{"style":171},[4098],{"type":83,"value":306},{"type":77,"tag":148,"props":4100,"children":4101},{"style":171},[4102],{"type":83,"value":205},{"type":77,"tag":148,"props":4104,"children":4105},{"style":208},[4106],{"type":83,"value":3836},{"type":77,"tag":148,"props":4108,"children":4109},{"style":171},[4110],{"type":83,"value":457},{"type":77,"tag":148,"props":4112,"children":4113},{"style":171},[4114],{"type":83,"value":195},{"type":77,"tag":148,"props":4116,"children":4117},{"style":171},[4118],{"type":83,"value":3377},{"type":77,"tag":148,"props":4120,"children":4121},{"class":150,"line":1174},[4122,4126,4130,4134,4138,4142,4146,4150,4154,4158,4162,4166,4170,4174,4178,4182,4186,4190,4194,4198,4203,4207,4211],{"type":77,"tag":148,"props":4123,"children":4124},{"style":171},[4125],{"type":83,"value":3697},{"type":77,"tag":148,"props":4127,"children":4128},{"style":390},[4129],{"type":83,"value":3702},{"type":77,"tag":148,"props":4131,"children":4132},{"style":171},[4133],{"type":83,"value":306},{"type":77,"tag":148,"props":4135,"children":4136},{"style":171},[4137],{"type":83,"value":205},{"type":77,"tag":148,"props":4139,"children":4140},{"style":208},[4141],{"type":83,"value":3772},{"type":77,"tag":148,"props":4143,"children":4144},{"style":171},[4145],{"type":83,"value":457},{"type":77,"tag":148,"props":4147,"children":4148},{"style":171},[4149],{"type":83,"value":185},{"type":77,"tag":148,"props":4151,"children":4152},{"style":390},[4153],{"type":83,"value":3785},{"type":77,"tag":148,"props":4155,"children":4156},{"style":171},[4157],{"type":83,"value":306},{"type":77,"tag":148,"props":4159,"children":4160},{"style":171},[4161],{"type":83,"value":174},{"type":77,"tag":148,"props":4163,"children":4164},{"style":390},[4165],{"type":83,"value":3702},{"type":77,"tag":148,"props":4167,"children":4168},{"style":171},[4169],{"type":83,"value":306},{"type":77,"tag":148,"props":4171,"children":4172},{"style":171},[4173],{"type":83,"value":205},{"type":77,"tag":148,"props":4175,"children":4176},{"style":208},[4177],{"type":83,"value":3810},{"type":77,"tag":148,"props":4179,"children":4180},{"style":171},[4181],{"type":83,"value":457},{"type":77,"tag":148,"props":4183,"children":4184},{"style":171},[4185],{"type":83,"value":185},{"type":77,"tag":148,"props":4187,"children":4188},{"style":390},[4189],{"type":83,"value":3823},{"type":77,"tag":148,"props":4191,"children":4192},{"style":171},[4193],{"type":83,"value":306},{"type":77,"tag":148,"props":4195,"children":4196},{"style":171},[4197],{"type":83,"value":205},{"type":77,"tag":148,"props":4199,"children":4200},{"style":208},[4201],{"type":83,"value":4202},"https:\u002F\u002F…\u002Fstyle.png",{"type":77,"tag":148,"props":4204,"children":4205},{"style":171},[4206],{"type":83,"value":457},{"type":77,"tag":148,"props":4208,"children":4209},{"style":171},[4210],{"type":83,"value":195},{"type":77,"tag":148,"props":4212,"children":4213},{"style":171},[4214],{"type":83,"value":3377},{"type":77,"tag":148,"props":4216,"children":4217},{"class":150,"line":1183},[4218,4222],{"type":77,"tag":148,"props":4219,"children":4220},{"style":177},[4221],{"type":83,"value":3856},{"type":77,"tag":148,"props":4223,"children":4224},{"style":171},[4225],{"type":83,"value":475},{"type":77,"tag":148,"props":4227,"children":4228},{"class":150,"line":1236},[4229,4233],{"type":77,"tag":148,"props":4230,"children":4231},{"style":171},[4232],{"type":83,"value":1114},{"type":77,"tag":148,"props":4234,"children":4235},{"style":177},[4236],{"type":83,"value":551},{"type":77,"tag":148,"props":4238,"children":4239},{"class":150,"line":1254},[4240],{"type":77,"tag":148,"props":4241,"children":4242},{"emptyLinePlaceholder":261},[4243],{"type":83,"value":264},{"type":77,"tag":148,"props":4245,"children":4246},{"class":150,"line":1262},[4247],{"type":77,"tag":148,"props":4248,"children":4249},{"style":155},[4250],{"type":83,"value":4251},"\u002F\u002F Inpaint via metadata.role === 'mask' (OpenAI gpt-image models, dall-e-2; fal mask_url)\n",{"type":77,"tag":148,"props":4253,"children":4254},{"class":150,"line":1332},[4255,4259,4263,4267],{"type":77,"tag":148,"props":4256,"children":4257},{"style":165},[4258],{"type":83,"value":3621},{"type":77,"tag":148,"props":4260,"children":4261},{"style":287},[4262],{"type":83,"value":180},{"type":77,"tag":148,"props":4264,"children":4265},{"style":177},[4266],{"type":83,"value":295},{"type":77,"tag":148,"props":4268,"children":4269},{"style":171},[4270],{"type":83,"value":431},{"type":77,"tag":148,"props":4272,"children":4273},{"class":150,"line":1340},[4274,4278,4282,4286,4290,4294,4298,4302,4306],{"type":77,"tag":148,"props":4275,"children":4276},{"style":390},[4277],{"type":83,"value":2832},{"type":77,"tag":148,"props":4279,"children":4280},{"style":171},[4281],{"type":83,"value":306},{"type":77,"tag":148,"props":4283,"children":4284},{"style":287},[4285],{"type":83,"value":233},{"type":77,"tag":148,"props":4287,"children":4288},{"style":177},[4289],{"type":83,"value":295},{"type":77,"tag":148,"props":4291,"children":4292},{"style":171},[4293],{"type":83,"value":457},{"type":77,"tag":148,"props":4295,"children":4296},{"style":208},[4297],{"type":83,"value":3661},{"type":77,"tag":148,"props":4299,"children":4300},{"style":171},[4301],{"type":83,"value":457},{"type":77,"tag":148,"props":4303,"children":4304},{"style":177},[4305],{"type":83,"value":317},{"type":77,"tag":148,"props":4307,"children":4308},{"style":171},[4309],{"type":83,"value":475},{"type":77,"tag":148,"props":4311,"children":4312},{"class":150,"line":1405},[4313,4317,4321],{"type":77,"tag":148,"props":4314,"children":4315},{"style":390},[4316],{"type":83,"value":2872},{"type":77,"tag":148,"props":4318,"children":4319},{"style":171},[4320],{"type":83,"value":306},{"type":77,"tag":148,"props":4322,"children":4323},{"style":177},[4324],{"type":83,"value":3689},{"type":77,"tag":148,"props":4326,"children":4327},{"class":150,"line":1419},[4328,4332,4336,4340,4344,4348,4352,4356,4360,4364,4368,4373,4377],{"type":77,"tag":148,"props":4329,"children":4330},{"style":171},[4331],{"type":83,"value":3697},{"type":77,"tag":148,"props":4333,"children":4334},{"style":390},[4335],{"type":83,"value":3702},{"type":77,"tag":148,"props":4337,"children":4338},{"style":171},[4339],{"type":83,"value":306},{"type":77,"tag":148,"props":4341,"children":4342},{"style":171},[4343],{"type":83,"value":205},{"type":77,"tag":148,"props":4345,"children":4346},{"style":208},[4347],{"type":83,"value":83},{"type":77,"tag":148,"props":4349,"children":4350},{"style":171},[4351],{"type":83,"value":457},{"type":77,"tag":148,"props":4353,"children":4354},{"style":171},[4355],{"type":83,"value":185},{"type":77,"tag":148,"props":4357,"children":4358},{"style":390},[4359],{"type":83,"value":3727},{"type":77,"tag":148,"props":4361,"children":4362},{"style":171},[4363],{"type":83,"value":306},{"type":77,"tag":148,"props":4365,"children":4366},{"style":171},[4367],{"type":83,"value":205},{"type":77,"tag":148,"props":4369,"children":4370},{"style":208},[4371],{"type":83,"value":4372},"Replace the masked region with a tree",{"type":77,"tag":148,"props":4374,"children":4375},{"style":171},[4376],{"type":83,"value":457},{"type":77,"tag":148,"props":4378,"children":4379},{"style":171},[4380],{"type":83,"value":3377},{"type":77,"tag":148,"props":4382,"children":4383},{"class":150,"line":1441},[4384,4388,4392,4396,4400,4404,4408,4412,4416,4420,4424,4428,4432,4436,4440,4444,4448,4452,4456,4461,4465],{"type":77,"tag":148,"props":4385,"children":4386},{"style":171},[4387],{"type":83,"value":3697},{"type":77,"tag":148,"props":4389,"children":4390},{"style":390},[4391],{"type":83,"value":3702},{"type":77,"tag":148,"props":4393,"children":4394},{"style":171},[4395],{"type":83,"value":306},{"type":77,"tag":148,"props":4397,"children":4398},{"style":171},[4399],{"type":83,"value":205},{"type":77,"tag":148,"props":4401,"children":4402},{"style":208},[4403],{"type":83,"value":3772},{"type":77,"tag":148,"props":4405,"children":4406},{"style":171},[4407],{"type":83,"value":457},{"type":77,"tag":148,"props":4409,"children":4410},{"style":171},[4411],{"type":83,"value":185},{"type":77,"tag":148,"props":4413,"children":4414},{"style":390},[4415],{"type":83,"value":3785},{"type":77,"tag":148,"props":4417,"children":4418},{"style":171},[4419],{"type":83,"value":306},{"type":77,"tag":148,"props":4421,"children":4422},{"style":171},[4423],{"type":83,"value":174},{"type":77,"tag":148,"props":4425,"children":4426},{"style":390},[4427],{"type":83,"value":3702},{"type":77,"tag":148,"props":4429,"children":4430},{"style":171},[4431],{"type":83,"value":306},{"type":77,"tag":148,"props":4433,"children":4434},{"style":171},[4435],{"type":83,"value":205},{"type":77,"tag":148,"props":4437,"children":4438},{"style":208},[4439],{"type":83,"value":3810},{"type":77,"tag":148,"props":4441,"children":4442},{"style":171},[4443],{"type":83,"value":457},{"type":77,"tag":148,"props":4445,"children":4446},{"style":171},[4447],{"type":83,"value":185},{"type":77,"tag":148,"props":4449,"children":4450},{"style":390},[4451],{"type":83,"value":3823},{"type":77,"tag":148,"props":4453,"children":4454},{"style":171},[4455],{"type":83,"value":306},{"type":77,"tag":148,"props":4457,"children":4458},{"style":177},[4459],{"type":83,"value":4460}," photoUrl ",{"type":77,"tag":148,"props":4462,"children":4463},{"style":171},[4464],{"type":83,"value":1114},{"type":77,"tag":148,"props":4466,"children":4467},{"style":171},[4468],{"type":83,"value":3377},{"type":77,"tag":148,"props":4470,"children":4471},{"class":150,"line":1508},[4472],{"type":77,"tag":148,"props":4473,"children":4474},{"style":171},[4475],{"type":83,"value":4476},"    {\n",{"type":77,"tag":148,"props":4478,"children":4479},{"class":150,"line":1555},[4480,4485,4489,4493,4497,4501],{"type":77,"tag":148,"props":4481,"children":4482},{"style":390},[4483],{"type":83,"value":4484},"      type",{"type":77,"tag":148,"props":4486,"children":4487},{"style":171},[4488],{"type":83,"value":306},{"type":77,"tag":148,"props":4490,"children":4491},{"style":171},[4492],{"type":83,"value":205},{"type":77,"tag":148,"props":4494,"children":4495},{"style":208},[4496],{"type":83,"value":3772},{"type":77,"tag":148,"props":4498,"children":4499},{"style":171},[4500],{"type":83,"value":457},{"type":77,"tag":148,"props":4502,"children":4503},{"style":171},[4504],{"type":83,"value":475},{"type":77,"tag":148,"props":4506,"children":4507},{"class":150,"line":1564},[4508,4513,4517,4521,4525,4529,4533,4537,4541,4545,4549,4553,4558],{"type":77,"tag":148,"props":4509,"children":4510},{"style":390},[4511],{"type":83,"value":4512},"      source",{"type":77,"tag":148,"props":4514,"children":4515},{"style":171},[4516],{"type":83,"value":306},{"type":77,"tag":148,"props":4518,"children":4519},{"style":171},[4520],{"type":83,"value":174},{"type":77,"tag":148,"props":4522,"children":4523},{"style":390},[4524],{"type":83,"value":3702},{"type":77,"tag":148,"props":4526,"children":4527},{"style":171},[4528],{"type":83,"value":306},{"type":77,"tag":148,"props":4530,"children":4531},{"style":171},[4532],{"type":83,"value":205},{"type":77,"tag":148,"props":4534,"children":4535},{"style":208},[4536],{"type":83,"value":3810},{"type":77,"tag":148,"props":4538,"children":4539},{"style":171},[4540],{"type":83,"value":457},{"type":77,"tag":148,"props":4542,"children":4543},{"style":171},[4544],{"type":83,"value":185},{"type":77,"tag":148,"props":4546,"children":4547},{"style":390},[4548],{"type":83,"value":3823},{"type":77,"tag":148,"props":4550,"children":4551},{"style":171},[4552],{"type":83,"value":306},{"type":77,"tag":148,"props":4554,"children":4555},{"style":177},[4556],{"type":83,"value":4557}," maskUrl ",{"type":77,"tag":148,"props":4559,"children":4560},{"style":171},[4561],{"type":83,"value":4562},"},\n",{"type":77,"tag":148,"props":4564,"children":4565},{"class":150,"line":1577},[4566,4571,4575,4579,4584,4588,4592,4597,4601],{"type":77,"tag":148,"props":4567,"children":4568},{"style":390},[4569],{"type":83,"value":4570},"      metadata",{"type":77,"tag":148,"props":4572,"children":4573},{"style":171},[4574],{"type":83,"value":306},{"type":77,"tag":148,"props":4576,"children":4577},{"style":171},[4578],{"type":83,"value":174},{"type":77,"tag":148,"props":4580,"children":4581},{"style":390},[4582],{"type":83,"value":4583}," role",{"type":77,"tag":148,"props":4585,"children":4586},{"style":171},[4587],{"type":83,"value":306},{"type":77,"tag":148,"props":4589,"children":4590},{"style":171},[4591],{"type":83,"value":205},{"type":77,"tag":148,"props":4593,"children":4594},{"style":208},[4595],{"type":83,"value":4596},"mask",{"type":77,"tag":148,"props":4598,"children":4599},{"style":171},[4600],{"type":83,"value":457},{"type":77,"tag":148,"props":4602,"children":4603},{"style":171},[4604],{"type":83,"value":3377},{"type":77,"tag":148,"props":4606,"children":4607},{"class":150,"line":1585},[4608],{"type":77,"tag":148,"props":4609,"children":4610},{"style":171},[4611],{"type":83,"value":4612},"    },\n",{"type":77,"tag":148,"props":4614,"children":4615},{"class":150,"line":1647},[4616,4620],{"type":77,"tag":148,"props":4617,"children":4618},{"style":177},[4619],{"type":83,"value":3856},{"type":77,"tag":148,"props":4621,"children":4622},{"style":171},[4623],{"type":83,"value":475},{"type":77,"tag":148,"props":4625,"children":4626},{"class":150,"line":1664},[4627,4631],{"type":77,"tag":148,"props":4628,"children":4629},{"style":171},[4630],{"type":83,"value":1114},{"type":77,"tag":148,"props":4632,"children":4633},{"style":177},[4634],{"type":83,"value":551},{"type":77,"tag":148,"props":4636,"children":4637},{"class":150,"line":1673},[4638],{"type":77,"tag":148,"props":4639,"children":4640},{"emptyLinePlaceholder":261},[4641],{"type":83,"value":264},{"type":77,"tag":148,"props":4643,"children":4645},{"class":150,"line":4644},38,[4646],{"type":77,"tag":148,"props":4647,"children":4648},{"style":155},[4649],{"type":83,"value":4650},"\u002F\u002F Image-to-video (OpenAI Sora: single input_reference; fal: image_url + optional end_image_url)\n",{"type":77,"tag":148,"props":4652,"children":4654},{"class":150,"line":4653},39,[4655,4659,4663,4668,4672,4676,4680,4684],{"type":77,"tag":148,"props":4656,"children":4657},{"style":165},[4658],{"type":83,"value":168},{"type":77,"tag":148,"props":4660,"children":4661},{"style":171},[4662],{"type":83,"value":174},{"type":77,"tag":148,"props":4664,"children":4665},{"style":177},[4666],{"type":83,"value":4667}," generateVideo",{"type":77,"tag":148,"props":4669,"children":4670},{"style":171},[4671],{"type":83,"value":195},{"type":77,"tag":148,"props":4673,"children":4674},{"style":165},[4675],{"type":83,"value":200},{"type":77,"tag":148,"props":4677,"children":4678},{"style":171},[4679],{"type":83,"value":205},{"type":77,"tag":148,"props":4681,"children":4682},{"style":208},[4683],{"type":83,"value":211},{"type":77,"tag":148,"props":4685,"children":4686},{"style":171},[4687],{"type":83,"value":216},{"type":77,"tag":148,"props":4689,"children":4691},{"class":150,"line":4690},40,[4692,4696,4700,4705,4709,4713,4717,4722],{"type":77,"tag":148,"props":4693,"children":4694},{"style":165},[4695],{"type":83,"value":168},{"type":77,"tag":148,"props":4697,"children":4698},{"style":171},[4699],{"type":83,"value":174},{"type":77,"tag":148,"props":4701,"children":4702},{"style":177},[4703],{"type":83,"value":4704}," falVideo",{"type":77,"tag":148,"props":4706,"children":4707},{"style":171},[4708],{"type":83,"value":195},{"type":77,"tag":148,"props":4710,"children":4711},{"style":165},[4712],{"type":83,"value":200},{"type":77,"tag":148,"props":4714,"children":4715},{"style":171},[4716],{"type":83,"value":205},{"type":77,"tag":148,"props":4718,"children":4719},{"style":208},[4720],{"type":83,"value":4721},"@tanstack\u002Fai-fal",{"type":77,"tag":148,"props":4723,"children":4724},{"style":171},[4725],{"type":83,"value":216},{"type":77,"tag":148,"props":4727,"children":4729},{"class":150,"line":4728},41,[4730],{"type":77,"tag":148,"props":4731,"children":4732},{"emptyLinePlaceholder":261},[4733],{"type":83,"value":264},{"type":77,"tag":148,"props":4735,"children":4737},{"class":150,"line":4736},42,[4738,4742,4746,4750],{"type":77,"tag":148,"props":4739,"children":4740},{"style":165},[4741],{"type":83,"value":3621},{"type":77,"tag":148,"props":4743,"children":4744},{"style":287},[4745],{"type":83,"value":4667},{"type":77,"tag":148,"props":4747,"children":4748},{"style":177},[4749],{"type":83,"value":295},{"type":77,"tag":148,"props":4751,"children":4752},{"style":171},[4753],{"type":83,"value":431},{"type":77,"tag":148,"props":4755,"children":4757},{"class":150,"line":4756},43,[4758,4762,4766,4770,4774,4778,4783,4787,4791],{"type":77,"tag":148,"props":4759,"children":4760},{"style":390},[4761],{"type":83,"value":2832},{"type":77,"tag":148,"props":4763,"children":4764},{"style":171},[4765],{"type":83,"value":306},{"type":77,"tag":148,"props":4767,"children":4768},{"style":287},[4769],{"type":83,"value":4704},{"type":77,"tag":148,"props":4771,"children":4772},{"style":177},[4773],{"type":83,"value":295},{"type":77,"tag":148,"props":4775,"children":4776},{"style":171},[4777],{"type":83,"value":457},{"type":77,"tag":148,"props":4779,"children":4780},{"style":208},[4781],{"type":83,"value":4782},"fal-ai\u002Fkling-video\u002Fv3\u002Fpro\u002Fimage-to-video",{"type":77,"tag":148,"props":4784,"children":4785},{"style":171},[4786],{"type":83,"value":457},{"type":77,"tag":148,"props":4788,"children":4789},{"style":177},[4790],{"type":83,"value":317},{"type":77,"tag":148,"props":4792,"children":4793},{"style":171},[4794],{"type":83,"value":475},{"type":77,"tag":148,"props":4796,"children":4798},{"class":150,"line":4797},44,[4799,4803,4807],{"type":77,"tag":148,"props":4800,"children":4801},{"style":390},[4802],{"type":83,"value":2872},{"type":77,"tag":148,"props":4804,"children":4805},{"style":171},[4806],{"type":83,"value":306},{"type":77,"tag":148,"props":4808,"children":4809},{"style":177},[4810],{"type":83,"value":3689},{"type":77,"tag":148,"props":4812,"children":4814},{"class":150,"line":4813},45,[4815,4819,4823,4827,4831,4835,4839,4843,4847,4851,4855,4859,4863,4867,4871,4875,4879,4883,4887,4892,4896],{"type":77,"tag":148,"props":4816,"children":4817},{"style":171},[4818],{"type":83,"value":3697},{"type":77,"tag":148,"props":4820,"children":4821},{"style":390},[4822],{"type":83,"value":3702},{"type":77,"tag":148,"props":4824,"children":4825},{"style":171},[4826],{"type":83,"value":306},{"type":77,"tag":148,"props":4828,"children":4829},{"style":171},[4830],{"type":83,"value":205},{"type":77,"tag":148,"props":4832,"children":4833},{"style":208},[4834],{"type":83,"value":3772},{"type":77,"tag":148,"props":4836,"children":4837},{"style":171},[4838],{"type":83,"value":457},{"type":77,"tag":148,"props":4840,"children":4841},{"style":171},[4842],{"type":83,"value":185},{"type":77,"tag":148,"props":4844,"children":4845},{"style":390},[4846],{"type":83,"value":3785},{"type":77,"tag":148,"props":4848,"children":4849},{"style":171},[4850],{"type":83,"value":306},{"type":77,"tag":148,"props":4852,"children":4853},{"style":171},[4854],{"type":83,"value":174},{"type":77,"tag":148,"props":4856,"children":4857},{"style":390},[4858],{"type":83,"value":3702},{"type":77,"tag":148,"props":4860,"children":4861},{"style":171},[4862],{"type":83,"value":306},{"type":77,"tag":148,"props":4864,"children":4865},{"style":171},[4866],{"type":83,"value":205},{"type":77,"tag":148,"props":4868,"children":4869},{"style":208},[4870],{"type":83,"value":3810},{"type":77,"tag":148,"props":4872,"children":4873},{"style":171},[4874],{"type":83,"value":457},{"type":77,"tag":148,"props":4876,"children":4877},{"style":171},[4878],{"type":83,"value":185},{"type":77,"tag":148,"props":4880,"children":4881},{"style":390},[4882],{"type":83,"value":3823},{"type":77,"tag":148,"props":4884,"children":4885},{"style":171},[4886],{"type":83,"value":306},{"type":77,"tag":148,"props":4888,"children":4889},{"style":177},[4890],{"type":83,"value":4891}," firstFrameUrl ",{"type":77,"tag":148,"props":4893,"children":4894},{"style":171},[4895],{"type":83,"value":1114},{"type":77,"tag":148,"props":4897,"children":4898},{"style":171},[4899],{"type":83,"value":3377},{"type":77,"tag":148,"props":4901,"children":4903},{"class":150,"line":4902},46,[4904,4908,4912,4916,4920,4924,4928,4932,4936,4940,4944,4949,4953],{"type":77,"tag":148,"props":4905,"children":4906},{"style":171},[4907],{"type":83,"value":3697},{"type":77,"tag":148,"props":4909,"children":4910},{"style":390},[4911],{"type":83,"value":3702},{"type":77,"tag":148,"props":4913,"children":4914},{"style":171},[4915],{"type":83,"value":306},{"type":77,"tag":148,"props":4917,"children":4918},{"style":171},[4919],{"type":83,"value":205},{"type":77,"tag":148,"props":4921,"children":4922},{"style":208},[4923],{"type":83,"value":83},{"type":77,"tag":148,"props":4925,"children":4926},{"style":171},[4927],{"type":83,"value":457},{"type":77,"tag":148,"props":4929,"children":4930},{"style":171},[4931],{"type":83,"value":185},{"type":77,"tag":148,"props":4933,"children":4934},{"style":390},[4935],{"type":83,"value":3727},{"type":77,"tag":148,"props":4937,"children":4938},{"style":171},[4939],{"type":83,"value":306},{"type":77,"tag":148,"props":4941,"children":4942},{"style":171},[4943],{"type":83,"value":205},{"type":77,"tag":148,"props":4945,"children":4946},{"style":208},[4947],{"type":83,"value":4948},"Slow cinematic push-in",{"type":77,"tag":148,"props":4950,"children":4951},{"style":171},[4952],{"type":83,"value":457},{"type":77,"tag":148,"props":4954,"children":4955},{"style":171},[4956],{"type":83,"value":3377},{"type":77,"tag":148,"props":4958,"children":4960},{"class":150,"line":4959},47,[4961],{"type":77,"tag":148,"props":4962,"children":4963},{"style":171},[4964],{"type":83,"value":4476},{"type":77,"tag":148,"props":4966,"children":4968},{"class":150,"line":4967},48,[4969,4973,4977,4981,4985,4989],{"type":77,"tag":148,"props":4970,"children":4971},{"style":390},[4972],{"type":83,"value":4484},{"type":77,"tag":148,"props":4974,"children":4975},{"style":171},[4976],{"type":83,"value":306},{"type":77,"tag":148,"props":4978,"children":4979},{"style":171},[4980],{"type":83,"value":205},{"type":77,"tag":148,"props":4982,"children":4983},{"style":208},[4984],{"type":83,"value":3772},{"type":77,"tag":148,"props":4986,"children":4987},{"style":171},[4988],{"type":83,"value":457},{"type":77,"tag":148,"props":4990,"children":4991},{"style":171},[4992],{"type":83,"value":475},{"type":77,"tag":148,"props":4994,"children":4996},{"class":150,"line":4995},49,[4997,5001,5005,5009,5013,5017,5021,5025,5029,5033,5037,5041,5046],{"type":77,"tag":148,"props":4998,"children":4999},{"style":390},[5000],{"type":83,"value":4512},{"type":77,"tag":148,"props":5002,"children":5003},{"style":171},[5004],{"type":83,"value":306},{"type":77,"tag":148,"props":5006,"children":5007},{"style":171},[5008],{"type":83,"value":174},{"type":77,"tag":148,"props":5010,"children":5011},{"style":390},[5012],{"type":83,"value":3702},{"type":77,"tag":148,"props":5014,"children":5015},{"style":171},[5016],{"type":83,"value":306},{"type":77,"tag":148,"props":5018,"children":5019},{"style":171},[5020],{"type":83,"value":205},{"type":77,"tag":148,"props":5022,"children":5023},{"style":208},[5024],{"type":83,"value":3810},{"type":77,"tag":148,"props":5026,"children":5027},{"style":171},[5028],{"type":83,"value":457},{"type":77,"tag":148,"props":5030,"children":5031},{"style":171},[5032],{"type":83,"value":185},{"type":77,"tag":148,"props":5034,"children":5035},{"style":390},[5036],{"type":83,"value":3823},{"type":77,"tag":148,"props":5038,"children":5039},{"style":171},[5040],{"type":83,"value":306},{"type":77,"tag":148,"props":5042,"children":5043},{"style":177},[5044],{"type":83,"value":5045}," lastFrameUrl ",{"type":77,"tag":148,"props":5047,"children":5048},{"style":171},[5049],{"type":83,"value":4562},{"type":77,"tag":148,"props":5051,"children":5053},{"class":150,"line":5052},50,[5054,5058,5062,5066,5070,5074,5078,5083,5087],{"type":77,"tag":148,"props":5055,"children":5056},{"style":390},[5057],{"type":83,"value":4570},{"type":77,"tag":148,"props":5059,"children":5060},{"style":171},[5061],{"type":83,"value":306},{"type":77,"tag":148,"props":5063,"children":5064},{"style":171},[5065],{"type":83,"value":174},{"type":77,"tag":148,"props":5067,"children":5068},{"style":390},[5069],{"type":83,"value":4583},{"type":77,"tag":148,"props":5071,"children":5072},{"style":171},[5073],{"type":83,"value":306},{"type":77,"tag":148,"props":5075,"children":5076},{"style":171},[5077],{"type":83,"value":205},{"type":77,"tag":148,"props":5079,"children":5080},{"style":208},[5081],{"type":83,"value":5082},"end_frame",{"type":77,"tag":148,"props":5084,"children":5085},{"style":171},[5086],{"type":83,"value":457},{"type":77,"tag":148,"props":5088,"children":5089},{"style":171},[5090],{"type":83,"value":3377},{"type":77,"tag":148,"props":5092,"children":5094},{"class":150,"line":5093},51,[5095],{"type":77,"tag":148,"props":5096,"children":5097},{"style":171},[5098],{"type":83,"value":4612},{"type":77,"tag":148,"props":5100,"children":5102},{"class":150,"line":5101},52,[5103,5107],{"type":77,"tag":148,"props":5104,"children":5105},{"style":177},[5106],{"type":83,"value":3856},{"type":77,"tag":148,"props":5108,"children":5109},{"style":171},[5110],{"type":83,"value":475},{"type":77,"tag":148,"props":5112,"children":5114},{"class":150,"line":5113},53,[5115,5119],{"type":77,"tag":148,"props":5116,"children":5117},{"style":171},[5118],{"type":83,"value":1114},{"type":77,"tag":148,"props":5120,"children":5121},{"style":177},[5122],{"type":83,"value":551},{"type":77,"tag":90,"props":5124,"children":5125},{},[5126,5131,5133,5139,5141,5147,5149,5155,5157,5162,5164,5170,5172,5177,5179,5185,5187,5192,5194,5200,5202,5208,5210,5216,5217,5223,5225,5230],{"type":77,"tag":94,"props":5127,"children":5128},{},[5129],{"type":83,"value":5130},"URL inputs that require an upload throw by default.",{"type":83,"value":5132}," Most adapters pass a\n",{"type":77,"tag":107,"props":5134,"children":5136},{"className":5135},[],[5137],{"type":83,"value":5138},"type: 'url'",{"type":83,"value":5140}," source straight through to the provider. Three paths can't —\nOpenAI ",{"type":77,"tag":107,"props":5142,"children":5144},{"className":5143},[],[5145],{"type":83,"value":5146},"images.edit()",{"type":83,"value":5148},", OpenAI Sora ",{"type":77,"tag":107,"props":5150,"children":5152},{"className":5151},[],[5153],{"type":83,"value":5154},"input_reference",{"type":83,"value":5156},", and Gemini ",{"type":77,"tag":94,"props":5158,"children":5159},{},[5160],{"type":83,"value":5161},"Veo",{"type":83,"value":5163}," —\nbecause the provider only accepts uploaded bytes (Veo also takes a ",{"type":77,"tag":107,"props":5165,"children":5167},{"className":5166},[],[5168],{"type":83,"value":5169},"gs:\u002F\u002F",{"type":83,"value":5171},"\nreference). For those, an HTTP(S) URL would have to be downloaded and buffered\nin memory, which can OOM constrained runtimes, so they ",{"type":77,"tag":94,"props":5173,"children":5174},{},[5175],{"type":83,"value":5176},"throw",{"type":83,"value":5178}," on an HTTP(S)\nURL image input by default. Pass a ",{"type":77,"tag":107,"props":5180,"children":5182},{"className":5181},[],[5183],{"type":83,"value":5184},"data:",{"type":83,"value":5186}," URI (or ",{"type":77,"tag":107,"props":5188,"children":5190},{"className":5189},[],[5191],{"type":83,"value":5169},{"type":83,"value":5193}," for Veo), or opt in\nwith ",{"type":77,"tag":107,"props":5195,"children":5197},{"className":5196},[],[5198],{"type":83,"value":5199},"allowUrlFetch: true",{"type":83,"value":5201}," on the adapter config\n(",{"type":77,"tag":107,"props":5203,"children":5205},{"className":5204},[],[5206],{"type":83,"value":5207},"createOpenaiImage(model, apiKey, { allowUrlFetch: true })",{"type":83,"value":5209},", and likewise on\n",{"type":77,"tag":107,"props":5211,"children":5213},{"className":5212},[],[5214],{"type":83,"value":5215},"createOpenaiVideo",{"type":83,"value":3490},{"type":77,"tag":107,"props":5218,"children":5220},{"className":5219},[],[5221],{"type":83,"value":5222},"createGeminiVideo",{"type":83,"value":5224},"). ",{"type":77,"tag":107,"props":5226,"children":5228},{"className":5227},[],[5229],{"type":83,"value":5184},{"type":83,"value":5231}," URIs never need the flag.",{"type":77,"tag":90,"props":5233,"children":5234},{},[5235,5240,5241,5246],{"type":77,"tag":94,"props":5236,"children":5237},{},[5238],{"type":83,"value":5239},"Role hints",{"type":83,"value":2369},{"type":77,"tag":107,"props":5242,"children":5244},{"className":5243},[],[5245],{"type":83,"value":3519},{"type":83,"value":5247},"):",{"type":77,"tag":5249,"props":5250,"children":5251},"table",{},[5252,5271],{"type":77,"tag":5253,"props":5254,"children":5255},"thead",{},[5256],{"type":77,"tag":5257,"props":5258,"children":5259},"tr",{},[5260,5266],{"type":77,"tag":5261,"props":5262,"children":5263},"th",{},[5264],{"type":83,"value":5265},"Role",{"type":77,"tag":5261,"props":5267,"children":5268},{},[5269],{"type":83,"value":5270},"Maps to",{"type":77,"tag":5272,"props":5273,"children":5274},"tbody",{},[5275,5301,5333,5363,5387,5426],{"type":77,"tag":5257,"props":5276,"children":5277},{},[5278,5288],{"type":77,"tag":5279,"props":5280,"children":5281},"td",{},[5282],{"type":77,"tag":107,"props":5283,"children":5285},{"className":5284},[],[5286],{"type":83,"value":5287},"'reference'",{"type":77,"tag":5279,"props":5289,"children":5290},{},[5291,5293,5299],{"type":83,"value":5292},"fal ",{"type":77,"tag":107,"props":5294,"children":5296},{"className":5295},[],[5297],{"type":83,"value":5298},"reference_image_urls",{"type":83,"value":5300},"; Gemini multimodal part; positional otherwise",{"type":77,"tag":5257,"props":5302,"children":5303},{},[5304,5313],{"type":77,"tag":5279,"props":5305,"children":5306},{},[5307],{"type":77,"tag":107,"props":5308,"children":5310},{"className":5309},[],[5311],{"type":83,"value":5312},"'character'",{"type":77,"tag":5279,"props":5314,"children":5315},{},[5316,5318,5323,5325,5331],{"type":83,"value":5317},"Same as ",{"type":77,"tag":107,"props":5319,"children":5321},{"className":5320},[],[5322],{"type":83,"value":5287},{"type":83,"value":5324},"; Veo ",{"type":77,"tag":107,"props":5326,"children":5328},{"className":5327},[],[5329],{"type":83,"value":5330},"referenceImages",{"type":83,"value":5332}," slot (planned — no Veo adapter yet)",{"type":77,"tag":5257,"props":5334,"children":5335},{},[5336,5345],{"type":77,"tag":5279,"props":5337,"children":5338},{},[5339],{"type":77,"tag":107,"props":5340,"children":5342},{"className":5341},[],[5343],{"type":83,"value":5344},"'mask'",{"type":77,"tag":5279,"props":5346,"children":5347},{},[5348,5350,5355,5357],{"type":83,"value":5349},"OpenAI ",{"type":77,"tag":107,"props":5351,"children":5353},{"className":5352},[],[5354],{"type":83,"value":4596},{"type":83,"value":5356}," (gpt-image-2, gpt-image-1, dall-e-2); fal ",{"type":77,"tag":107,"props":5358,"children":5360},{"className":5359},[],[5361],{"type":83,"value":5362},"mask_url",{"type":77,"tag":5257,"props":5364,"children":5365},{},[5366,5375],{"type":77,"tag":5279,"props":5367,"children":5368},{},[5369],{"type":77,"tag":107,"props":5370,"children":5372},{"className":5371},[],[5373],{"type":83,"value":5374},"'control'",{"type":77,"tag":5279,"props":5376,"children":5377},{},[5378,5379,5385],{"type":83,"value":5292},{"type":77,"tag":107,"props":5380,"children":5382},{"className":5381},[],[5383],{"type":83,"value":5384},"control_image_url",{"type":83,"value":5386}," (ControlNet \u002F depth \u002F pose)",{"type":77,"tag":5257,"props":5388,"children":5389},{},[5390,5399],{"type":77,"tag":5279,"props":5391,"children":5392},{},[5393],{"type":77,"tag":107,"props":5394,"children":5396},{"className":5395},[],[5397],{"type":83,"value":5398},"'start_frame'",{"type":77,"tag":5279,"props":5400,"children":5401},{},[5402,5403,5409,5411,5417,5419,5424],{"type":83,"value":5292},{"type":77,"tag":107,"props":5404,"children":5406},{"className":5405},[],[5407],{"type":83,"value":5408},"start_image_url",{"type":83,"value":5410}," (or the endpoint's field, e.g. ",{"type":77,"tag":107,"props":5412,"children":5414},{"className":5413},[],[5415],{"type":83,"value":5416},"image_url",{"type":83,"value":5418}," on Kling i2v); Veo ",{"type":77,"tag":107,"props":5420,"children":5422},{"className":5421},[],[5423],{"type":83,"value":3772},{"type":83,"value":5425}," (planned)",{"type":77,"tag":5257,"props":5427,"children":5428},{},[5429,5438],{"type":77,"tag":5279,"props":5430,"children":5431},{},[5432],{"type":77,"tag":107,"props":5433,"children":5435},{"className":5434},[],[5436],{"type":83,"value":5437},"'end_frame'",{"type":77,"tag":5279,"props":5439,"children":5440},{},[5441,5442,5448,5450,5456,5457,5463,5465,5471],{"type":83,"value":5292},{"type":77,"tag":107,"props":5443,"children":5445},{"className":5444},[],[5446],{"type":83,"value":5447},"end_image_url",{"type":83,"value":5449}," (or e.g. ",{"type":77,"tag":107,"props":5451,"children":5453},{"className":5452},[],[5454],{"type":83,"value":5455},"tail_image_url",{"type":83,"value":3490},{"type":77,"tag":107,"props":5458,"children":5460},{"className":5459},[],[5461],{"type":83,"value":5462},"last_frame_url",{"type":83,"value":5464},"); Veo ",{"type":77,"tag":107,"props":5466,"children":5468},{"className":5467},[],[5469],{"type":83,"value":5470},"lastFrame",{"type":83,"value":5425},{"type":77,"tag":90,"props":5473,"children":5474},{},[5475],{"type":77,"tag":94,"props":5476,"children":5477},{},[5478],{"type":83,"value":5479},"Provider support matrix:",{"type":77,"tag":5249,"props":5481,"children":5482},{},[5483,5515],{"type":77,"tag":5253,"props":5484,"children":5485},{},[5486],{"type":77,"tag":5257,"props":5487,"children":5488},{},[5489,5494,5505],{"type":77,"tag":5261,"props":5490,"children":5491},{},[5492],{"type":83,"value":5493},"Provider",{"type":77,"tag":5261,"props":5495,"children":5496},{},[5497,5503],{"type":77,"tag":107,"props":5498,"children":5500},{"className":5499},[],[5501],{"type":83,"value":5502},"generateImage",{"type":83,"value":5504}," image parts",{"type":77,"tag":5261,"props":5506,"children":5507},{},[5508,5514],{"type":77,"tag":107,"props":5509,"children":5511},{"className":5510},[],[5512],{"type":83,"value":5513},"generateVideo",{"type":83,"value":5504},{"type":77,"tag":5272,"props":5516,"children":5517},{},[5518,5550,5576,5688,5714,5744],{"type":77,"tag":5257,"props":5519,"children":5520},{},[5521,5526,5538],{"type":77,"tag":5279,"props":5522,"children":5523},{},[5524],{"type":83,"value":5525},"OpenAI",{"type":77,"tag":5279,"props":5527,"children":5528},{},[5529,5531,5536],{"type":83,"value":5530},"gpt-image-2 \u002F gpt-image-1 \u002F -mini → ",{"type":77,"tag":107,"props":5532,"children":5534},{"className":5533},[],[5535],{"type":83,"value":5146},{"type":83,"value":5537}," (up to 16). dall-e-2 → edit (1). dall-e-3 throws.",{"type":77,"tag":5279,"props":5539,"children":5540},{},[5541,5543,5548],{"type":83,"value":5542},"Sora-2 \u002F -pro → ",{"type":77,"tag":107,"props":5544,"children":5546},{"className":5545},[],[5547],{"type":83,"value":5154},{"type":83,"value":5549}," (single). Throws if >1.",{"type":77,"tag":5257,"props":5551,"children":5552},{},[5553,5558,5571],{"type":77,"tag":5279,"props":5554,"children":5555},{},[5556],{"type":83,"value":5557},"Gemini",{"type":77,"tag":5279,"props":5559,"children":5560},{},[5561,5563,5569],{"type":83,"value":5562},"Native (gemini-*-flash-image, \"nano-banana\") → multimodal ",{"type":77,"tag":107,"props":5564,"children":5566},{"className":5565},[],[5567],{"type":83,"value":5568},"contents",{"type":83,"value":5570},". Imagen throws.",{"type":77,"tag":5279,"props":5572,"children":5573},{},[5574],{"type":83,"value":5575},"No native Veo adapter yet — deferred to a follow-up.",{"type":77,"tag":5257,"props":5577,"children":5578},{},[5579,5584,5630],{"type":77,"tag":5279,"props":5580,"children":5581},{},[5582],{"type":83,"value":5583},"fal",{"type":77,"tag":5279,"props":5585,"children":5586},{},[5587,5589,5595,5597,5602,5604,5610,5612,5617,5618,5623,5624,5629],{"type":83,"value":5588},"Per-endpoint field names from a generated map (",{"type":77,"tag":107,"props":5590,"children":5592},{"className":5591},[],[5593],{"type":83,"value":5594},"pnpm generate:fal-image-fields",{"type":83,"value":5596},"). Defaults: 1 input → ",{"type":77,"tag":107,"props":5598,"children":5600},{"className":5599},[],[5601],{"type":83,"value":5416},{"type":83,"value":5603},"; >1 → ",{"type":77,"tag":107,"props":5605,"children":5607},{"className":5606},[],[5608],{"type":83,"value":5609},"image_urls",{"type":83,"value":5611},"; roles → ",{"type":77,"tag":107,"props":5613,"children":5615},{"className":5614},[],[5616],{"type":83,"value":5362},{"type":83,"value":3490},{"type":77,"tag":107,"props":5619,"children":5621},{"className":5620},[],[5622],{"type":83,"value":5384},{"type":83,"value":3490},{"type":77,"tag":107,"props":5625,"children":5627},{"className":5626},[],[5628],{"type":83,"value":5298},{"type":83,"value":382},{"type":77,"tag":5279,"props":5631,"children":5632},{},[5633,5635,5640,5641,5646,5648,5654,5656,5661,5663,5668,5669,5674,5675,5681,5682,5687],{"type":83,"value":5634},"Per-endpoint map (e.g. Kling i2v start frame → ",{"type":77,"tag":107,"props":5636,"children":5638},{"className":5637},[],[5639],{"type":83,"value":5416},{"type":83,"value":5596},{"type":77,"tag":107,"props":5642,"children":5644},{"className":5643},[],[5645],{"type":83,"value":5416},{"type":83,"value":5647},"; ",{"type":77,"tag":107,"props":5649,"children":5651},{"className":5650},[],[5652],{"type":83,"value":5653},"start_frame",{"type":83,"value":5655},"\u002F",{"type":77,"tag":107,"props":5657,"children":5659},{"className":5658},[],[5660],{"type":83,"value":5082},{"type":83,"value":5662}," → ",{"type":77,"tag":107,"props":5664,"children":5666},{"className":5665},[],[5667],{"type":83,"value":5408},{"type":83,"value":5655},{"type":77,"tag":107,"props":5670,"children":5672},{"className":5671},[],[5673],{"type":83,"value":5447},{"type":83,"value":5647},{"type":77,"tag":107,"props":5676,"children":5678},{"className":5677},[],[5679],{"type":83,"value":5680},"reference",{"type":83,"value":5662},{"type":77,"tag":107,"props":5683,"children":5685},{"className":5684},[],[5686],{"type":83,"value":5298},{"type":83,"value":382},{"type":77,"tag":5257,"props":5689,"children":5690},{},[5691,5696,5709],{"type":77,"tag":5279,"props":5692,"children":5693},{},[5694],{"type":83,"value":5695},"Grok",{"type":77,"tag":5279,"props":5697,"children":5698},{},[5699,5701,5707],{"type":83,"value":5700},"grok-imagine models → ",{"type":77,"tag":107,"props":5702,"children":5704},{"className":5703},[],[5705],{"type":83,"value":5706},"\u002Fv1\u002Fimages\u002Fedits",{"type":83,"value":5708}," JSON endpoint (≤3 sources, addressed by xAI in request order; prompt sent verbatim; mask\u002Fcontrol throw). grok-2-image-1212 throws.",{"type":77,"tag":5279,"props":5710,"children":5711},{},[5712],{"type":83,"value":5713},"n\u002Fa",{"type":77,"tag":5257,"props":5715,"children":5716},{},[5717,5722,5740],{"type":77,"tag":5279,"props":5718,"children":5719},{},[5720],{"type":83,"value":5721},"OpenRouter",{"type":77,"tag":5279,"props":5723,"children":5724},{},[5725,5727,5732,5733,5738],{"type":83,"value":5726},"Prompt parts map 1:1 onto multimodal ",{"type":77,"tag":107,"props":5728,"children":5730},{"className":5729},[],[5731],{"type":83,"value":83},{"type":83,"value":3490},{"type":77,"tag":107,"props":5734,"children":5736},{"className":5735},[],[5737],{"type":83,"value":5416},{"type":83,"value":5739}," content parts, preserving interleaved order.",{"type":77,"tag":5279,"props":5741,"children":5742},{},[5743],{"type":83,"value":5713},{"type":77,"tag":5257,"props":5745,"children":5746},{},[5747,5752,5757],{"type":77,"tag":5279,"props":5748,"children":5749},{},[5750],{"type":83,"value":5751},"Anthropic",{"type":77,"tag":5279,"props":5753,"children":5754},{},[5755],{"type":83,"value":5756},"n\u002Fa (no image generation API).",{"type":77,"tag":5279,"props":5758,"children":5759},{},[5760],{"type":83,"value":5713},{"type":77,"tag":90,"props":5762,"children":5763},{},[5764,5766,5771],{"type":83,"value":5765},"Video and audio prompt parts follow the same ",{"type":77,"tag":107,"props":5767,"children":5769},{"className":5768},[],[5770],{"type":83,"value":3519},{"type":83,"value":5772}," convention\nfor video-to-video and lipsync flows on fal; other providers throw when\nthey're passed.",{"type":77,"tag":131,"props":5774,"children":5776},{"id":5775},"_2-audio-generation-music-sound-effects",[5777],{"type":83,"value":5778},"2. Audio Generation (Music, Sound Effects)",{"type":77,"tag":90,"props":5780,"children":5781},{},[5782,5784,5790,5792,5798,5800,5806],{"type":83,"value":5783},"Distinct from TTS — ",{"type":77,"tag":107,"props":5785,"children":5787},{"className":5786},[],[5788],{"type":83,"value":5789},"generateAudio()",{"type":83,"value":5791}," produces non-speech audio content.\nSupported adapters: ",{"type":77,"tag":107,"props":5793,"children":5795},{"className":5794},[],[5796],{"type":83,"value":5797},"geminiAudio",{"type":83,"value":5799}," (Lyria 3 Pro \u002F Lyria 3 Clip) and\n",{"type":77,"tag":107,"props":5801,"children":5803},{"className":5802},[],[5804],{"type":83,"value":5805},"falAudio",{"type":83,"value":5807}," (MiniMax Music, DiffRhythm, Stable Audio, ElevenLabs SFX, etc.).",{"type":77,"tag":138,"props":5809,"children":5811},{"className":140,"code":5810,"language":51,"meta":142,"style":142},"import { generateAudio } from '@tanstack\u002Fai'\nimport { falAudio } from '@tanstack\u002Fai-fal'\n\nconst result = await generateAudio({\n  adapter: falAudio('fal-ai\u002Fdiffrhythm'),\n  prompt: 'An upbeat electronic track with synths',\n  duration: 10,\n})\n\n\u002F\u002F result.audio.url or result.audio.b64Json (provider-dependent)\n\u002F\u002F result.audio.contentType e.g. \"audio\u002Fmpeg\"\n",[5812],{"type":77,"tag":107,"props":5813,"children":5814},{"__ignoreMap":142},[5815,5851,5887,5894,5926,5966,5994,6015,6026,6033,6041],{"type":77,"tag":148,"props":5816,"children":5817},{"class":150,"line":151},[5818,5822,5826,5831,5835,5839,5843,5847],{"type":77,"tag":148,"props":5819,"children":5820},{"style":165},[5821],{"type":83,"value":168},{"type":77,"tag":148,"props":5823,"children":5824},{"style":171},[5825],{"type":83,"value":174},{"type":77,"tag":148,"props":5827,"children":5828},{"style":177},[5829],{"type":83,"value":5830}," generateAudio",{"type":77,"tag":148,"props":5832,"children":5833},{"style":171},[5834],{"type":83,"value":195},{"type":77,"tag":148,"props":5836,"children":5837},{"style":165},[5838],{"type":83,"value":200},{"type":77,"tag":148,"props":5840,"children":5841},{"style":171},[5842],{"type":83,"value":205},{"type":77,"tag":148,"props":5844,"children":5845},{"style":208},[5846],{"type":83,"value":211},{"type":77,"tag":148,"props":5848,"children":5849},{"style":171},[5850],{"type":83,"value":216},{"type":77,"tag":148,"props":5852,"children":5853},{"class":150,"line":161},[5854,5858,5862,5867,5871,5875,5879,5883],{"type":77,"tag":148,"props":5855,"children":5856},{"style":165},[5857],{"type":83,"value":168},{"type":77,"tag":148,"props":5859,"children":5860},{"style":171},[5861],{"type":83,"value":174},{"type":77,"tag":148,"props":5863,"children":5864},{"style":177},[5865],{"type":83,"value":5866}," falAudio",{"type":77,"tag":148,"props":5868,"children":5869},{"style":171},[5870],{"type":83,"value":195},{"type":77,"tag":148,"props":5872,"children":5873},{"style":165},[5874],{"type":83,"value":200},{"type":77,"tag":148,"props":5876,"children":5877},{"style":171},[5878],{"type":83,"value":205},{"type":77,"tag":148,"props":5880,"children":5881},{"style":208},[5882],{"type":83,"value":4721},{"type":77,"tag":148,"props":5884,"children":5885},{"style":171},[5886],{"type":83,"value":216},{"type":77,"tag":148,"props":5888,"children":5889},{"class":150,"line":219},[5890],{"type":77,"tag":148,"props":5891,"children":5892},{"emptyLinePlaceholder":261},[5893],{"type":83,"value":264},{"type":77,"tag":148,"props":5895,"children":5896},{"class":150,"line":257},[5897,5901,5906,5910,5914,5918,5922],{"type":77,"tag":148,"props":5898,"children":5899},{"style":276},[5900],{"type":83,"value":2799},{"type":77,"tag":148,"props":5902,"children":5903},{"style":177},[5904],{"type":83,"value":5905}," result ",{"type":77,"tag":148,"props":5907,"children":5908},{"style":171},[5909],{"type":83,"value":1038},{"type":77,"tag":148,"props":5911,"children":5912},{"style":165},[5913],{"type":83,"value":372},{"type":77,"tag":148,"props":5915,"children":5916},{"style":287},[5917],{"type":83,"value":5830},{"type":77,"tag":148,"props":5919,"children":5920},{"style":177},[5921],{"type":83,"value":295},{"type":77,"tag":148,"props":5923,"children":5924},{"style":171},[5925],{"type":83,"value":431},{"type":77,"tag":148,"props":5927,"children":5928},{"class":150,"line":267},[5929,5933,5937,5941,5945,5949,5954,5958,5962],{"type":77,"tag":148,"props":5930,"children":5931},{"style":390},[5932],{"type":83,"value":2832},{"type":77,"tag":148,"props":5934,"children":5935},{"style":171},[5936],{"type":83,"value":306},{"type":77,"tag":148,"props":5938,"children":5939},{"style":287},[5940],{"type":83,"value":5866},{"type":77,"tag":148,"props":5942,"children":5943},{"style":177},[5944],{"type":83,"value":295},{"type":77,"tag":148,"props":5946,"children":5947},{"style":171},[5948],{"type":83,"value":457},{"type":77,"tag":148,"props":5950,"children":5951},{"style":208},[5952],{"type":83,"value":5953},"fal-ai\u002Fdiffrhythm",{"type":77,"tag":148,"props":5955,"children":5956},{"style":171},[5957],{"type":83,"value":457},{"type":77,"tag":148,"props":5959,"children":5960},{"style":177},[5961],{"type":83,"value":317},{"type":77,"tag":148,"props":5963,"children":5964},{"style":171},[5965],{"type":83,"value":475},{"type":77,"tag":148,"props":5967,"children":5968},{"class":150,"line":325},[5969,5973,5977,5981,5986,5990],{"type":77,"tag":148,"props":5970,"children":5971},{"style":390},[5972],{"type":83,"value":2872},{"type":77,"tag":148,"props":5974,"children":5975},{"style":171},[5976],{"type":83,"value":306},{"type":77,"tag":148,"props":5978,"children":5979},{"style":171},[5980],{"type":83,"value":205},{"type":77,"tag":148,"props":5982,"children":5983},{"style":208},[5984],{"type":83,"value":5985},"An upbeat electronic track with synths",{"type":77,"tag":148,"props":5987,"children":5988},{"style":171},[5989],{"type":83,"value":457},{"type":77,"tag":148,"props":5991,"children":5992},{"style":171},[5993],{"type":83,"value":475},{"type":77,"tag":148,"props":5995,"children":5996},{"class":150,"line":396},[5997,6002,6006,6011],{"type":77,"tag":148,"props":5998,"children":5999},{"style":390},[6000],{"type":83,"value":6001},"  duration",{"type":77,"tag":148,"props":6003,"children":6004},{"style":171},[6005],{"type":83,"value":306},{"type":77,"tag":148,"props":6007,"children":6008},{"style":2937},[6009],{"type":83,"value":6010}," 10",{"type":77,"tag":148,"props":6012,"children":6013},{"style":171},[6014],{"type":83,"value":475},{"type":77,"tag":148,"props":6016,"children":6017},{"class":150,"line":404},[6018,6022],{"type":77,"tag":148,"props":6019,"children":6020},{"style":171},[6021],{"type":83,"value":1114},{"type":77,"tag":148,"props":6023,"children":6024},{"style":177},[6025],{"type":83,"value":551},{"type":77,"tag":148,"props":6027,"children":6028},{"class":150,"line":434},[6029],{"type":77,"tag":148,"props":6030,"children":6031},{"emptyLinePlaceholder":261},[6032],{"type":83,"value":264},{"type":77,"tag":148,"props":6034,"children":6035},{"class":150,"line":478},[6036],{"type":77,"tag":148,"props":6037,"children":6038},{"style":155},[6039],{"type":83,"value":6040},"\u002F\u002F result.audio.url or result.audio.b64Json (provider-dependent)\n",{"type":77,"tag":148,"props":6042,"children":6043},{"class":150,"line":491},[6044],{"type":77,"tag":148,"props":6045,"children":6046},{"style":155},[6047],{"type":83,"value":6048},"\u002F\u002F result.audio.contentType e.g. \"audio\u002Fmpeg\"\n",{"type":77,"tag":90,"props":6050,"children":6051},{},[6052],{"type":83,"value":6053},"Client hook:",{"type":77,"tag":138,"props":6055,"children":6057},{"className":603,"code":6056,"language":605,"meta":142,"style":142},"import { useGenerateAudio, fetchServerSentEvents } from '@tanstack\u002Fai-react'\n\nconst { generate, result, isLoading } = useGenerateAudio({\n  connection: fetchServerSentEvents('\u002Fapi\u002Fgenerate\u002Faudio'),\n})\n\n\u002F\u002F Trigger: generate({ prompt: 'Upbeat synths', duration: 10 })\n\u002F\u002F Play:    \u003Caudio src={result.audio.url} controls \u002F>\n",[6058],{"type":77,"tag":107,"props":6059,"children":6060},{"__ignoreMap":142},[6061,6105,6112,6164,6205,6216,6223,6231],{"type":77,"tag":148,"props":6062,"children":6063},{"class":150,"line":151},[6064,6068,6072,6077,6081,6085,6089,6093,6097,6101],{"type":77,"tag":148,"props":6065,"children":6066},{"style":165},[6067],{"type":83,"value":168},{"type":77,"tag":148,"props":6069,"children":6070},{"style":171},[6071],{"type":83,"value":174},{"type":77,"tag":148,"props":6073,"children":6074},{"style":177},[6075],{"type":83,"value":6076}," useGenerateAudio",{"type":77,"tag":148,"props":6078,"children":6079},{"style":171},[6080],{"type":83,"value":185},{"type":77,"tag":148,"props":6082,"children":6083},{"style":177},[6084],{"type":83,"value":634},{"type":77,"tag":148,"props":6086,"children":6087},{"style":171},[6088],{"type":83,"value":195},{"type":77,"tag":148,"props":6090,"children":6091},{"style":165},[6092],{"type":83,"value":200},{"type":77,"tag":148,"props":6094,"children":6095},{"style":171},[6096],{"type":83,"value":205},{"type":77,"tag":148,"props":6098,"children":6099},{"style":208},[6100],{"type":83,"value":651},{"type":77,"tag":148,"props":6102,"children":6103},{"style":171},[6104],{"type":83,"value":216},{"type":77,"tag":148,"props":6106,"children":6107},{"class":150,"line":161},[6108],{"type":77,"tag":148,"props":6109,"children":6110},{"emptyLinePlaceholder":261},[6111],{"type":83,"value":264},{"type":77,"tag":148,"props":6113,"children":6114},{"class":150,"line":219},[6115,6119,6123,6127,6131,6135,6139,6144,6148,6152,6156,6160],{"type":77,"tag":148,"props":6116,"children":6117},{"style":276},[6118],{"type":83,"value":2799},{"type":77,"tag":148,"props":6120,"children":6121},{"style":171},[6122],{"type":83,"value":174},{"type":77,"tag":148,"props":6124,"children":6125},{"style":177},[6126],{"type":83,"value":788},{"type":77,"tag":148,"props":6128,"children":6129},{"style":171},[6130],{"type":83,"value":185},{"type":77,"tag":148,"props":6132,"children":6133},{"style":177},[6134],{"type":83,"value":797},{"type":77,"tag":148,"props":6136,"children":6137},{"style":171},[6138],{"type":83,"value":185},{"type":77,"tag":148,"props":6140,"children":6141},{"style":177},[6142],{"type":83,"value":6143}," isLoading ",{"type":77,"tag":148,"props":6145,"children":6146},{"style":171},[6147],{"type":83,"value":1114},{"type":77,"tag":148,"props":6149,"children":6150},{"style":171},[6151],{"type":83,"value":367},{"type":77,"tag":148,"props":6153,"children":6154},{"style":287},[6155],{"type":83,"value":6076},{"type":77,"tag":148,"props":6157,"children":6158},{"style":177},[6159],{"type":83,"value":295},{"type":77,"tag":148,"props":6161,"children":6162},{"style":171},[6163],{"type":83,"value":431},{"type":77,"tag":148,"props":6165,"children":6166},{"class":150,"line":257},[6167,6172,6176,6180,6184,6188,6193,6197,6201],{"type":77,"tag":148,"props":6168,"children":6169},{"style":390},[6170],{"type":83,"value":6171},"  connection",{"type":77,"tag":148,"props":6173,"children":6174},{"style":171},[6175],{"type":83,"value":306},{"type":77,"tag":148,"props":6177,"children":6178},{"style":287},[6179],{"type":83,"value":634},{"type":77,"tag":148,"props":6181,"children":6182},{"style":177},[6183],{"type":83,"value":295},{"type":77,"tag":148,"props":6185,"children":6186},{"style":171},[6187],{"type":83,"value":457},{"type":77,"tag":148,"props":6189,"children":6190},{"style":208},[6191],{"type":83,"value":6192},"\u002Fapi\u002Fgenerate\u002Faudio",{"type":77,"tag":148,"props":6194,"children":6195},{"style":171},[6196],{"type":83,"value":457},{"type":77,"tag":148,"props":6198,"children":6199},{"style":177},[6200],{"type":83,"value":317},{"type":77,"tag":148,"props":6202,"children":6203},{"style":171},[6204],{"type":83,"value":475},{"type":77,"tag":148,"props":6206,"children":6207},{"class":150,"line":267},[6208,6212],{"type":77,"tag":148,"props":6209,"children":6210},{"style":171},[6211],{"type":83,"value":1114},{"type":77,"tag":148,"props":6213,"children":6214},{"style":177},[6215],{"type":83,"value":551},{"type":77,"tag":148,"props":6217,"children":6218},{"class":150,"line":325},[6219],{"type":77,"tag":148,"props":6220,"children":6221},{"emptyLinePlaceholder":261},[6222],{"type":83,"value":264},{"type":77,"tag":148,"props":6224,"children":6225},{"class":150,"line":396},[6226],{"type":77,"tag":148,"props":6227,"children":6228},{"style":155},[6229],{"type":83,"value":6230},"\u002F\u002F Trigger: generate({ prompt: 'Upbeat synths', duration: 10 })\n",{"type":77,"tag":148,"props":6232,"children":6233},{"class":150,"line":404},[6234],{"type":77,"tag":148,"props":6235,"children":6236},{"style":155},[6237],{"type":83,"value":6238},"\u002F\u002F Play:    \u003Caudio src={result.audio.url} controls \u002F>\n",{"type":77,"tag":131,"props":6240,"children":6242},{"id":6241},"_3-text-to-speech",[6243],{"type":83,"value":6244},"3. Text-to-Speech",{"type":77,"tag":90,"props":6246,"children":6247},{},[6248,6250,6256],{"type":83,"value":6249},"Adapter: ",{"type":77,"tag":107,"props":6251,"children":6253},{"className":6252},[],[6254],{"type":83,"value":6255},"openaiSpeech",{"type":83,"value":6257}," (tts-1, tts-1-hd, gpt-4o-audio-preview).",{"type":77,"tag":138,"props":6259,"children":6261},{"className":140,"code":6260,"language":51,"meta":142,"style":142},"import { generateSpeech } from '@tanstack\u002Fai'\nimport { openaiSpeech } from '@tanstack\u002Fai-openai'\n\nconst result = await generateSpeech({\n  adapter: openaiSpeech('tts-1-hd'),\n  text: 'Hello, welcome to TanStack AI!',\n  voice: 'alloy', \u002F\u002F alloy | echo | fable | onyx | nova | shimmer | ash | ballad | coral | sage | verse\n  format: 'mp3', \u002F\u002F mp3 | opus | aac | flac | wav | pcm\n  speed: 1.0, \u002F\u002F 0.25 to 4.0\n})\n\n\u002F\u002F result.audio is base64-encoded audio\n\u002F\u002F result.format is the output format string\n\u002F\u002F result.contentType is the MIME type (e.g. \"audio\u002Fmpeg\")\n",[6262],{"type":77,"tag":107,"props":6263,"children":6264},{"__ignoreMap":142},[6265,6301,6337,6344,6375,6415,6444,6478,6512,6538,6549,6556,6564,6572],{"type":77,"tag":148,"props":6266,"children":6267},{"class":150,"line":151},[6268,6272,6276,6281,6285,6289,6293,6297],{"type":77,"tag":148,"props":6269,"children":6270},{"style":165},[6271],{"type":83,"value":168},{"type":77,"tag":148,"props":6273,"children":6274},{"style":171},[6275],{"type":83,"value":174},{"type":77,"tag":148,"props":6277,"children":6278},{"style":177},[6279],{"type":83,"value":6280}," generateSpeech",{"type":77,"tag":148,"props":6282,"children":6283},{"style":171},[6284],{"type":83,"value":195},{"type":77,"tag":148,"props":6286,"children":6287},{"style":165},[6288],{"type":83,"value":200},{"type":77,"tag":148,"props":6290,"children":6291},{"style":171},[6292],{"type":83,"value":205},{"type":77,"tag":148,"props":6294,"children":6295},{"style":208},[6296],{"type":83,"value":211},{"type":77,"tag":148,"props":6298,"children":6299},{"style":171},[6300],{"type":83,"value":216},{"type":77,"tag":148,"props":6302,"children":6303},{"class":150,"line":161},[6304,6308,6312,6317,6321,6325,6329,6333],{"type":77,"tag":148,"props":6305,"children":6306},{"style":165},[6307],{"type":83,"value":168},{"type":77,"tag":148,"props":6309,"children":6310},{"style":171},[6311],{"type":83,"value":174},{"type":77,"tag":148,"props":6313,"children":6314},{"style":177},[6315],{"type":83,"value":6316}," openaiSpeech",{"type":77,"tag":148,"props":6318,"children":6319},{"style":171},[6320],{"type":83,"value":195},{"type":77,"tag":148,"props":6322,"children":6323},{"style":165},[6324],{"type":83,"value":200},{"type":77,"tag":148,"props":6326,"children":6327},{"style":171},[6328],{"type":83,"value":205},{"type":77,"tag":148,"props":6330,"children":6331},{"style":208},[6332],{"type":83,"value":250},{"type":77,"tag":148,"props":6334,"children":6335},{"style":171},[6336],{"type":83,"value":216},{"type":77,"tag":148,"props":6338,"children":6339},{"class":150,"line":219},[6340],{"type":77,"tag":148,"props":6341,"children":6342},{"emptyLinePlaceholder":261},[6343],{"type":83,"value":264},{"type":77,"tag":148,"props":6345,"children":6346},{"class":150,"line":257},[6347,6351,6355,6359,6363,6367,6371],{"type":77,"tag":148,"props":6348,"children":6349},{"style":276},[6350],{"type":83,"value":2799},{"type":77,"tag":148,"props":6352,"children":6353},{"style":177},[6354],{"type":83,"value":5905},{"type":77,"tag":148,"props":6356,"children":6357},{"style":171},[6358],{"type":83,"value":1038},{"type":77,"tag":148,"props":6360,"children":6361},{"style":165},[6362],{"type":83,"value":372},{"type":77,"tag":148,"props":6364,"children":6365},{"style":287},[6366],{"type":83,"value":6280},{"type":77,"tag":148,"props":6368,"children":6369},{"style":177},[6370],{"type":83,"value":295},{"type":77,"tag":148,"props":6372,"children":6373},{"style":171},[6374],{"type":83,"value":431},{"type":77,"tag":148,"props":6376,"children":6377},{"class":150,"line":267},[6378,6382,6386,6390,6394,6398,6403,6407,6411],{"type":77,"tag":148,"props":6379,"children":6380},{"style":390},[6381],{"type":83,"value":2832},{"type":77,"tag":148,"props":6383,"children":6384},{"style":171},[6385],{"type":83,"value":306},{"type":77,"tag":148,"props":6387,"children":6388},{"style":287},[6389],{"type":83,"value":6316},{"type":77,"tag":148,"props":6391,"children":6392},{"style":177},[6393],{"type":83,"value":295},{"type":77,"tag":148,"props":6395,"children":6396},{"style":171},[6397],{"type":83,"value":457},{"type":77,"tag":148,"props":6399,"children":6400},{"style":208},[6401],{"type":83,"value":6402},"tts-1-hd",{"type":77,"tag":148,"props":6404,"children":6405},{"style":171},[6406],{"type":83,"value":457},{"type":77,"tag":148,"props":6408,"children":6409},{"style":177},[6410],{"type":83,"value":317},{"type":77,"tag":148,"props":6412,"children":6413},{"style":171},[6414],{"type":83,"value":475},{"type":77,"tag":148,"props":6416,"children":6417},{"class":150,"line":325},[6418,6423,6427,6431,6436,6440],{"type":77,"tag":148,"props":6419,"children":6420},{"style":390},[6421],{"type":83,"value":6422},"  text",{"type":77,"tag":148,"props":6424,"children":6425},{"style":171},[6426],{"type":83,"value":306},{"type":77,"tag":148,"props":6428,"children":6429},{"style":171},[6430],{"type":83,"value":205},{"type":77,"tag":148,"props":6432,"children":6433},{"style":208},[6434],{"type":83,"value":6435},"Hello, welcome to TanStack AI!",{"type":77,"tag":148,"props":6437,"children":6438},{"style":171},[6439],{"type":83,"value":457},{"type":77,"tag":148,"props":6441,"children":6442},{"style":171},[6443],{"type":83,"value":475},{"type":77,"tag":148,"props":6445,"children":6446},{"class":150,"line":396},[6447,6452,6456,6460,6465,6469,6473],{"type":77,"tag":148,"props":6448,"children":6449},{"style":390},[6450],{"type":83,"value":6451},"  voice",{"type":77,"tag":148,"props":6453,"children":6454},{"style":171},[6455],{"type":83,"value":306},{"type":77,"tag":148,"props":6457,"children":6458},{"style":171},[6459],{"type":83,"value":205},{"type":77,"tag":148,"props":6461,"children":6462},{"style":208},[6463],{"type":83,"value":6464},"alloy",{"type":77,"tag":148,"props":6466,"children":6467},{"style":171},[6468],{"type":83,"value":457},{"type":77,"tag":148,"props":6470,"children":6471},{"style":171},[6472],{"type":83,"value":185},{"type":77,"tag":148,"props":6474,"children":6475},{"style":155},[6476],{"type":83,"value":6477}," \u002F\u002F alloy | echo | fable | onyx | nova | shimmer | ash | ballad | coral | sage | verse\n",{"type":77,"tag":148,"props":6479,"children":6480},{"class":150,"line":404},[6481,6486,6490,6494,6499,6503,6507],{"type":77,"tag":148,"props":6482,"children":6483},{"style":390},[6484],{"type":83,"value":6485},"  format",{"type":77,"tag":148,"props":6487,"children":6488},{"style":171},[6489],{"type":83,"value":306},{"type":77,"tag":148,"props":6491,"children":6492},{"style":171},[6493],{"type":83,"value":205},{"type":77,"tag":148,"props":6495,"children":6496},{"style":208},[6497],{"type":83,"value":6498},"mp3",{"type":77,"tag":148,"props":6500,"children":6501},{"style":171},[6502],{"type":83,"value":457},{"type":77,"tag":148,"props":6504,"children":6505},{"style":171},[6506],{"type":83,"value":185},{"type":77,"tag":148,"props":6508,"children":6509},{"style":155},[6510],{"type":83,"value":6511}," \u002F\u002F mp3 | opus | aac | flac | wav | pcm\n",{"type":77,"tag":148,"props":6513,"children":6514},{"class":150,"line":434},[6515,6520,6524,6529,6533],{"type":77,"tag":148,"props":6516,"children":6517},{"style":390},[6518],{"type":83,"value":6519},"  speed",{"type":77,"tag":148,"props":6521,"children":6522},{"style":171},[6523],{"type":83,"value":306},{"type":77,"tag":148,"props":6525,"children":6526},{"style":2937},[6527],{"type":83,"value":6528}," 1.0",{"type":77,"tag":148,"props":6530,"children":6531},{"style":171},[6532],{"type":83,"value":185},{"type":77,"tag":148,"props":6534,"children":6535},{"style":155},[6536],{"type":83,"value":6537}," \u002F\u002F 0.25 to 4.0\n",{"type":77,"tag":148,"props":6539,"children":6540},{"class":150,"line":478},[6541,6545],{"type":77,"tag":148,"props":6542,"children":6543},{"style":171},[6544],{"type":83,"value":1114},{"type":77,"tag":148,"props":6546,"children":6547},{"style":177},[6548],{"type":83,"value":551},{"type":77,"tag":148,"props":6550,"children":6551},{"class":150,"line":491},[6552],{"type":77,"tag":148,"props":6553,"children":6554},{"emptyLinePlaceholder":261},[6555],{"type":83,"value":264},{"type":77,"tag":148,"props":6557,"children":6558},{"class":150,"line":504},[6559],{"type":77,"tag":148,"props":6560,"children":6561},{"style":155},[6562],{"type":83,"value":6563},"\u002F\u002F result.audio is base64-encoded audio\n",{"type":77,"tag":148,"props":6565,"children":6566},{"class":150,"line":517},[6567],{"type":77,"tag":148,"props":6568,"children":6569},{"style":155},[6570],{"type":83,"value":6571},"\u002F\u002F result.format is the output format string\n",{"type":77,"tag":148,"props":6573,"children":6574},{"class":150,"line":540},[6575],{"type":77,"tag":148,"props":6576,"children":6577},{"style":155},[6578],{"type":83,"value":6579},"\u002F\u002F result.contentType is the MIME type (e.g. \"audio\u002Fmpeg\")\n",{"type":77,"tag":90,"props":6581,"children":6582},{},[6583],{"type":83,"value":6053},{"type":77,"tag":138,"props":6585,"children":6587},{"className":603,"code":6586,"language":605,"meta":142,"style":142},"import { useGenerateSpeech, fetchServerSentEvents } from '@tanstack\u002Fai-react'\n\nconst { generate, result, isLoading } = useGenerateSpeech({\n  connection: fetchServerSentEvents('\u002Fapi\u002Fgenerate\u002Fspeech'),\n})\n\n\u002F\u002F Trigger: generate({ text: 'Hello!', voice: 'alloy' })\n\u002F\u002F Play:   \u003Caudio src={`data:audio\u002F${result.format};base64,${result.audio}`} controls \u002F>\n",[6588],{"type":77,"tag":107,"props":6589,"children":6590},{"__ignoreMap":142},[6591,6635,6642,6693,6733,6744,6751,6759],{"type":77,"tag":148,"props":6592,"children":6593},{"class":150,"line":151},[6594,6598,6602,6607,6611,6615,6619,6623,6627,6631],{"type":77,"tag":148,"props":6595,"children":6596},{"style":165},[6597],{"type":83,"value":168},{"type":77,"tag":148,"props":6599,"children":6600},{"style":171},[6601],{"type":83,"value":174},{"type":77,"tag":148,"props":6603,"children":6604},{"style":177},[6605],{"type":83,"value":6606}," useGenerateSpeech",{"type":77,"tag":148,"props":6608,"children":6609},{"style":171},[6610],{"type":83,"value":185},{"type":77,"tag":148,"props":6612,"children":6613},{"style":177},[6614],{"type":83,"value":634},{"type":77,"tag":148,"props":6616,"children":6617},{"style":171},[6618],{"type":83,"value":195},{"type":77,"tag":148,"props":6620,"children":6621},{"style":165},[6622],{"type":83,"value":200},{"type":77,"tag":148,"props":6624,"children":6625},{"style":171},[6626],{"type":83,"value":205},{"type":77,"tag":148,"props":6628,"children":6629},{"style":208},[6630],{"type":83,"value":651},{"type":77,"tag":148,"props":6632,"children":6633},{"style":171},[6634],{"type":83,"value":216},{"type":77,"tag":148,"props":6636,"children":6637},{"class":150,"line":161},[6638],{"type":77,"tag":148,"props":6639,"children":6640},{"emptyLinePlaceholder":261},[6641],{"type":83,"value":264},{"type":77,"tag":148,"props":6643,"children":6644},{"class":150,"line":219},[6645,6649,6653,6657,6661,6665,6669,6673,6677,6681,6685,6689],{"type":77,"tag":148,"props":6646,"children":6647},{"style":276},[6648],{"type":83,"value":2799},{"type":77,"tag":148,"props":6650,"children":6651},{"style":171},[6652],{"type":83,"value":174},{"type":77,"tag":148,"props":6654,"children":6655},{"style":177},[6656],{"type":83,"value":788},{"type":77,"tag":148,"props":6658,"children":6659},{"style":171},[6660],{"type":83,"value":185},{"type":77,"tag":148,"props":6662,"children":6663},{"style":177},[6664],{"type":83,"value":797},{"type":77,"tag":148,"props":6666,"children":6667},{"style":171},[6668],{"type":83,"value":185},{"type":77,"tag":148,"props":6670,"children":6671},{"style":177},[6672],{"type":83,"value":6143},{"type":77,"tag":148,"props":6674,"children":6675},{"style":171},[6676],{"type":83,"value":1114},{"type":77,"tag":148,"props":6678,"children":6679},{"style":171},[6680],{"type":83,"value":367},{"type":77,"tag":148,"props":6682,"children":6683},{"style":287},[6684],{"type":83,"value":6606},{"type":77,"tag":148,"props":6686,"children":6687},{"style":177},[6688],{"type":83,"value":295},{"type":77,"tag":148,"props":6690,"children":6691},{"style":171},[6692],{"type":83,"value":431},{"type":77,"tag":148,"props":6694,"children":6695},{"class":150,"line":257},[6696,6700,6704,6708,6712,6716,6721,6725,6729],{"type":77,"tag":148,"props":6697,"children":6698},{"style":390},[6699],{"type":83,"value":6171},{"type":77,"tag":148,"props":6701,"children":6702},{"style":171},[6703],{"type":83,"value":306},{"type":77,"tag":148,"props":6705,"children":6706},{"style":287},[6707],{"type":83,"value":634},{"type":77,"tag":148,"props":6709,"children":6710},{"style":177},[6711],{"type":83,"value":295},{"type":77,"tag":148,"props":6713,"children":6714},{"style":171},[6715],{"type":83,"value":457},{"type":77,"tag":148,"props":6717,"children":6718},{"style":208},[6719],{"type":83,"value":6720},"\u002Fapi\u002Fgenerate\u002Fspeech",{"type":77,"tag":148,"props":6722,"children":6723},{"style":171},[6724],{"type":83,"value":457},{"type":77,"tag":148,"props":6726,"children":6727},{"style":177},[6728],{"type":83,"value":317},{"type":77,"tag":148,"props":6730,"children":6731},{"style":171},[6732],{"type":83,"value":475},{"type":77,"tag":148,"props":6734,"children":6735},{"class":150,"line":267},[6736,6740],{"type":77,"tag":148,"props":6737,"children":6738},{"style":171},[6739],{"type":83,"value":1114},{"type":77,"tag":148,"props":6741,"children":6742},{"style":177},[6743],{"type":83,"value":551},{"type":77,"tag":148,"props":6745,"children":6746},{"class":150,"line":325},[6747],{"type":77,"tag":148,"props":6748,"children":6749},{"emptyLinePlaceholder":261},[6750],{"type":83,"value":264},{"type":77,"tag":148,"props":6752,"children":6753},{"class":150,"line":396},[6754],{"type":77,"tag":148,"props":6755,"children":6756},{"style":155},[6757],{"type":83,"value":6758},"\u002F\u002F Trigger: generate({ text: 'Hello!', voice: 'alloy' })\n",{"type":77,"tag":148,"props":6760,"children":6761},{"class":150,"line":404},[6762],{"type":77,"tag":148,"props":6763,"children":6764},{"style":155},[6765],{"type":83,"value":6766},"\u002F\u002F Play:   \u003Caudio src={`data:audio\u002F${result.format};base64,${result.audio}`} controls \u002F>\n",{"type":77,"tag":131,"props":6768,"children":6770},{"id":6769},"_4-audio-transcription",[6771],{"type":83,"value":6772},"4. Audio Transcription",{"type":77,"tag":90,"props":6774,"children":6775},{},[6776,6777,6783],{"type":83,"value":6249},{"type":77,"tag":107,"props":6778,"children":6780},{"className":6779},[],[6781],{"type":83,"value":6782},"openaiTranscription",{"type":83,"value":6784}," (whisper-1, gpt-4o-transcribe,\ngpt-4o-mini-transcribe, gpt-4o-transcribe-diarize).",{"type":77,"tag":86,"props":6786,"children":6787},{},[6788,6875],{"type":77,"tag":90,"props":6789,"children":6790},{},[6791,6796,6798,6804,6806,6811,6813,6818,6820,6826,6828,6834,6836,6842,6844,6850,6852,6857,6859,6865,6867,6873],{"type":77,"tag":94,"props":6792,"children":6793},{},[6794],{"type":83,"value":6795},"Capturing audio in the browser:",{"type":83,"value":6797}," Use ",{"type":77,"tag":107,"props":6799,"children":6801},{"className":6800},[],[6802],{"type":83,"value":6803},"useAudioRecorder",{"type":83,"value":6805}," from ",{"type":77,"tag":107,"props":6807,"children":6809},{"className":6808},[],[6810],{"type":83,"value":651},{"type":83,"value":6812}," to record directly in the browser, then pass the recording as the ",{"type":77,"tag":107,"props":6814,"children":6816},{"className":6815},[],[6817],{"type":83,"value":22},{"type":83,"value":6819}," input to ",{"type":77,"tag":107,"props":6821,"children":6823},{"className":6822},[],[6824],{"type":83,"value":6825},"generate()",{"type":83,"value":6827},", or use ",{"type":77,"tag":107,"props":6829,"children":6831},{"className":6830},[],[6832],{"type":83,"value":6833},"recording.part",{"type":83,"value":6835}," as a prompt part in chat\u002Fgeneration calls. No transcoding or extra dependencies required — the recorder returns the native browser format (",{"type":77,"tag":107,"props":6837,"children":6839},{"className":6838},[],[6840],{"type":83,"value":6841},"audio\u002Fwebm",{"type":83,"value":6843}," or ",{"type":77,"tag":107,"props":6845,"children":6847},{"className":6846},[],[6848],{"type":83,"value":6849},"audio\u002Fmp4",{"type":83,"value":6851},"). For transcription, wrap it as a ",{"type":77,"tag":107,"props":6853,"children":6855},{"className":6854},[],[6856],{"type":83,"value":5184},{"type":83,"value":6858}," URL so the provider gets the real content type; passing raw ",{"type":77,"tag":107,"props":6860,"children":6862},{"className":6861},[],[6863],{"type":83,"value":6864},"recording.base64",{"type":83,"value":6866}," makes the adapter assume ",{"type":77,"tag":107,"props":6868,"children":6870},{"className":6869},[],[6871],{"type":83,"value":6872},"audio\u002Fmpeg",{"type":83,"value":6874}," and mislabel the webm\u002Fmp4 bytes.",{"type":77,"tag":138,"props":6876,"children":6878},{"className":140,"code":6877,"language":51,"meta":142,"style":142},"const { isRecording, start, stop } = useAudioRecorder()\nconst { generate } = useTranscription({\n  connection: fetchServerSentEvents('\u002Fapi\u002Ftranscribe'),\n})\n\u002F\u002F ...\nconst recording = await stop()\nconst mimeType = recording.mimeType.split(';')[0] \u002F\u002F strip ;codecs=...\nawait generate({ audio: `data:${mimeType};base64,${recording.base64}` })\n",[6879],{"type":77,"tag":107,"props":6880,"children":6881},{"__ignoreMap":142},[6882,6933,6970,7010,7021,7029,7058,7133],{"type":77,"tag":148,"props":6883,"children":6884},{"class":150,"line":151},[6885,6889,6893,6898,6902,6907,6911,6916,6920,6924,6929],{"type":77,"tag":148,"props":6886,"children":6887},{"style":276},[6888],{"type":83,"value":2799},{"type":77,"tag":148,"props":6890,"children":6891},{"style":171},[6892],{"type":83,"value":174},{"type":77,"tag":148,"props":6894,"children":6895},{"style":177},[6896],{"type":83,"value":6897}," isRecording",{"type":77,"tag":148,"props":6899,"children":6900},{"style":171},[6901],{"type":83,"value":185},{"type":77,"tag":148,"props":6903,"children":6904},{"style":177},[6905],{"type":83,"value":6906}," start",{"type":77,"tag":148,"props":6908,"children":6909},{"style":171},[6910],{"type":83,"value":185},{"type":77,"tag":148,"props":6912,"children":6913},{"style":177},[6914],{"type":83,"value":6915}," stop ",{"type":77,"tag":148,"props":6917,"children":6918},{"style":171},[6919],{"type":83,"value":1114},{"type":77,"tag":148,"props":6921,"children":6922},{"style":171},[6923],{"type":83,"value":367},{"type":77,"tag":148,"props":6925,"children":6926},{"style":287},[6927],{"type":83,"value":6928}," useAudioRecorder",{"type":77,"tag":148,"props":6930,"children":6931},{"style":177},[6932],{"type":83,"value":393},{"type":77,"tag":148,"props":6934,"children":6935},{"class":150,"line":161},[6936,6940,6944,6949,6953,6957,6962,6966],{"type":77,"tag":148,"props":6937,"children":6938},{"style":276},[6939],{"type":83,"value":2799},{"type":77,"tag":148,"props":6941,"children":6942},{"style":171},[6943],{"type":83,"value":174},{"type":77,"tag":148,"props":6945,"children":6946},{"style":177},[6947],{"type":83,"value":6948}," generate ",{"type":77,"tag":148,"props":6950,"children":6951},{"style":171},[6952],{"type":83,"value":1114},{"type":77,"tag":148,"props":6954,"children":6955},{"style":171},[6956],{"type":83,"value":367},{"type":77,"tag":148,"props":6958,"children":6959},{"style":287},[6960],{"type":83,"value":6961}," useTranscription",{"type":77,"tag":148,"props":6963,"children":6964},{"style":177},[6965],{"type":83,"value":295},{"type":77,"tag":148,"props":6967,"children":6968},{"style":171},[6969],{"type":83,"value":431},{"type":77,"tag":148,"props":6971,"children":6972},{"class":150,"line":219},[6973,6977,6981,6985,6989,6993,6998,7002,7006],{"type":77,"tag":148,"props":6974,"children":6975},{"style":390},[6976],{"type":83,"value":6171},{"type":77,"tag":148,"props":6978,"children":6979},{"style":171},[6980],{"type":83,"value":306},{"type":77,"tag":148,"props":6982,"children":6983},{"style":287},[6984],{"type":83,"value":634},{"type":77,"tag":148,"props":6986,"children":6987},{"style":177},[6988],{"type":83,"value":295},{"type":77,"tag":148,"props":6990,"children":6991},{"style":171},[6992],{"type":83,"value":457},{"type":77,"tag":148,"props":6994,"children":6995},{"style":208},[6996],{"type":83,"value":6997},"\u002Fapi\u002Ftranscribe",{"type":77,"tag":148,"props":6999,"children":7000},{"style":171},[7001],{"type":83,"value":457},{"type":77,"tag":148,"props":7003,"children":7004},{"style":177},[7005],{"type":83,"value":317},{"type":77,"tag":148,"props":7007,"children":7008},{"style":171},[7009],{"type":83,"value":475},{"type":77,"tag":148,"props":7011,"children":7012},{"class":150,"line":257},[7013,7017],{"type":77,"tag":148,"props":7014,"children":7015},{"style":171},[7016],{"type":83,"value":1114},{"type":77,"tag":148,"props":7018,"children":7019},{"style":177},[7020],{"type":83,"value":551},{"type":77,"tag":148,"props":7022,"children":7023},{"class":150,"line":267},[7024],{"type":77,"tag":148,"props":7025,"children":7026},{"style":155},[7027],{"type":83,"value":7028},"\u002F\u002F ...\n",{"type":77,"tag":148,"props":7030,"children":7031},{"class":150,"line":325},[7032,7036,7041,7045,7049,7054],{"type":77,"tag":148,"props":7033,"children":7034},{"style":276},[7035],{"type":83,"value":2799},{"type":77,"tag":148,"props":7037,"children":7038},{"style":177},[7039],{"type":83,"value":7040}," recording ",{"type":77,"tag":148,"props":7042,"children":7043},{"style":171},[7044],{"type":83,"value":1038},{"type":77,"tag":148,"props":7046,"children":7047},{"style":165},[7048],{"type":83,"value":372},{"type":77,"tag":148,"props":7050,"children":7051},{"style":287},[7052],{"type":83,"value":7053}," stop",{"type":77,"tag":148,"props":7055,"children":7056},{"style":177},[7057],{"type":83,"value":393},{"type":77,"tag":148,"props":7059,"children":7060},{"class":150,"line":396},[7061,7065,7070,7074,7079,7083,7088,7092,7097,7101,7105,7109,7113,7118,7123,7128],{"type":77,"tag":148,"props":7062,"children":7063},{"style":276},[7064],{"type":83,"value":2799},{"type":77,"tag":148,"props":7066,"children":7067},{"style":177},[7068],{"type":83,"value":7069}," mimeType ",{"type":77,"tag":148,"props":7071,"children":7072},{"style":171},[7073],{"type":83,"value":1038},{"type":77,"tag":148,"props":7075,"children":7076},{"style":177},[7077],{"type":83,"value":7078}," recording",{"type":77,"tag":148,"props":7080,"children":7081},{"style":171},[7082],{"type":83,"value":382},{"type":77,"tag":148,"props":7084,"children":7085},{"style":177},[7086],{"type":83,"value":7087},"mimeType",{"type":77,"tag":148,"props":7089,"children":7090},{"style":171},[7091],{"type":83,"value":382},{"type":77,"tag":148,"props":7093,"children":7094},{"style":287},[7095],{"type":83,"value":7096},"split",{"type":77,"tag":148,"props":7098,"children":7099},{"style":177},[7100],{"type":83,"value":295},{"type":77,"tag":148,"props":7102,"children":7103},{"style":171},[7104],{"type":83,"value":457},{"type":77,"tag":148,"props":7106,"children":7107},{"style":208},[7108],{"type":83,"value":1956},{"type":77,"tag":148,"props":7110,"children":7111},{"style":171},[7112],{"type":83,"value":457},{"type":77,"tag":148,"props":7114,"children":7115},{"style":177},[7116],{"type":83,"value":7117},")[",{"type":77,"tag":148,"props":7119,"children":7120},{"style":2937},[7121],{"type":83,"value":7122},"0",{"type":77,"tag":148,"props":7124,"children":7125},{"style":177},[7126],{"type":83,"value":7127},"] ",{"type":77,"tag":148,"props":7129,"children":7130},{"style":155},[7131],{"type":83,"value":7132},"\u002F\u002F strip ;codecs=...\n",{"type":77,"tag":148,"props":7134,"children":7135},{"class":150,"line":404},[7136,7140,7144,7148,7152,7157,7161,7165,7169,7173,7177,7181,7186,7190,7195,7199,7204,7208,7212],{"type":77,"tag":148,"props":7137,"children":7138},{"style":165},[7139],{"type":83,"value":3621},{"type":77,"tag":148,"props":7141,"children":7142},{"style":287},[7143],{"type":83,"value":788},{"type":77,"tag":148,"props":7145,"children":7146},{"style":177},[7147],{"type":83,"value":295},{"type":77,"tag":148,"props":7149,"children":7150},{"style":171},[7151],{"type":83,"value":1104},{"type":77,"tag":148,"props":7153,"children":7154},{"style":390},[7155],{"type":83,"value":7156}," audio",{"type":77,"tag":148,"props":7158,"children":7159},{"style":171},[7160],{"type":83,"value":306},{"type":77,"tag":148,"props":7162,"children":7163},{"style":171},[7164],{"type":83,"value":1473},{"type":77,"tag":148,"props":7166,"children":7167},{"style":208},[7168],{"type":83,"value":5184},{"type":77,"tag":148,"props":7170,"children":7171},{"style":171},[7172],{"type":83,"value":1483},{"type":77,"tag":148,"props":7174,"children":7175},{"style":177},[7176],{"type":83,"value":7087},{"type":77,"tag":148,"props":7178,"children":7179},{"style":171},[7180],{"type":83,"value":1114},{"type":77,"tag":148,"props":7182,"children":7183},{"style":208},[7184],{"type":83,"value":7185},";base64,",{"type":77,"tag":148,"props":7187,"children":7188},{"style":171},[7189],{"type":83,"value":1483},{"type":77,"tag":148,"props":7191,"children":7192},{"style":177},[7193],{"type":83,"value":7194},"recording",{"type":77,"tag":148,"props":7196,"children":7197},{"style":171},[7198],{"type":83,"value":382},{"type":77,"tag":148,"props":7200,"children":7201},{"style":177},[7202],{"type":83,"value":7203},"base64",{"type":77,"tag":148,"props":7205,"children":7206},{"style":171},[7207],{"type":83,"value":1501},{"type":77,"tag":148,"props":7209,"children":7210},{"style":171},[7211],{"type":83,"value":195},{"type":77,"tag":148,"props":7213,"children":7214},{"style":177},[7215],{"type":83,"value":551},{"type":77,"tag":138,"props":7217,"children":7219},{"className":140,"code":7218,"language":51,"meta":142,"style":142},"import { generateTranscription } from '@tanstack\u002Fai'\nimport { openaiTranscription } from '@tanstack\u002Fai-openai'\n\nconst result = await generateTranscription({\n  adapter: openaiTranscription('whisper-1'),\n  audio: audioFile, \u002F\u002F File, Blob, base64 string, or data URL\n  language: 'en',\n  responseFormat: 'verbose_json',\n  modelOptions: {\n    timestamp_granularities: ['word', 'segment'],\n  },\n})\n\n\u002F\u002F result.text       -- full transcribed text\n\u002F\u002F result.language   -- detected\u002Fspecified language\n\u002F\u002F result.duration   -- audio duration in seconds\n\u002F\u002F result.segments   -- timestamped segments (word-level timestamps are in result.words)\n",[7220],{"type":77,"tag":107,"props":7221,"children":7222},{"__ignoreMap":142},[7223,7259,7295,7302,7333,7373,7399,7428,7457,7472,7526,7533,7544,7551,7559,7567,7575],{"type":77,"tag":148,"props":7224,"children":7225},{"class":150,"line":151},[7226,7230,7234,7239,7243,7247,7251,7255],{"type":77,"tag":148,"props":7227,"children":7228},{"style":165},[7229],{"type":83,"value":168},{"type":77,"tag":148,"props":7231,"children":7232},{"style":171},[7233],{"type":83,"value":174},{"type":77,"tag":148,"props":7235,"children":7236},{"style":177},[7237],{"type":83,"value":7238}," generateTranscription",{"type":77,"tag":148,"props":7240,"children":7241},{"style":171},[7242],{"type":83,"value":195},{"type":77,"tag":148,"props":7244,"children":7245},{"style":165},[7246],{"type":83,"value":200},{"type":77,"tag":148,"props":7248,"children":7249},{"style":171},[7250],{"type":83,"value":205},{"type":77,"tag":148,"props":7252,"children":7253},{"style":208},[7254],{"type":83,"value":211},{"type":77,"tag":148,"props":7256,"children":7257},{"style":171},[7258],{"type":83,"value":216},{"type":77,"tag":148,"props":7260,"children":7261},{"class":150,"line":161},[7262,7266,7270,7275,7279,7283,7287,7291],{"type":77,"tag":148,"props":7263,"children":7264},{"style":165},[7265],{"type":83,"value":168},{"type":77,"tag":148,"props":7267,"children":7268},{"style":171},[7269],{"type":83,"value":174},{"type":77,"tag":148,"props":7271,"children":7272},{"style":177},[7273],{"type":83,"value":7274}," openaiTranscription",{"type":77,"tag":148,"props":7276,"children":7277},{"style":171},[7278],{"type":83,"value":195},{"type":77,"tag":148,"props":7280,"children":7281},{"style":165},[7282],{"type":83,"value":200},{"type":77,"tag":148,"props":7284,"children":7285},{"style":171},[7286],{"type":83,"value":205},{"type":77,"tag":148,"props":7288,"children":7289},{"style":208},[7290],{"type":83,"value":250},{"type":77,"tag":148,"props":7292,"children":7293},{"style":171},[7294],{"type":83,"value":216},{"type":77,"tag":148,"props":7296,"children":7297},{"class":150,"line":219},[7298],{"type":77,"tag":148,"props":7299,"children":7300},{"emptyLinePlaceholder":261},[7301],{"type":83,"value":264},{"type":77,"tag":148,"props":7303,"children":7304},{"class":150,"line":257},[7305,7309,7313,7317,7321,7325,7329],{"type":77,"tag":148,"props":7306,"children":7307},{"style":276},[7308],{"type":83,"value":2799},{"type":77,"tag":148,"props":7310,"children":7311},{"style":177},[7312],{"type":83,"value":5905},{"type":77,"tag":148,"props":7314,"children":7315},{"style":171},[7316],{"type":83,"value":1038},{"type":77,"tag":148,"props":7318,"children":7319},{"style":165},[7320],{"type":83,"value":372},{"type":77,"tag":148,"props":7322,"children":7323},{"style":287},[7324],{"type":83,"value":7238},{"type":77,"tag":148,"props":7326,"children":7327},{"style":177},[7328],{"type":83,"value":295},{"type":77,"tag":148,"props":7330,"children":7331},{"style":171},[7332],{"type":83,"value":431},{"type":77,"tag":148,"props":7334,"children":7335},{"class":150,"line":267},[7336,7340,7344,7348,7352,7356,7361,7365,7369],{"type":77,"tag":148,"props":7337,"children":7338},{"style":390},[7339],{"type":83,"value":2832},{"type":77,"tag":148,"props":7341,"children":7342},{"style":171},[7343],{"type":83,"value":306},{"type":77,"tag":148,"props":7345,"children":7346},{"style":287},[7347],{"type":83,"value":7274},{"type":77,"tag":148,"props":7349,"children":7350},{"style":177},[7351],{"type":83,"value":295},{"type":77,"tag":148,"props":7353,"children":7354},{"style":171},[7355],{"type":83,"value":457},{"type":77,"tag":148,"props":7357,"children":7358},{"style":208},[7359],{"type":83,"value":7360},"whisper-1",{"type":77,"tag":148,"props":7362,"children":7363},{"style":171},[7364],{"type":83,"value":457},{"type":77,"tag":148,"props":7366,"children":7367},{"style":177},[7368],{"type":83,"value":317},{"type":77,"tag":148,"props":7370,"children":7371},{"style":171},[7372],{"type":83,"value":475},{"type":77,"tag":148,"props":7374,"children":7375},{"class":150,"line":325},[7376,7381,7385,7390,7394],{"type":77,"tag":148,"props":7377,"children":7378},{"style":390},[7379],{"type":83,"value":7380},"  audio",{"type":77,"tag":148,"props":7382,"children":7383},{"style":171},[7384],{"type":83,"value":306},{"type":77,"tag":148,"props":7386,"children":7387},{"style":177},[7388],{"type":83,"value":7389}," audioFile",{"type":77,"tag":148,"props":7391,"children":7392},{"style":171},[7393],{"type":83,"value":185},{"type":77,"tag":148,"props":7395,"children":7396},{"style":155},[7397],{"type":83,"value":7398}," \u002F\u002F File, Blob, base64 string, or data URL\n",{"type":77,"tag":148,"props":7400,"children":7401},{"class":150,"line":396},[7402,7407,7411,7415,7420,7424],{"type":77,"tag":148,"props":7403,"children":7404},{"style":390},[7405],{"type":83,"value":7406},"  language",{"type":77,"tag":148,"props":7408,"children":7409},{"style":171},[7410],{"type":83,"value":306},{"type":77,"tag":148,"props":7412,"children":7413},{"style":171},[7414],{"type":83,"value":205},{"type":77,"tag":148,"props":7416,"children":7417},{"style":208},[7418],{"type":83,"value":7419},"en",{"type":77,"tag":148,"props":7421,"children":7422},{"style":171},[7423],{"type":83,"value":457},{"type":77,"tag":148,"props":7425,"children":7426},{"style":171},[7427],{"type":83,"value":475},{"type":77,"tag":148,"props":7429,"children":7430},{"class":150,"line":404},[7431,7436,7440,7444,7449,7453],{"type":77,"tag":148,"props":7432,"children":7433},{"style":390},[7434],{"type":83,"value":7435},"  responseFormat",{"type":77,"tag":148,"props":7437,"children":7438},{"style":171},[7439],{"type":83,"value":306},{"type":77,"tag":148,"props":7441,"children":7442},{"style":171},[7443],{"type":83,"value":205},{"type":77,"tag":148,"props":7445,"children":7446},{"style":208},[7447],{"type":83,"value":7448},"verbose_json",{"type":77,"tag":148,"props":7450,"children":7451},{"style":171},[7452],{"type":83,"value":457},{"type":77,"tag":148,"props":7454,"children":7455},{"style":171},[7456],{"type":83,"value":475},{"type":77,"tag":148,"props":7458,"children":7459},{"class":150,"line":434},[7460,7464,7468],{"type":77,"tag":148,"props":7461,"children":7462},{"style":390},[7463],{"type":83,"value":2952},{"type":77,"tag":148,"props":7465,"children":7466},{"style":171},[7467],{"type":83,"value":306},{"type":77,"tag":148,"props":7469,"children":7470},{"style":171},[7471],{"type":83,"value":322},{"type":77,"tag":148,"props":7473,"children":7474},{"class":150,"line":478},[7475,7480,7484,7488,7492,7497,7501,7505,7509,7514,7518,7522],{"type":77,"tag":148,"props":7476,"children":7477},{"style":390},[7478],{"type":83,"value":7479},"    timestamp_granularities",{"type":77,"tag":148,"props":7481,"children":7482},{"style":171},[7483],{"type":83,"value":306},{"type":77,"tag":148,"props":7485,"children":7486},{"style":177},[7487],{"type":83,"value":732},{"type":77,"tag":148,"props":7489,"children":7490},{"style":171},[7491],{"type":83,"value":457},{"type":77,"tag":148,"props":7493,"children":7494},{"style":208},[7495],{"type":83,"value":7496},"word",{"type":77,"tag":148,"props":7498,"children":7499},{"style":171},[7500],{"type":83,"value":457},{"type":77,"tag":148,"props":7502,"children":7503},{"style":171},[7504],{"type":83,"value":185},{"type":77,"tag":148,"props":7506,"children":7507},{"style":171},[7508],{"type":83,"value":205},{"type":77,"tag":148,"props":7510,"children":7511},{"style":208},[7512],{"type":83,"value":7513},"segment",{"type":77,"tag":148,"props":7515,"children":7516},{"style":171},[7517],{"type":83,"value":457},{"type":77,"tag":148,"props":7519,"children":7520},{"style":177},[7521],{"type":83,"value":751},{"type":77,"tag":148,"props":7523,"children":7524},{"style":171},[7525],{"type":83,"value":475},{"type":77,"tag":148,"props":7527,"children":7528},{"class":150,"line":491},[7529],{"type":77,"tag":148,"props":7530,"children":7531},{"style":171},[7532],{"type":83,"value":3055},{"type":77,"tag":148,"props":7534,"children":7535},{"class":150,"line":504},[7536,7540],{"type":77,"tag":148,"props":7537,"children":7538},{"style":171},[7539],{"type":83,"value":1114},{"type":77,"tag":148,"props":7541,"children":7542},{"style":177},[7543],{"type":83,"value":551},{"type":77,"tag":148,"props":7545,"children":7546},{"class":150,"line":517},[7547],{"type":77,"tag":148,"props":7548,"children":7549},{"emptyLinePlaceholder":261},[7550],{"type":83,"value":264},{"type":77,"tag":148,"props":7552,"children":7553},{"class":150,"line":540},[7554],{"type":77,"tag":148,"props":7555,"children":7556},{"style":155},[7557],{"type":83,"value":7558},"\u002F\u002F result.text       -- full transcribed text\n",{"type":77,"tag":148,"props":7560,"children":7561},{"class":150,"line":554},[7562],{"type":77,"tag":148,"props":7563,"children":7564},{"style":155},[7565],{"type":83,"value":7566},"\u002F\u002F result.language   -- detected\u002Fspecified language\n",{"type":77,"tag":148,"props":7568,"children":7569},{"class":150,"line":562},[7570],{"type":77,"tag":148,"props":7571,"children":7572},{"style":155},[7573],{"type":83,"value":7574},"\u002F\u002F result.duration   -- audio duration in seconds\n",{"type":77,"tag":148,"props":7576,"children":7577},{"class":150,"line":588},[7578],{"type":77,"tag":148,"props":7579,"children":7580},{"style":155},[7581],{"type":83,"value":7582},"\u002F\u002F result.segments   -- timestamped segments (word-level timestamps are in result.words)\n",{"type":77,"tag":90,"props":7584,"children":7585},{},[7586,7588,7594,7596,7602,7604,7610,7612,7618,7620,7626,7627,7633,7635,7640,7641,7647,7649,7655],{"type":83,"value":7587},"For speaker diarization, use ",{"type":77,"tag":107,"props":7589,"children":7591},{"className":7590},[],[7592],{"type":83,"value":7593},"openaiTranscription('gpt-4o-transcribe-diarize')",{"type":83,"value":7595},".\nWhen no response format is given it defaults the request to ",{"type":77,"tag":107,"props":7597,"children":7599},{"className":7598},[],[7600],{"type":83,"value":7601},"response_format: 'diarized_json'",{"type":83,"value":7603},"\nand ",{"type":77,"tag":107,"props":7605,"children":7607},{"className":7606},[],[7608],{"type":83,"value":7609},"chunking_strategy: 'auto'",{"type":83,"value":7611}," (a top-level ",{"type":77,"tag":107,"props":7613,"children":7615},{"className":7614},[],[7616],{"type":83,"value":7617},"responseFormat",{"type":83,"value":7619}," of ",{"type":77,"tag":107,"props":7621,"children":7623},{"className":7622},[],[7624],{"type":83,"value":7625},"'json'",{"type":83,"value":5655},{"type":77,"tag":107,"props":7628,"children":7630},{"className":7629},[],[7631],{"type":83,"value":7632},"'text'",{"type":83,"value":7634}," opts out of\nspeaker segments); do not pass ",{"type":77,"tag":107,"props":7636,"children":7638},{"className":7637},[],[7639],{"type":83,"value":737},{"type":83,"value":3416},{"type":77,"tag":107,"props":7642,"children":7644},{"className":7643},[],[7645],{"type":83,"value":7646},"include",{"type":83,"value":7648},", or ",{"type":77,"tag":107,"props":7650,"children":7652},{"className":7651},[],[7653],{"type":83,"value":7654},"timestamp_granularities",{"type":83,"value":7656}," with this model.",{"type":77,"tag":90,"props":7658,"children":7659},{},[7660],{"type":83,"value":6053},{"type":77,"tag":138,"props":7662,"children":7664},{"className":603,"code":7663,"language":605,"meta":142,"style":142},"import { useTranscription, fetchServerSentEvents } from '@tanstack\u002Fai-react'\n\nconst { generate, result, isLoading } = useTranscription({\n  connection: fetchServerSentEvents('\u002Fapi\u002Ftranscribe'),\n})\n\n\u002F\u002F Trigger: generate({ audio: dataUrl, language: 'en' })\n",[7665],{"type":77,"tag":107,"props":7666,"children":7667},{"__ignoreMap":142},[7668,7711,7718,7769,7808,7819,7826],{"type":77,"tag":148,"props":7669,"children":7670},{"class":150,"line":151},[7671,7675,7679,7683,7687,7691,7695,7699,7703,7707],{"type":77,"tag":148,"props":7672,"children":7673},{"style":165},[7674],{"type":83,"value":168},{"type":77,"tag":148,"props":7676,"children":7677},{"style":171},[7678],{"type":83,"value":174},{"type":77,"tag":148,"props":7680,"children":7681},{"style":177},[7682],{"type":83,"value":6961},{"type":77,"tag":148,"props":7684,"children":7685},{"style":171},[7686],{"type":83,"value":185},{"type":77,"tag":148,"props":7688,"children":7689},{"style":177},[7690],{"type":83,"value":634},{"type":77,"tag":148,"props":7692,"children":7693},{"style":171},[7694],{"type":83,"value":195},{"type":77,"tag":148,"props":7696,"children":7697},{"style":165},[7698],{"type":83,"value":200},{"type":77,"tag":148,"props":7700,"children":7701},{"style":171},[7702],{"type":83,"value":205},{"type":77,"tag":148,"props":7704,"children":7705},{"style":208},[7706],{"type":83,"value":651},{"type":77,"tag":148,"props":7708,"children":7709},{"style":171},[7710],{"type":83,"value":216},{"type":77,"tag":148,"props":7712,"children":7713},{"class":150,"line":161},[7714],{"type":77,"tag":148,"props":7715,"children":7716},{"emptyLinePlaceholder":261},[7717],{"type":83,"value":264},{"type":77,"tag":148,"props":7719,"children":7720},{"class":150,"line":219},[7721,7725,7729,7733,7737,7741,7745,7749,7753,7757,7761,7765],{"type":77,"tag":148,"props":7722,"children":7723},{"style":276},[7724],{"type":83,"value":2799},{"type":77,"tag":148,"props":7726,"children":7727},{"style":171},[7728],{"type":83,"value":174},{"type":77,"tag":148,"props":7730,"children":7731},{"style":177},[7732],{"type":83,"value":788},{"type":77,"tag":148,"props":7734,"children":7735},{"style":171},[7736],{"type":83,"value":185},{"type":77,"tag":148,"props":7738,"children":7739},{"style":177},[7740],{"type":83,"value":797},{"type":77,"tag":148,"props":7742,"children":7743},{"style":171},[7744],{"type":83,"value":185},{"type":77,"tag":148,"props":7746,"children":7747},{"style":177},[7748],{"type":83,"value":6143},{"type":77,"tag":148,"props":7750,"children":7751},{"style":171},[7752],{"type":83,"value":1114},{"type":77,"tag":148,"props":7754,"children":7755},{"style":171},[7756],{"type":83,"value":367},{"type":77,"tag":148,"props":7758,"children":7759},{"style":287},[7760],{"type":83,"value":6961},{"type":77,"tag":148,"props":7762,"children":7763},{"style":177},[7764],{"type":83,"value":295},{"type":77,"tag":148,"props":7766,"children":7767},{"style":171},[7768],{"type":83,"value":431},{"type":77,"tag":148,"props":7770,"children":7771},{"class":150,"line":257},[7772,7776,7780,7784,7788,7792,7796,7800,7804],{"type":77,"tag":148,"props":7773,"children":7774},{"style":390},[7775],{"type":83,"value":6171},{"type":77,"tag":148,"props":7777,"children":7778},{"style":171},[7779],{"type":83,"value":306},{"type":77,"tag":148,"props":7781,"children":7782},{"style":287},[7783],{"type":83,"value":634},{"type":77,"tag":148,"props":7785,"children":7786},{"style":177},[7787],{"type":83,"value":295},{"type":77,"tag":148,"props":7789,"children":7790},{"style":171},[7791],{"type":83,"value":457},{"type":77,"tag":148,"props":7793,"children":7794},{"style":208},[7795],{"type":83,"value":6997},{"type":77,"tag":148,"props":7797,"children":7798},{"style":171},[7799],{"type":83,"value":457},{"type":77,"tag":148,"props":7801,"children":7802},{"style":177},[7803],{"type":83,"value":317},{"type":77,"tag":148,"props":7805,"children":7806},{"style":171},[7807],{"type":83,"value":475},{"type":77,"tag":148,"props":7809,"children":7810},{"class":150,"line":267},[7811,7815],{"type":77,"tag":148,"props":7812,"children":7813},{"style":171},[7814],{"type":83,"value":1114},{"type":77,"tag":148,"props":7816,"children":7817},{"style":177},[7818],{"type":83,"value":551},{"type":77,"tag":148,"props":7820,"children":7821},{"class":150,"line":325},[7822],{"type":77,"tag":148,"props":7823,"children":7824},{"emptyLinePlaceholder":261},[7825],{"type":83,"value":264},{"type":77,"tag":148,"props":7827,"children":7828},{"class":150,"line":396},[7829],{"type":77,"tag":148,"props":7830,"children":7831},{"style":155},[7832],{"type":83,"value":7833},"\u002F\u002F Trigger: generate({ audio: dataUrl, language: 'en' })\n",{"type":77,"tag":131,"props":7835,"children":7837},{"id":7836},"_5-video-generation-experimental-async-polling",[7838],{"type":83,"value":7839},"5. Video Generation (Experimental -- async polling)",{"type":77,"tag":90,"props":7841,"children":7842},{},[7843],{"type":83,"value":7844},"Video generation uses a jobs\u002Fpolling architecture. The server creates a job,\npolls for status, and streams updates to the client.",{"type":77,"tag":138,"props":7846,"children":7848},{"className":140,"code":7847,"language":51,"meta":142,"style":142},"import {\n  generateVideo,\n  getVideoJobStatus,\n  toServerSentEventsResponse,\n} from '@tanstack\u002Fai'\nimport { openaiVideo } from '@tanstack\u002Fai-openai'\n\n\u002F\u002F Non-streaming: manual polling loop\nconst { jobId } = await generateVideo({\n  adapter: openaiVideo('sora-2'),\n  prompt: 'A golden retriever playing in sunflowers',\n  size: '1280x720',\n  duration: 8,\n})\n\nlet status = await getVideoJobStatus({ adapter: openaiVideo('sora-2'), jobId })\nwhile (status.status !== 'completed' && status.status !== 'failed') {\n  await new Promise((r) => setTimeout(r, 5000))\n  status = await getVideoJobStatus({ adapter: openaiVideo('sora-2'), jobId })\n}\n\n\u002F\u002F Streaming: server handles polling, client gets real-time updates\nconst stream = generateVideo({\n  adapter: openaiVideo('sora-2'),\n  prompt: 'A flying car over a city',\n  stream: true,\n  pollingInterval: 3000,\n  maxDuration: 600_000,\n})\nreturn toServerSentEventsResponse(stream)\n",[7849],{"type":77,"tag":107,"props":7850,"children":7851},{"__ignoreMap":142},[7852,7863,7875,7887,7899,7922,7958,7965,7973,8013,8053,8081,8109,8129,8140,8147,8230,8314,8380,8457,8464,8471,8479,8507,8546,8574,8594,8615,8636,8647],{"type":77,"tag":148,"props":7853,"children":7854},{"class":150,"line":151},[7855,7859],{"type":77,"tag":148,"props":7856,"children":7857},{"style":165},[7858],{"type":83,"value":168},{"type":77,"tag":148,"props":7860,"children":7861},{"style":171},[7862],{"type":83,"value":322},{"type":77,"tag":148,"props":7864,"children":7865},{"class":150,"line":161},[7866,7871],{"type":77,"tag":148,"props":7867,"children":7868},{"style":177},[7869],{"type":83,"value":7870},"  generateVideo",{"type":77,"tag":148,"props":7872,"children":7873},{"style":171},[7874],{"type":83,"value":475},{"type":77,"tag":148,"props":7876,"children":7877},{"class":150,"line":219},[7878,7883],{"type":77,"tag":148,"props":7879,"children":7880},{"style":177},[7881],{"type":83,"value":7882},"  getVideoJobStatus",{"type":77,"tag":148,"props":7884,"children":7885},{"style":171},[7886],{"type":83,"value":475},{"type":77,"tag":148,"props":7888,"children":7889},{"class":150,"line":257},[7890,7895],{"type":77,"tag":148,"props":7891,"children":7892},{"style":177},[7893],{"type":83,"value":7894},"  toServerSentEventsResponse",{"type":77,"tag":148,"props":7896,"children":7897},{"style":171},[7898],{"type":83,"value":475},{"type":77,"tag":148,"props":7900,"children":7901},{"class":150,"line":267},[7902,7906,7910,7914,7918],{"type":77,"tag":148,"props":7903,"children":7904},{"style":171},[7905],{"type":83,"value":1114},{"type":77,"tag":148,"props":7907,"children":7908},{"style":165},[7909],{"type":83,"value":200},{"type":77,"tag":148,"props":7911,"children":7912},{"style":171},[7913],{"type":83,"value":205},{"type":77,"tag":148,"props":7915,"children":7916},{"style":208},[7917],{"type":83,"value":211},{"type":77,"tag":148,"props":7919,"children":7920},{"style":171},[7921],{"type":83,"value":216},{"type":77,"tag":148,"props":7923,"children":7924},{"class":150,"line":325},[7925,7929,7933,7938,7942,7946,7950,7954],{"type":77,"tag":148,"props":7926,"children":7927},{"style":165},[7928],{"type":83,"value":168},{"type":77,"tag":148,"props":7930,"children":7931},{"style":171},[7932],{"type":83,"value":174},{"type":77,"tag":148,"props":7934,"children":7935},{"style":177},[7936],{"type":83,"value":7937}," openaiVideo",{"type":77,"tag":148,"props":7939,"children":7940},{"style":171},[7941],{"type":83,"value":195},{"type":77,"tag":148,"props":7943,"children":7944},{"style":165},[7945],{"type":83,"value":200},{"type":77,"tag":148,"props":7947,"children":7948},{"style":171},[7949],{"type":83,"value":205},{"type":77,"tag":148,"props":7951,"children":7952},{"style":208},[7953],{"type":83,"value":250},{"type":77,"tag":148,"props":7955,"children":7956},{"style":171},[7957],{"type":83,"value":216},{"type":77,"tag":148,"props":7959,"children":7960},{"class":150,"line":396},[7961],{"type":77,"tag":148,"props":7962,"children":7963},{"emptyLinePlaceholder":261},[7964],{"type":83,"value":264},{"type":77,"tag":148,"props":7966,"children":7967},{"class":150,"line":404},[7968],{"type":77,"tag":148,"props":7969,"children":7970},{"style":155},[7971],{"type":83,"value":7972},"\u002F\u002F Non-streaming: manual polling loop\n",{"type":77,"tag":148,"props":7974,"children":7975},{"class":150,"line":434},[7976,7980,7984,7989,7993,7997,8001,8005,8009],{"type":77,"tag":148,"props":7977,"children":7978},{"style":276},[7979],{"type":83,"value":2799},{"type":77,"tag":148,"props":7981,"children":7982},{"style":171},[7983],{"type":83,"value":174},{"type":77,"tag":148,"props":7985,"children":7986},{"style":177},[7987],{"type":83,"value":7988}," jobId ",{"type":77,"tag":148,"props":7990,"children":7991},{"style":171},[7992],{"type":83,"value":1114},{"type":77,"tag":148,"props":7994,"children":7995},{"style":171},[7996],{"type":83,"value":367},{"type":77,"tag":148,"props":7998,"children":7999},{"style":165},[8000],{"type":83,"value":372},{"type":77,"tag":148,"props":8002,"children":8003},{"style":287},[8004],{"type":83,"value":4667},{"type":77,"tag":148,"props":8006,"children":8007},{"style":177},[8008],{"type":83,"value":295},{"type":77,"tag":148,"props":8010,"children":8011},{"style":171},[8012],{"type":83,"value":431},{"type":77,"tag":148,"props":8014,"children":8015},{"class":150,"line":478},[8016,8020,8024,8028,8032,8036,8041,8045,8049],{"type":77,"tag":148,"props":8017,"children":8018},{"style":390},[8019],{"type":83,"value":2832},{"type":77,"tag":148,"props":8021,"children":8022},{"style":171},[8023],{"type":83,"value":306},{"type":77,"tag":148,"props":8025,"children":8026},{"style":287},[8027],{"type":83,"value":7937},{"type":77,"tag":148,"props":8029,"children":8030},{"style":177},[8031],{"type":83,"value":295},{"type":77,"tag":148,"props":8033,"children":8034},{"style":171},[8035],{"type":83,"value":457},{"type":77,"tag":148,"props":8037,"children":8038},{"style":208},[8039],{"type":83,"value":8040},"sora-2",{"type":77,"tag":148,"props":8042,"children":8043},{"style":171},[8044],{"type":83,"value":457},{"type":77,"tag":148,"props":8046,"children":8047},{"style":177},[8048],{"type":83,"value":317},{"type":77,"tag":148,"props":8050,"children":8051},{"style":171},[8052],{"type":83,"value":475},{"type":77,"tag":148,"props":8054,"children":8055},{"class":150,"line":491},[8056,8060,8064,8068,8073,8077],{"type":77,"tag":148,"props":8057,"children":8058},{"style":390},[8059],{"type":83,"value":2872},{"type":77,"tag":148,"props":8061,"children":8062},{"style":171},[8063],{"type":83,"value":306},{"type":77,"tag":148,"props":8065,"children":8066},{"style":171},[8067],{"type":83,"value":205},{"type":77,"tag":148,"props":8069,"children":8070},{"style":208},[8071],{"type":83,"value":8072},"A golden retriever playing in sunflowers",{"type":77,"tag":148,"props":8074,"children":8075},{"style":171},[8076],{"type":83,"value":457},{"type":77,"tag":148,"props":8078,"children":8079},{"style":171},[8080],{"type":83,"value":475},{"type":77,"tag":148,"props":8082,"children":8083},{"class":150,"line":504},[8084,8088,8092,8096,8101,8105],{"type":77,"tag":148,"props":8085,"children":8086},{"style":390},[8087],{"type":83,"value":2901},{"type":77,"tag":148,"props":8089,"children":8090},{"style":171},[8091],{"type":83,"value":306},{"type":77,"tag":148,"props":8093,"children":8094},{"style":171},[8095],{"type":83,"value":205},{"type":77,"tag":148,"props":8097,"children":8098},{"style":208},[8099],{"type":83,"value":8100},"1280x720",{"type":77,"tag":148,"props":8102,"children":8103},{"style":171},[8104],{"type":83,"value":457},{"type":77,"tag":148,"props":8106,"children":8107},{"style":171},[8108],{"type":83,"value":475},{"type":77,"tag":148,"props":8110,"children":8111},{"class":150,"line":517},[8112,8116,8120,8125],{"type":77,"tag":148,"props":8113,"children":8114},{"style":390},[8115],{"type":83,"value":6001},{"type":77,"tag":148,"props":8117,"children":8118},{"style":171},[8119],{"type":83,"value":306},{"type":77,"tag":148,"props":8121,"children":8122},{"style":2937},[8123],{"type":83,"value":8124}," 8",{"type":77,"tag":148,"props":8126,"children":8127},{"style":171},[8128],{"type":83,"value":475},{"type":77,"tag":148,"props":8130,"children":8131},{"class":150,"line":540},[8132,8136],{"type":77,"tag":148,"props":8133,"children":8134},{"style":171},[8135],{"type":83,"value":1114},{"type":77,"tag":148,"props":8137,"children":8138},{"style":177},[8139],{"type":83,"value":551},{"type":77,"tag":148,"props":8141,"children":8142},{"class":150,"line":554},[8143],{"type":77,"tag":148,"props":8144,"children":8145},{"emptyLinePlaceholder":261},[8146],{"type":83,"value":264},{"type":77,"tag":148,"props":8148,"children":8149},{"class":150,"line":562},[8150,8155,8160,8164,8168,8173,8177,8181,8186,8190,8194,8198,8202,8206,8210,8214,8218,8222,8226],{"type":77,"tag":148,"props":8151,"children":8152},{"style":276},[8153],{"type":83,"value":8154},"let",{"type":77,"tag":148,"props":8156,"children":8157},{"style":177},[8158],{"type":83,"value":8159}," status ",{"type":77,"tag":148,"props":8161,"children":8162},{"style":171},[8163],{"type":83,"value":1038},{"type":77,"tag":148,"props":8165,"children":8166},{"style":165},[8167],{"type":83,"value":372},{"type":77,"tag":148,"props":8169,"children":8170},{"style":287},[8171],{"type":83,"value":8172}," getVideoJobStatus",{"type":77,"tag":148,"props":8174,"children":8175},{"style":177},[8176],{"type":83,"value":295},{"type":77,"tag":148,"props":8178,"children":8179},{"style":171},[8180],{"type":83,"value":1104},{"type":77,"tag":148,"props":8182,"children":8183},{"style":390},[8184],{"type":83,"value":8185}," adapter",{"type":77,"tag":148,"props":8187,"children":8188},{"style":171},[8189],{"type":83,"value":306},{"type":77,"tag":148,"props":8191,"children":8192},{"style":287},[8193],{"type":83,"value":7937},{"type":77,"tag":148,"props":8195,"children":8196},{"style":177},[8197],{"type":83,"value":295},{"type":77,"tag":148,"props":8199,"children":8200},{"style":171},[8201],{"type":83,"value":457},{"type":77,"tag":148,"props":8203,"children":8204},{"style":208},[8205],{"type":83,"value":8040},{"type":77,"tag":148,"props":8207,"children":8208},{"style":171},[8209],{"type":83,"value":457},{"type":77,"tag":148,"props":8211,"children":8212},{"style":177},[8213],{"type":83,"value":317},{"type":77,"tag":148,"props":8215,"children":8216},{"style":171},[8217],{"type":83,"value":185},{"type":77,"tag":148,"props":8219,"children":8220},{"style":177},[8221],{"type":83,"value":7988},{"type":77,"tag":148,"props":8223,"children":8224},{"style":171},[8225],{"type":83,"value":1114},{"type":77,"tag":148,"props":8227,"children":8228},{"style":177},[8229],{"type":83,"value":551},{"type":77,"tag":148,"props":8231,"children":8232},{"class":150,"line":588},[8233,8238,8243,8247,8252,8257,8261,8266,8270,8275,8280,8284,8288,8292,8296,8301,8305,8310],{"type":77,"tag":148,"props":8234,"children":8235},{"style":165},[8236],{"type":83,"value":8237},"while",{"type":77,"tag":148,"props":8239,"children":8240},{"style":177},[8241],{"type":83,"value":8242}," (status",{"type":77,"tag":148,"props":8244,"children":8245},{"style":171},[8246],{"type":83,"value":382},{"type":77,"tag":148,"props":8248,"children":8249},{"style":177},[8250],{"type":83,"value":8251},"status ",{"type":77,"tag":148,"props":8253,"children":8254},{"style":171},[8255],{"type":83,"value":8256},"!==",{"type":77,"tag":148,"props":8258,"children":8259},{"style":171},[8260],{"type":83,"value":205},{"type":77,"tag":148,"props":8262,"children":8263},{"style":208},[8264],{"type":83,"value":8265},"completed",{"type":77,"tag":148,"props":8267,"children":8268},{"style":171},[8269],{"type":83,"value":457},{"type":77,"tag":148,"props":8271,"children":8272},{"style":171},[8273],{"type":83,"value":8274}," &&",{"type":77,"tag":148,"props":8276,"children":8277},{"style":177},[8278],{"type":83,"value":8279}," status",{"type":77,"tag":148,"props":8281,"children":8282},{"style":171},[8283],{"type":83,"value":382},{"type":77,"tag":148,"props":8285,"children":8286},{"style":177},[8287],{"type":83,"value":8251},{"type":77,"tag":148,"props":8289,"children":8290},{"style":171},[8291],{"type":83,"value":8256},{"type":77,"tag":148,"props":8293,"children":8294},{"style":171},[8295],{"type":83,"value":205},{"type":77,"tag":148,"props":8297,"children":8298},{"style":208},[8299],{"type":83,"value":8300},"failed",{"type":77,"tag":148,"props":8302,"children":8303},{"style":171},[8304],{"type":83,"value":457},{"type":77,"tag":148,"props":8306,"children":8307},{"style":177},[8308],{"type":83,"value":8309},") ",{"type":77,"tag":148,"props":8311,"children":8312},{"style":171},[8313],{"type":83,"value":431},{"type":77,"tag":148,"props":8315,"children":8316},{"class":150,"line":1076},[8317,8322,8327,8332,8336,8340,8345,8349,8353,8358,8362,8366,8370,8375],{"type":77,"tag":148,"props":8318,"children":8319},{"style":165},[8320],{"type":83,"value":8321},"  await",{"type":77,"tag":148,"props":8323,"children":8324},{"style":171},[8325],{"type":83,"value":8326}," new",{"type":77,"tag":148,"props":8328,"children":8329},{"style":309},[8330],{"type":83,"value":8331}," Promise",{"type":77,"tag":148,"props":8333,"children":8334},{"style":390},[8335],{"type":83,"value":295},{"type":77,"tag":148,"props":8337,"children":8338},{"style":171},[8339],{"type":83,"value":295},{"type":77,"tag":148,"props":8341,"children":8342},{"style":298},[8343],{"type":83,"value":8344},"r",{"type":77,"tag":148,"props":8346,"children":8347},{"style":171},[8348],{"type":83,"value":317},{"type":77,"tag":148,"props":8350,"children":8351},{"style":276},[8352],{"type":83,"value":994},{"type":77,"tag":148,"props":8354,"children":8355},{"style":287},[8356],{"type":83,"value":8357}," setTimeout",{"type":77,"tag":148,"props":8359,"children":8360},{"style":390},[8361],{"type":83,"value":295},{"type":77,"tag":148,"props":8363,"children":8364},{"style":177},[8365],{"type":83,"value":8344},{"type":77,"tag":148,"props":8367,"children":8368},{"style":171},[8369],{"type":83,"value":185},{"type":77,"tag":148,"props":8371,"children":8372},{"style":2937},[8373],{"type":83,"value":8374}," 5000",{"type":77,"tag":148,"props":8376,"children":8377},{"style":390},[8378],{"type":83,"value":8379},"))\n",{"type":77,"tag":148,"props":8381,"children":8382},{"class":150,"line":1125},[8383,8388,8392,8396,8400,8404,8408,8412,8416,8420,8424,8428,8432,8436,8440,8444,8449,8453],{"type":77,"tag":148,"props":8384,"children":8385},{"style":177},[8386],{"type":83,"value":8387},"  status",{"type":77,"tag":148,"props":8389,"children":8390},{"style":171},[8391],{"type":83,"value":367},{"type":77,"tag":148,"props":8393,"children":8394},{"style":165},[8395],{"type":83,"value":372},{"type":77,"tag":148,"props":8397,"children":8398},{"style":287},[8399],{"type":83,"value":8172},{"type":77,"tag":148,"props":8401,"children":8402},{"style":390},[8403],{"type":83,"value":295},{"type":77,"tag":148,"props":8405,"children":8406},{"style":171},[8407],{"type":83,"value":1104},{"type":77,"tag":148,"props":8409,"children":8410},{"style":390},[8411],{"type":83,"value":8185},{"type":77,"tag":148,"props":8413,"children":8414},{"style":171},[8415],{"type":83,"value":306},{"type":77,"tag":148,"props":8417,"children":8418},{"style":287},[8419],{"type":83,"value":7937},{"type":77,"tag":148,"props":8421,"children":8422},{"style":390},[8423],{"type":83,"value":295},{"type":77,"tag":148,"props":8425,"children":8426},{"style":171},[8427],{"type":83,"value":457},{"type":77,"tag":148,"props":8429,"children":8430},{"style":208},[8431],{"type":83,"value":8040},{"type":77,"tag":148,"props":8433,"children":8434},{"style":171},[8435],{"type":83,"value":457},{"type":77,"tag":148,"props":8437,"children":8438},{"style":390},[8439],{"type":83,"value":317},{"type":77,"tag":148,"props":8441,"children":8442},{"style":171},[8443],{"type":83,"value":185},{"type":77,"tag":148,"props":8445,"children":8446},{"style":177},[8447],{"type":83,"value":8448}," jobId",{"type":77,"tag":148,"props":8450,"children":8451},{"style":171},[8452],{"type":83,"value":195},{"type":77,"tag":148,"props":8454,"children":8455},{"style":390},[8456],{"type":83,"value":551},{"type":77,"tag":148,"props":8458,"children":8459},{"class":150,"line":1174},[8460],{"type":77,"tag":148,"props":8461,"children":8462},{"style":171},[8463],{"type":83,"value":594},{"type":77,"tag":148,"props":8465,"children":8466},{"class":150,"line":1183},[8467],{"type":77,"tag":148,"props":8468,"children":8469},{"emptyLinePlaceholder":261},[8470],{"type":83,"value":264},{"type":77,"tag":148,"props":8472,"children":8473},{"class":150,"line":1236},[8474],{"type":77,"tag":148,"props":8475,"children":8476},{"style":155},[8477],{"type":83,"value":8478},"\u002F\u002F Streaming: server handles polling, client gets real-time updates\n",{"type":77,"tag":148,"props":8480,"children":8481},{"class":150,"line":1254},[8482,8486,8491,8495,8499,8503],{"type":77,"tag":148,"props":8483,"children":8484},{"style":276},[8485],{"type":83,"value":2799},{"type":77,"tag":148,"props":8487,"children":8488},{"style":177},[8489],{"type":83,"value":8490}," stream ",{"type":77,"tag":148,"props":8492,"children":8493},{"style":171},[8494],{"type":83,"value":1038},{"type":77,"tag":148,"props":8496,"children":8497},{"style":287},[8498],{"type":83,"value":4667},{"type":77,"tag":148,"props":8500,"children":8501},{"style":177},[8502],{"type":83,"value":295},{"type":77,"tag":148,"props":8504,"children":8505},{"style":171},[8506],{"type":83,"value":431},{"type":77,"tag":148,"props":8508,"children":8509},{"class":150,"line":1262},[8510,8514,8518,8522,8526,8530,8534,8538,8542],{"type":77,"tag":148,"props":8511,"children":8512},{"style":390},[8513],{"type":83,"value":2832},{"type":77,"tag":148,"props":8515,"children":8516},{"style":171},[8517],{"type":83,"value":306},{"type":77,"tag":148,"props":8519,"children":8520},{"style":287},[8521],{"type":83,"value":7937},{"type":77,"tag":148,"props":8523,"children":8524},{"style":177},[8525],{"type":83,"value":295},{"type":77,"tag":148,"props":8527,"children":8528},{"style":171},[8529],{"type":83,"value":457},{"type":77,"tag":148,"props":8531,"children":8532},{"style":208},[8533],{"type":83,"value":8040},{"type":77,"tag":148,"props":8535,"children":8536},{"style":171},[8537],{"type":83,"value":457},{"type":77,"tag":148,"props":8539,"children":8540},{"style":177},[8541],{"type":83,"value":317},{"type":77,"tag":148,"props":8543,"children":8544},{"style":171},[8545],{"type":83,"value":475},{"type":77,"tag":148,"props":8547,"children":8548},{"class":150,"line":1332},[8549,8553,8557,8561,8566,8570],{"type":77,"tag":148,"props":8550,"children":8551},{"style":390},[8552],{"type":83,"value":2872},{"type":77,"tag":148,"props":8554,"children":8555},{"style":171},[8556],{"type":83,"value":306},{"type":77,"tag":148,"props":8558,"children":8559},{"style":171},[8560],{"type":83,"value":205},{"type":77,"tag":148,"props":8562,"children":8563},{"style":208},[8564],{"type":83,"value":8565},"A flying car over a city",{"type":77,"tag":148,"props":8567,"children":8568},{"style":171},[8569],{"type":83,"value":457},{"type":77,"tag":148,"props":8571,"children":8572},{"style":171},[8573],{"type":83,"value":475},{"type":77,"tag":148,"props":8575,"children":8576},{"class":150,"line":1340},[8577,8582,8586,8590],{"type":77,"tag":148,"props":8578,"children":8579},{"style":390},[8580],{"type":83,"value":8581},"  stream",{"type":77,"tag":148,"props":8583,"children":8584},{"style":171},[8585],{"type":83,"value":306},{"type":77,"tag":148,"props":8587,"children":8588},{"style":530},[8589],{"type":83,"value":533},{"type":77,"tag":148,"props":8591,"children":8592},{"style":171},[8593],{"type":83,"value":475},{"type":77,"tag":148,"props":8595,"children":8596},{"class":150,"line":1405},[8597,8602,8606,8611],{"type":77,"tag":148,"props":8598,"children":8599},{"style":390},[8600],{"type":83,"value":8601},"  pollingInterval",{"type":77,"tag":148,"props":8603,"children":8604},{"style":171},[8605],{"type":83,"value":306},{"type":77,"tag":148,"props":8607,"children":8608},{"style":2937},[8609],{"type":83,"value":8610}," 3000",{"type":77,"tag":148,"props":8612,"children":8613},{"style":171},[8614],{"type":83,"value":475},{"type":77,"tag":148,"props":8616,"children":8617},{"class":150,"line":1419},[8618,8623,8627,8632],{"type":77,"tag":148,"props":8619,"children":8620},{"style":390},[8621],{"type":83,"value":8622},"  maxDuration",{"type":77,"tag":148,"props":8624,"children":8625},{"style":171},[8626],{"type":83,"value":306},{"type":77,"tag":148,"props":8628,"children":8629},{"style":2937},[8630],{"type":83,"value":8631}," 600_000",{"type":77,"tag":148,"props":8633,"children":8634},{"style":171},[8635],{"type":83,"value":475},{"type":77,"tag":148,"props":8637,"children":8638},{"class":150,"line":1441},[8639,8643],{"type":77,"tag":148,"props":8640,"children":8641},{"style":171},[8642],{"type":83,"value":1114},{"type":77,"tag":148,"props":8644,"children":8645},{"style":177},[8646],{"type":83,"value":551},{"type":77,"tag":148,"props":8648,"children":8649},{"class":150,"line":1508},[8650,8655,8659],{"type":77,"tag":148,"props":8651,"children":8652},{"style":165},[8653],{"type":83,"value":8654},"return",{"type":77,"tag":148,"props":8656,"children":8657},{"style":287},[8658],{"type":83,"value":190},{"type":77,"tag":148,"props":8660,"children":8661},{"style":177},[8662],{"type":83,"value":8663},"(stream)\n",{"type":77,"tag":90,"props":8665,"children":8666},{},[8667,8669,8674,8676,8682,8684,8690,8692,8698,8700,8706,8708,8713,8715,8720,8722,8727,8728,8733,8734,8739,8740,8745,8746,8751],{"type":83,"value":8668},"Google Veo (",{"type":77,"tag":107,"props":8670,"children":8672},{"className":8671},[],[8673],{"type":83,"value":2772},{"type":83,"value":8675},") uses the same jobs\u002Fpolling flow. Its\n",{"type":77,"tag":107,"props":8677,"children":8679},{"className":8678},[],[8680],{"type":83,"value":8681},"duration",{"type":83,"value":8683}," option is typed per model (",{"type":77,"tag":107,"props":8685,"children":8687},{"className":8686},[],[8688],{"type":83,"value":8689},"4 | 6 | 8",{"type":83,"value":8691}," for the Veo 3.1 models);\nuse ",{"type":77,"tag":107,"props":8693,"children":8695},{"className":8694},[],[8696],{"type":83,"value":8697},"adapter.snapDuration(seconds)",{"type":83,"value":8699}," to coerce raw\nseconds and ",{"type":77,"tag":107,"props":8701,"children":8703},{"className":8702},[],[8704],{"type":83,"value":8705},"adapter.availableDurations()",{"type":83,"value":8707}," to enumerate the valid set.\nImage prompt parts route by ",{"type":77,"tag":107,"props":8709,"children":8711},{"className":8710},[],[8712],{"type":83,"value":3519},{"type":83,"value":8714},": first un-roled \u002F\n",{"type":77,"tag":107,"props":8716,"children":8718},{"className":8717},[],[8719],{"type":83,"value":5398},{"type":83,"value":8721}," image → input image, ",{"type":77,"tag":107,"props":8723,"children":8725},{"className":8724},[],[8726],{"type":83,"value":5437},{"type":83,"value":5662},{"type":77,"tag":107,"props":8729,"children":8731},{"className":8730},[],[8732],{"type":83,"value":5470},{"type":83,"value":475},{"type":77,"tag":107,"props":8735,"children":8737},{"className":8736},[],[8738],{"type":83,"value":5287},{"type":83,"value":3490},{"type":77,"tag":107,"props":8741,"children":8743},{"className":8742},[],[8744],{"type":83,"value":5312},{"type":83,"value":5662},{"type":77,"tag":107,"props":8747,"children":8749},{"className":8748},[],[8750],{"type":83,"value":5330},{"type":83,"value":306},{"type":77,"tag":138,"props":8753,"children":8755},{"className":140,"code":8754,"language":51,"meta":142,"style":142},"import { geminiVideo } from '@tanstack\u002Fai-gemini'\n\nconst adapter = geminiVideo('veo-3.1-generate-preview')\nadapter.availableDurations() \u002F\u002F { kind: 'discrete', values: [4, 6, 8] }\n\nconst { jobId } = await generateVideo({\n  adapter,\n  prompt: 'A golden retriever playing in sunflowers',\n  size: '16:9', \u002F\u002F Veo sizes are aspect ratios: '16:9' | '9:16'\n  duration: adapter.snapDuration(7), \u002F\u002F 6\n  modelOptions: { resolution: '1080p', generateAudio: true },\n})\n\u002F\u002F Note: Veo result URLs require the Google API key to download\n\u002F\u002F (x-goog-api-key header or ?key= query parameter).\n",[8756],{"type":77,"tag":107,"props":8757,"children":8758},{"__ignoreMap":142},[8759,8795,8802,8843,8870,8877,8916,8927,8954,8986,9032,9089,9100,9108],{"type":77,"tag":148,"props":8760,"children":8761},{"class":150,"line":151},[8762,8766,8770,8775,8779,8783,8787,8791],{"type":77,"tag":148,"props":8763,"children":8764},{"style":165},[8765],{"type":83,"value":168},{"type":77,"tag":148,"props":8767,"children":8768},{"style":171},[8769],{"type":83,"value":174},{"type":77,"tag":148,"props":8771,"children":8772},{"style":177},[8773],{"type":83,"value":8774}," geminiVideo",{"type":77,"tag":148,"props":8776,"children":8777},{"style":171},[8778],{"type":83,"value":195},{"type":77,"tag":148,"props":8780,"children":8781},{"style":165},[8782],{"type":83,"value":200},{"type":77,"tag":148,"props":8784,"children":8785},{"style":171},[8786],{"type":83,"value":205},{"type":77,"tag":148,"props":8788,"children":8789},{"style":208},[8790],{"type":83,"value":2772},{"type":77,"tag":148,"props":8792,"children":8793},{"style":171},[8794],{"type":83,"value":216},{"type":77,"tag":148,"props":8796,"children":8797},{"class":150,"line":161},[8798],{"type":77,"tag":148,"props":8799,"children":8800},{"emptyLinePlaceholder":261},[8801],{"type":83,"value":264},{"type":77,"tag":148,"props":8803,"children":8804},{"class":150,"line":219},[8805,8809,8814,8818,8822,8826,8830,8835,8839],{"type":77,"tag":148,"props":8806,"children":8807},{"style":276},[8808],{"type":83,"value":2799},{"type":77,"tag":148,"props":8810,"children":8811},{"style":177},[8812],{"type":83,"value":8813}," adapter ",{"type":77,"tag":148,"props":8815,"children":8816},{"style":171},[8817],{"type":83,"value":1038},{"type":77,"tag":148,"props":8819,"children":8820},{"style":287},[8821],{"type":83,"value":8774},{"type":77,"tag":148,"props":8823,"children":8824},{"style":177},[8825],{"type":83,"value":295},{"type":77,"tag":148,"props":8827,"children":8828},{"style":171},[8829],{"type":83,"value":457},{"type":77,"tag":148,"props":8831,"children":8832},{"style":208},[8833],{"type":83,"value":8834},"veo-3.1-generate-preview",{"type":77,"tag":148,"props":8836,"children":8837},{"style":171},[8838],{"type":83,"value":457},{"type":77,"tag":148,"props":8840,"children":8841},{"style":177},[8842],{"type":83,"value":551},{"type":77,"tag":148,"props":8844,"children":8845},{"class":150,"line":257},[8846,8851,8855,8860,8865],{"type":77,"tag":148,"props":8847,"children":8848},{"style":177},[8849],{"type":83,"value":8850},"adapter",{"type":77,"tag":148,"props":8852,"children":8853},{"style":171},[8854],{"type":83,"value":382},{"type":77,"tag":148,"props":8856,"children":8857},{"style":287},[8858],{"type":83,"value":8859},"availableDurations",{"type":77,"tag":148,"props":8861,"children":8862},{"style":177},[8863],{"type":83,"value":8864},"() ",{"type":77,"tag":148,"props":8866,"children":8867},{"style":155},[8868],{"type":83,"value":8869},"\u002F\u002F { kind: 'discrete', values: [4, 6, 8] }\n",{"type":77,"tag":148,"props":8871,"children":8872},{"class":150,"line":267},[8873],{"type":77,"tag":148,"props":8874,"children":8875},{"emptyLinePlaceholder":261},[8876],{"type":83,"value":264},{"type":77,"tag":148,"props":8878,"children":8879},{"class":150,"line":325},[8880,8884,8888,8892,8896,8900,8904,8908,8912],{"type":77,"tag":148,"props":8881,"children":8882},{"style":276},[8883],{"type":83,"value":2799},{"type":77,"tag":148,"props":8885,"children":8886},{"style":171},[8887],{"type":83,"value":174},{"type":77,"tag":148,"props":8889,"children":8890},{"style":177},[8891],{"type":83,"value":7988},{"type":77,"tag":148,"props":8893,"children":8894},{"style":171},[8895],{"type":83,"value":1114},{"type":77,"tag":148,"props":8897,"children":8898},{"style":171},[8899],{"type":83,"value":367},{"type":77,"tag":148,"props":8901,"children":8902},{"style":165},[8903],{"type":83,"value":372},{"type":77,"tag":148,"props":8905,"children":8906},{"style":287},[8907],{"type":83,"value":4667},{"type":77,"tag":148,"props":8909,"children":8910},{"style":177},[8911],{"type":83,"value":295},{"type":77,"tag":148,"props":8913,"children":8914},{"style":171},[8915],{"type":83,"value":431},{"type":77,"tag":148,"props":8917,"children":8918},{"class":150,"line":396},[8919,8923],{"type":77,"tag":148,"props":8920,"children":8921},{"style":177},[8922],{"type":83,"value":2832},{"type":77,"tag":148,"props":8924,"children":8925},{"style":171},[8926],{"type":83,"value":475},{"type":77,"tag":148,"props":8928,"children":8929},{"class":150,"line":404},[8930,8934,8938,8942,8946,8950],{"type":77,"tag":148,"props":8931,"children":8932},{"style":390},[8933],{"type":83,"value":2872},{"type":77,"tag":148,"props":8935,"children":8936},{"style":171},[8937],{"type":83,"value":306},{"type":77,"tag":148,"props":8939,"children":8940},{"style":171},[8941],{"type":83,"value":205},{"type":77,"tag":148,"props":8943,"children":8944},{"style":208},[8945],{"type":83,"value":8072},{"type":77,"tag":148,"props":8947,"children":8948},{"style":171},[8949],{"type":83,"value":457},{"type":77,"tag":148,"props":8951,"children":8952},{"style":171},[8953],{"type":83,"value":475},{"type":77,"tag":148,"props":8955,"children":8956},{"class":150,"line":434},[8957,8961,8965,8969,8973,8977,8981],{"type":77,"tag":148,"props":8958,"children":8959},{"style":390},[8960],{"type":83,"value":2901},{"type":77,"tag":148,"props":8962,"children":8963},{"style":171},[8964],{"type":83,"value":306},{"type":77,"tag":148,"props":8966,"children":8967},{"style":171},[8968],{"type":83,"value":205},{"type":77,"tag":148,"props":8970,"children":8971},{"style":208},[8972],{"type":83,"value":3368},{"type":77,"tag":148,"props":8974,"children":8975},{"style":171},[8976],{"type":83,"value":457},{"type":77,"tag":148,"props":8978,"children":8979},{"style":171},[8980],{"type":83,"value":185},{"type":77,"tag":148,"props":8982,"children":8983},{"style":155},[8984],{"type":83,"value":8985}," \u002F\u002F Veo sizes are aspect ratios: '16:9' | '9:16'\n",{"type":77,"tag":148,"props":8987,"children":8988},{"class":150,"line":478},[8989,8993,8997,9001,9005,9010,9014,9019,9023,9027],{"type":77,"tag":148,"props":8990,"children":8991},{"style":390},[8992],{"type":83,"value":6001},{"type":77,"tag":148,"props":8994,"children":8995},{"style":171},[8996],{"type":83,"value":306},{"type":77,"tag":148,"props":8998,"children":8999},{"style":177},[9000],{"type":83,"value":8185},{"type":77,"tag":148,"props":9002,"children":9003},{"style":171},[9004],{"type":83,"value":382},{"type":77,"tag":148,"props":9006,"children":9007},{"style":287},[9008],{"type":83,"value":9009},"snapDuration",{"type":77,"tag":148,"props":9011,"children":9012},{"style":177},[9013],{"type":83,"value":295},{"type":77,"tag":148,"props":9015,"children":9016},{"style":2937},[9017],{"type":83,"value":9018},"7",{"type":77,"tag":148,"props":9020,"children":9021},{"style":177},[9022],{"type":83,"value":317},{"type":77,"tag":148,"props":9024,"children":9025},{"style":171},[9026],{"type":83,"value":185},{"type":77,"tag":148,"props":9028,"children":9029},{"style":155},[9030],{"type":83,"value":9031}," \u002F\u002F 6\n",{"type":77,"tag":148,"props":9033,"children":9034},{"class":150,"line":491},[9035,9039,9043,9047,9052,9056,9060,9065,9069,9073,9077,9081,9085],{"type":77,"tag":148,"props":9036,"children":9037},{"style":390},[9038],{"type":83,"value":2952},{"type":77,"tag":148,"props":9040,"children":9041},{"style":171},[9042],{"type":83,"value":306},{"type":77,"tag":148,"props":9044,"children":9045},{"style":171},[9046],{"type":83,"value":174},{"type":77,"tag":148,"props":9048,"children":9049},{"style":390},[9050],{"type":83,"value":9051}," resolution",{"type":77,"tag":148,"props":9053,"children":9054},{"style":171},[9055],{"type":83,"value":306},{"type":77,"tag":148,"props":9057,"children":9058},{"style":171},[9059],{"type":83,"value":205},{"type":77,"tag":148,"props":9061,"children":9062},{"style":208},[9063],{"type":83,"value":9064},"1080p",{"type":77,"tag":148,"props":9066,"children":9067},{"style":171},[9068],{"type":83,"value":457},{"type":77,"tag":148,"props":9070,"children":9071},{"style":171},[9072],{"type":83,"value":185},{"type":77,"tag":148,"props":9074,"children":9075},{"style":390},[9076],{"type":83,"value":5830},{"type":77,"tag":148,"props":9078,"children":9079},{"style":171},[9080],{"type":83,"value":306},{"type":77,"tag":148,"props":9082,"children":9083},{"style":530},[9084],{"type":83,"value":533},{"type":77,"tag":148,"props":9086,"children":9087},{"style":171},[9088],{"type":83,"value":3377},{"type":77,"tag":148,"props":9090,"children":9091},{"class":150,"line":504},[9092,9096],{"type":77,"tag":148,"props":9093,"children":9094},{"style":171},[9095],{"type":83,"value":1114},{"type":77,"tag":148,"props":9097,"children":9098},{"style":177},[9099],{"type":83,"value":551},{"type":77,"tag":148,"props":9101,"children":9102},{"class":150,"line":517},[9103],{"type":77,"tag":148,"props":9104,"children":9105},{"style":155},[9106],{"type":83,"value":9107},"\u002F\u002F Note: Veo result URLs require the Google API key to download\n",{"type":77,"tag":148,"props":9109,"children":9110},{"class":150,"line":540},[9111],{"type":77,"tag":148,"props":9112,"children":9113},{"style":155},[9114],{"type":83,"value":9115},"\u002F\u002F (x-goog-api-key header or ?key= query parameter).\n",{"type":77,"tag":90,"props":9117,"children":9118},{},[9119,9121,9127,9129,9134,9136,9142,9144,9150,9152,9157,9159,9165,9167,9172,9174,9179,9181,9186,9188,9194,9196,9202],{"type":83,"value":9120},"Gemini Omni Flash (",{"type":77,"tag":107,"props":9122,"children":9124},{"className":9123},[],[9125],{"type":83,"value":9126},"geminiVideo('gemini-omni-flash-preview')",{"type":83,"value":9128},") is served by\nthe Interactions API instead of Veo's operations flow — same adapter, routed\nby model. Clips are 720p; ",{"type":77,"tag":107,"props":9130,"children":9132},{"className":9131},[],[9133],{"type":83,"value":8681},{"type":83,"value":9135}," is any number of seconds in the 3–10\nrange (fractional ok, default 10 — availableDurations() reports the range),\n",{"type":77,"tag":107,"props":9137,"children":9139},{"className":9138},[],[9140],{"type":83,"value":9141},"size",{"type":83,"value":9143}," is the aspect ratio (",{"type":77,"tag":107,"props":9145,"children":9147},{"className":9146},[],[9148],{"type":83,"value":9149},"'16:9' | '9:16'",{"type":83,"value":9151},"), and the finished video arrives\n",{"type":77,"tag":94,"props":9153,"children":9154},{},[9155],{"type":83,"value":9156},"inline",{"type":83,"value":9158}," as a ",{"type":77,"tag":107,"props":9160,"children":9162},{"className":9161},[],[9163],{"type":83,"value":9164},"data:video\u002Fmp4;base64,…",{"type":83,"value":9166}," URL (no key needed to use it).\nImage\u002Fvideo prompt parts are sent as interaction content blocks, grouped\nas images, then videos, then text (no\n",{"type":77,"tag":107,"props":9168,"children":9170},{"className":9169},[],[9171],{"type":83,"value":3519},{"type":83,"value":9173}," routing); ",{"type":77,"tag":107,"props":9175,"children":9177},{"className":9176},[],[9178],{"type":83,"value":1930},{"type":83,"value":9180}," sources go inline, ",{"type":77,"tag":107,"props":9182,"children":9184},{"className":9183},[],[9185],{"type":83,"value":3810},{"type":83,"value":9187}," sources pass\nthrough as-is (never downloaded — use Gemini Files API URIs for remote\nmedia). For conversational editing, pass a prior generation's ",{"type":77,"tag":107,"props":9189,"children":9191},{"className":9190},[],[9192],{"type":83,"value":9193},"jobId",{"type":83,"value":9195}," as\n",{"type":77,"tag":107,"props":9197,"children":9199},{"className":9198},[],[9200],{"type":83,"value":9201},"modelOptions.previous_interaction_id",{"type":83,"value":9203}," with a prompt describing the change:",{"type":77,"tag":138,"props":9205,"children":9207},{"className":140,"code":9206,"language":51,"meta":142,"style":142},"import { geminiVideo } from '@tanstack\u002Fai-gemini'\n\nconst omni = geminiVideo('gemini-omni-flash-preview')\nconst first = await generateVideo({\n  adapter: omni,\n  prompt: 'A violinist outdoors',\n})\n\u002F\u002F …poll first.jobId to completion, then edit it:\nconst edited = await generateVideo({\n  adapter: omni,\n  prompt: 'Make the violin invisible',\n  modelOptions: { previous_interaction_id: first.jobId },\n})\n",[9208],{"type":77,"tag":107,"props":9209,"children":9210},{"__ignoreMap":142},[9211,9246,9253,9294,9326,9346,9374,9385,9393,9425,9444,9472,9514],{"type":77,"tag":148,"props":9212,"children":9213},{"class":150,"line":151},[9214,9218,9222,9226,9230,9234,9238,9242],{"type":77,"tag":148,"props":9215,"children":9216},{"style":165},[9217],{"type":83,"value":168},{"type":77,"tag":148,"props":9219,"children":9220},{"style":171},[9221],{"type":83,"value":174},{"type":77,"tag":148,"props":9223,"children":9224},{"style":177},[9225],{"type":83,"value":8774},{"type":77,"tag":148,"props":9227,"children":9228},{"style":171},[9229],{"type":83,"value":195},{"type":77,"tag":148,"props":9231,"children":9232},{"style":165},[9233],{"type":83,"value":200},{"type":77,"tag":148,"props":9235,"children":9236},{"style":171},[9237],{"type":83,"value":205},{"type":77,"tag":148,"props":9239,"children":9240},{"style":208},[9241],{"type":83,"value":2772},{"type":77,"tag":148,"props":9243,"children":9244},{"style":171},[9245],{"type":83,"value":216},{"type":77,"tag":148,"props":9247,"children":9248},{"class":150,"line":161},[9249],{"type":77,"tag":148,"props":9250,"children":9251},{"emptyLinePlaceholder":261},[9252],{"type":83,"value":264},{"type":77,"tag":148,"props":9254,"children":9255},{"class":150,"line":219},[9256,9260,9265,9269,9273,9277,9281,9286,9290],{"type":77,"tag":148,"props":9257,"children":9258},{"style":276},[9259],{"type":83,"value":2799},{"type":77,"tag":148,"props":9261,"children":9262},{"style":177},[9263],{"type":83,"value":9264}," omni ",{"type":77,"tag":148,"props":9266,"children":9267},{"style":171},[9268],{"type":83,"value":1038},{"type":77,"tag":148,"props":9270,"children":9271},{"style":287},[9272],{"type":83,"value":8774},{"type":77,"tag":148,"props":9274,"children":9275},{"style":177},[9276],{"type":83,"value":295},{"type":77,"tag":148,"props":9278,"children":9279},{"style":171},[9280],{"type":83,"value":457},{"type":77,"tag":148,"props":9282,"children":9283},{"style":208},[9284],{"type":83,"value":9285},"gemini-omni-flash-preview",{"type":77,"tag":148,"props":9287,"children":9288},{"style":171},[9289],{"type":83,"value":457},{"type":77,"tag":148,"props":9291,"children":9292},{"style":177},[9293],{"type":83,"value":551},{"type":77,"tag":148,"props":9295,"children":9296},{"class":150,"line":257},[9297,9301,9306,9310,9314,9318,9322],{"type":77,"tag":148,"props":9298,"children":9299},{"style":276},[9300],{"type":83,"value":2799},{"type":77,"tag":148,"props":9302,"children":9303},{"style":177},[9304],{"type":83,"value":9305}," first ",{"type":77,"tag":148,"props":9307,"children":9308},{"style":171},[9309],{"type":83,"value":1038},{"type":77,"tag":148,"props":9311,"children":9312},{"style":165},[9313],{"type":83,"value":372},{"type":77,"tag":148,"props":9315,"children":9316},{"style":287},[9317],{"type":83,"value":4667},{"type":77,"tag":148,"props":9319,"children":9320},{"style":177},[9321],{"type":83,"value":295},{"type":77,"tag":148,"props":9323,"children":9324},{"style":171},[9325],{"type":83,"value":431},{"type":77,"tag":148,"props":9327,"children":9328},{"class":150,"line":267},[9329,9333,9337,9342],{"type":77,"tag":148,"props":9330,"children":9331},{"style":390},[9332],{"type":83,"value":2832},{"type":77,"tag":148,"props":9334,"children":9335},{"style":171},[9336],{"type":83,"value":306},{"type":77,"tag":148,"props":9338,"children":9339},{"style":177},[9340],{"type":83,"value":9341}," omni",{"type":77,"tag":148,"props":9343,"children":9344},{"style":171},[9345],{"type":83,"value":475},{"type":77,"tag":148,"props":9347,"children":9348},{"class":150,"line":325},[9349,9353,9357,9361,9366,9370],{"type":77,"tag":148,"props":9350,"children":9351},{"style":390},[9352],{"type":83,"value":2872},{"type":77,"tag":148,"props":9354,"children":9355},{"style":171},[9356],{"type":83,"value":306},{"type":77,"tag":148,"props":9358,"children":9359},{"style":171},[9360],{"type":83,"value":205},{"type":77,"tag":148,"props":9362,"children":9363},{"style":208},[9364],{"type":83,"value":9365},"A violinist outdoors",{"type":77,"tag":148,"props":9367,"children":9368},{"style":171},[9369],{"type":83,"value":457},{"type":77,"tag":148,"props":9371,"children":9372},{"style":171},[9373],{"type":83,"value":475},{"type":77,"tag":148,"props":9375,"children":9376},{"class":150,"line":396},[9377,9381],{"type":77,"tag":148,"props":9378,"children":9379},{"style":171},[9380],{"type":83,"value":1114},{"type":77,"tag":148,"props":9382,"children":9383},{"style":177},[9384],{"type":83,"value":551},{"type":77,"tag":148,"props":9386,"children":9387},{"class":150,"line":404},[9388],{"type":77,"tag":148,"props":9389,"children":9390},{"style":155},[9391],{"type":83,"value":9392},"\u002F\u002F …poll first.jobId to completion, then edit it:\n",{"type":77,"tag":148,"props":9394,"children":9395},{"class":150,"line":434},[9396,9400,9405,9409,9413,9417,9421],{"type":77,"tag":148,"props":9397,"children":9398},{"style":276},[9399],{"type":83,"value":2799},{"type":77,"tag":148,"props":9401,"children":9402},{"style":177},[9403],{"type":83,"value":9404}," edited ",{"type":77,"tag":148,"props":9406,"children":9407},{"style":171},[9408],{"type":83,"value":1038},{"type":77,"tag":148,"props":9410,"children":9411},{"style":165},[9412],{"type":83,"value":372},{"type":77,"tag":148,"props":9414,"children":9415},{"style":287},[9416],{"type":83,"value":4667},{"type":77,"tag":148,"props":9418,"children":9419},{"style":177},[9420],{"type":83,"value":295},{"type":77,"tag":148,"props":9422,"children":9423},{"style":171},[9424],{"type":83,"value":431},{"type":77,"tag":148,"props":9426,"children":9427},{"class":150,"line":478},[9428,9432,9436,9440],{"type":77,"tag":148,"props":9429,"children":9430},{"style":390},[9431],{"type":83,"value":2832},{"type":77,"tag":148,"props":9433,"children":9434},{"style":171},[9435],{"type":83,"value":306},{"type":77,"tag":148,"props":9437,"children":9438},{"style":177},[9439],{"type":83,"value":9341},{"type":77,"tag":148,"props":9441,"children":9442},{"style":171},[9443],{"type":83,"value":475},{"type":77,"tag":148,"props":9445,"children":9446},{"class":150,"line":491},[9447,9451,9455,9459,9464,9468],{"type":77,"tag":148,"props":9448,"children":9449},{"style":390},[9450],{"type":83,"value":2872},{"type":77,"tag":148,"props":9452,"children":9453},{"style":171},[9454],{"type":83,"value":306},{"type":77,"tag":148,"props":9456,"children":9457},{"style":171},[9458],{"type":83,"value":205},{"type":77,"tag":148,"props":9460,"children":9461},{"style":208},[9462],{"type":83,"value":9463},"Make the violin invisible",{"type":77,"tag":148,"props":9465,"children":9466},{"style":171},[9467],{"type":83,"value":457},{"type":77,"tag":148,"props":9469,"children":9470},{"style":171},[9471],{"type":83,"value":475},{"type":77,"tag":148,"props":9473,"children":9474},{"class":150,"line":504},[9475,9479,9483,9487,9492,9496,9501,9505,9510],{"type":77,"tag":148,"props":9476,"children":9477},{"style":390},[9478],{"type":83,"value":2952},{"type":77,"tag":148,"props":9480,"children":9481},{"style":171},[9482],{"type":83,"value":306},{"type":77,"tag":148,"props":9484,"children":9485},{"style":171},[9486],{"type":83,"value":174},{"type":77,"tag":148,"props":9488,"children":9489},{"style":390},[9490],{"type":83,"value":9491}," previous_interaction_id",{"type":77,"tag":148,"props":9493,"children":9494},{"style":171},[9495],{"type":83,"value":306},{"type":77,"tag":148,"props":9497,"children":9498},{"style":177},[9499],{"type":83,"value":9500}," first",{"type":77,"tag":148,"props":9502,"children":9503},{"style":171},[9504],{"type":83,"value":382},{"type":77,"tag":148,"props":9506,"children":9507},{"style":177},[9508],{"type":83,"value":9509},"jobId ",{"type":77,"tag":148,"props":9511,"children":9512},{"style":171},[9513],{"type":83,"value":4562},{"type":77,"tag":148,"props":9515,"children":9516},{"class":150,"line":517},[9517,9521],{"type":77,"tag":148,"props":9518,"children":9519},{"style":171},[9520],{"type":83,"value":1114},{"type":77,"tag":148,"props":9522,"children":9523},{"style":177},[9524],{"type":83,"value":551},{"type":77,"tag":90,"props":9526,"children":9527},{},[9528,9530,9536,9538,9544,9546,9551,9553,9559,9561,9567,9569,9575,9577,9582,9584,9590,9592,9598,9600,9606,9608,9614],{"type":83,"value":9529},"Other video adapters: ",{"type":77,"tag":107,"props":9531,"children":9533},{"className":9532},[],[9534],{"type":83,"value":9535},"openaiVideo('sora-2')",{"type":83,"value":9537}," (pixel sizes like ",{"type":77,"tag":107,"props":9539,"children":9541},{"className":9540},[],[9542],{"type":83,"value":9543},"'1280x720'",{"type":83,"value":9545},",\ndurations 4\u002F8\u002F12s, single ",{"type":77,"tag":107,"props":9547,"children":9549},{"className":9548},[],[9550],{"type":83,"value":5154},{"type":83,"value":9552}," image prompt part), ",{"type":77,"tag":107,"props":9554,"children":9556},{"className":9555},[],[9557],{"type":83,"value":9558},"grokVideo(...)",{"type":83,"value":9560},"\n(",{"type":77,"tag":107,"props":9562,"children":9564},{"className":9563},[],[9565],{"type":83,"value":9566},"grok-imagine-video",{"type":83,"value":9568}," does text-to-video + image-to-video; ",{"type":77,"tag":107,"props":9570,"children":9572},{"className":9571},[],[9573],{"type":83,"value":9574},"grok-imagine-video-1.5",{"type":83,"value":9576}," is\nimage-to-video only — needs an ",{"type":77,"tag":107,"props":9578,"children":9580},{"className":9579},[],[9581],{"type":83,"value":3772},{"type":83,"value":9583}," prompt part as the starting frame, text-only throws;\naspect-ratio size template like ",{"type":77,"tag":107,"props":9585,"children":9587},{"className":9586},[],[9588],{"type":83,"value":9589},"'16:9_720p'",{"type":83,"value":9591},", integer durations 1-15s, reports\n",{"type":77,"tag":107,"props":9593,"children":9595},{"className":9594},[],[9596],{"type":83,"value":9597},"usage.unitsBilled",{"type":83,"value":9599}," seconds and exact ",{"type":77,"tag":107,"props":9601,"children":9603},{"className":9602},[],[9604],{"type":83,"value":9605},"usage.cost",{"type":83,"value":9607},"), and ",{"type":77,"tag":107,"props":9609,"children":9611},{"className":9610},[],[9612],{"type":83,"value":9613},"falVideo(...)",{"type":83,"value":9615}," (hosted models, see cost tracking below).",{"type":77,"tag":90,"props":9617,"children":9618},{},[9619],{"type":83,"value":9620},"Client hook with job tracking:",{"type":77,"tag":138,"props":9622,"children":9624},{"className":603,"code":9623,"language":605,"meta":142,"style":142},"import { useGenerateVideo, fetchServerSentEvents } from '@tanstack\u002Fai-react'\n\nconst { generate, result, jobId, videoStatus, isLoading } = useGenerateVideo({\n  connection: fetchServerSentEvents('\u002Fapi\u002Fgenerate\u002Fvideo'),\n  onJobCreated: (id) => console.log('Job created:', id),\n  onStatusUpdate: (status) =>\n    console.log(`${status.status} (${status.progress}%)`),\n})\n\n\u002F\u002F videoStatus: { jobId, status, progress?, url?, error?, usage? }\n\u002F\u002F result (on completion): { url }\n",[9625],{"type":77,"tag":107,"props":9626,"children":9627},{"__ignoreMap":142},[9628,9672,9679,9747,9787,9860,9890,9974,9985,9992,10000],{"type":77,"tag":148,"props":9629,"children":9630},{"class":150,"line":151},[9631,9635,9639,9644,9648,9652,9656,9660,9664,9668],{"type":77,"tag":148,"props":9632,"children":9633},{"style":165},[9634],{"type":83,"value":168},{"type":77,"tag":148,"props":9636,"children":9637},{"style":171},[9638],{"type":83,"value":174},{"type":77,"tag":148,"props":9640,"children":9641},{"style":177},[9642],{"type":83,"value":9643}," useGenerateVideo",{"type":77,"tag":148,"props":9645,"children":9646},{"style":171},[9647],{"type":83,"value":185},{"type":77,"tag":148,"props":9649,"children":9650},{"style":177},[9651],{"type":83,"value":634},{"type":77,"tag":148,"props":9653,"children":9654},{"style":171},[9655],{"type":83,"value":195},{"type":77,"tag":148,"props":9657,"children":9658},{"style":165},[9659],{"type":83,"value":200},{"type":77,"tag":148,"props":9661,"children":9662},{"style":171},[9663],{"type":83,"value":205},{"type":77,"tag":148,"props":9665,"children":9666},{"style":208},[9667],{"type":83,"value":651},{"type":77,"tag":148,"props":9669,"children":9670},{"style":171},[9671],{"type":83,"value":216},{"type":77,"tag":148,"props":9673,"children":9674},{"class":150,"line":161},[9675],{"type":77,"tag":148,"props":9676,"children":9677},{"emptyLinePlaceholder":261},[9678],{"type":83,"value":264},{"type":77,"tag":148,"props":9680,"children":9681},{"class":150,"line":219},[9682,9686,9690,9694,9698,9702,9706,9710,9714,9719,9723,9727,9731,9735,9739,9743],{"type":77,"tag":148,"props":9683,"children":9684},{"style":276},[9685],{"type":83,"value":2799},{"type":77,"tag":148,"props":9687,"children":9688},{"style":171},[9689],{"type":83,"value":174},{"type":77,"tag":148,"props":9691,"children":9692},{"style":177},[9693],{"type":83,"value":788},{"type":77,"tag":148,"props":9695,"children":9696},{"style":171},[9697],{"type":83,"value":185},{"type":77,"tag":148,"props":9699,"children":9700},{"style":177},[9701],{"type":83,"value":797},{"type":77,"tag":148,"props":9703,"children":9704},{"style":171},[9705],{"type":83,"value":185},{"type":77,"tag":148,"props":9707,"children":9708},{"style":177},[9709],{"type":83,"value":8448},{"type":77,"tag":148,"props":9711,"children":9712},{"style":171},[9713],{"type":83,"value":185},{"type":77,"tag":148,"props":9715,"children":9716},{"style":177},[9717],{"type":83,"value":9718}," videoStatus",{"type":77,"tag":148,"props":9720,"children":9721},{"style":171},[9722],{"type":83,"value":185},{"type":77,"tag":148,"props":9724,"children":9725},{"style":177},[9726],{"type":83,"value":6143},{"type":77,"tag":148,"props":9728,"children":9729},{"style":171},[9730],{"type":83,"value":1114},{"type":77,"tag":148,"props":9732,"children":9733},{"style":171},[9734],{"type":83,"value":367},{"type":77,"tag":148,"props":9736,"children":9737},{"style":287},[9738],{"type":83,"value":9643},{"type":77,"tag":148,"props":9740,"children":9741},{"style":177},[9742],{"type":83,"value":295},{"type":77,"tag":148,"props":9744,"children":9745},{"style":171},[9746],{"type":83,"value":431},{"type":77,"tag":148,"props":9748,"children":9749},{"class":150,"line":257},[9750,9754,9758,9762,9766,9770,9775,9779,9783],{"type":77,"tag":148,"props":9751,"children":9752},{"style":390},[9753],{"type":83,"value":6171},{"type":77,"tag":148,"props":9755,"children":9756},{"style":171},[9757],{"type":83,"value":306},{"type":77,"tag":148,"props":9759,"children":9760},{"style":287},[9761],{"type":83,"value":634},{"type":77,"tag":148,"props":9763,"children":9764},{"style":177},[9765],{"type":83,"value":295},{"type":77,"tag":148,"props":9767,"children":9768},{"style":171},[9769],{"type":83,"value":457},{"type":77,"tag":148,"props":9771,"children":9772},{"style":208},[9773],{"type":83,"value":9774},"\u002Fapi\u002Fgenerate\u002Fvideo",{"type":77,"tag":148,"props":9776,"children":9777},{"style":171},[9778],{"type":83,"value":457},{"type":77,"tag":148,"props":9780,"children":9781},{"style":177},[9782],{"type":83,"value":317},{"type":77,"tag":148,"props":9784,"children":9785},{"style":171},[9786],{"type":83,"value":475},{"type":77,"tag":148,"props":9788,"children":9789},{"class":150,"line":267},[9790,9795,9799,9803,9808,9812,9816,9821,9825,9830,9834,9838,9843,9847,9851,9856],{"type":77,"tag":148,"props":9791,"children":9792},{"style":287},[9793],{"type":83,"value":9794},"  onJobCreated",{"type":77,"tag":148,"props":9796,"children":9797},{"style":171},[9798],{"type":83,"value":306},{"type":77,"tag":148,"props":9800,"children":9801},{"style":171},[9802],{"type":83,"value":2369},{"type":77,"tag":148,"props":9804,"children":9805},{"style":298},[9806],{"type":83,"value":9807},"id",{"type":77,"tag":148,"props":9809,"children":9810},{"style":171},[9811],{"type":83,"value":317},{"type":77,"tag":148,"props":9813,"children":9814},{"style":276},[9815],{"type":83,"value":994},{"type":77,"tag":148,"props":9817,"children":9818},{"style":177},[9819],{"type":83,"value":9820}," console",{"type":77,"tag":148,"props":9822,"children":9823},{"style":171},[9824],{"type":83,"value":382},{"type":77,"tag":148,"props":9826,"children":9827},{"style":287},[9828],{"type":83,"value":9829},"log",{"type":77,"tag":148,"props":9831,"children":9832},{"style":177},[9833],{"type":83,"value":295},{"type":77,"tag":148,"props":9835,"children":9836},{"style":171},[9837],{"type":83,"value":457},{"type":77,"tag":148,"props":9839,"children":9840},{"style":208},[9841],{"type":83,"value":9842},"Job created:",{"type":77,"tag":148,"props":9844,"children":9845},{"style":171},[9846],{"type":83,"value":457},{"type":77,"tag":148,"props":9848,"children":9849},{"style":171},[9850],{"type":83,"value":185},{"type":77,"tag":148,"props":9852,"children":9853},{"style":177},[9854],{"type":83,"value":9855}," id)",{"type":77,"tag":148,"props":9857,"children":9858},{"style":171},[9859],{"type":83,"value":475},{"type":77,"tag":148,"props":9861,"children":9862},{"class":150,"line":325},[9863,9868,9872,9876,9881,9885],{"type":77,"tag":148,"props":9864,"children":9865},{"style":287},[9866],{"type":83,"value":9867},"  onStatusUpdate",{"type":77,"tag":148,"props":9869,"children":9870},{"style":171},[9871],{"type":83,"value":306},{"type":77,"tag":148,"props":9873,"children":9874},{"style":171},[9875],{"type":83,"value":2369},{"type":77,"tag":148,"props":9877,"children":9878},{"style":298},[9879],{"type":83,"value":9880},"status",{"type":77,"tag":148,"props":9882,"children":9883},{"style":171},[9884],{"type":83,"value":317},{"type":77,"tag":148,"props":9886,"children":9887},{"style":276},[9888],{"type":83,"value":9889}," =>\n",{"type":77,"tag":148,"props":9891,"children":9892},{"class":150,"line":396},[9893,9898,9902,9906,9910,9915,9919,9923,9927,9931,9935,9939,9943,9947,9952,9956,9961,9966,9970],{"type":77,"tag":148,"props":9894,"children":9895},{"style":177},[9896],{"type":83,"value":9897},"    console",{"type":77,"tag":148,"props":9899,"children":9900},{"style":171},[9901],{"type":83,"value":382},{"type":77,"tag":148,"props":9903,"children":9904},{"style":287},[9905],{"type":83,"value":9829},{"type":77,"tag":148,"props":9907,"children":9908},{"style":177},[9909],{"type":83,"value":295},{"type":77,"tag":148,"props":9911,"children":9912},{"style":171},[9913],{"type":83,"value":9914},"`${",{"type":77,"tag":148,"props":9916,"children":9917},{"style":177},[9918],{"type":83,"value":9880},{"type":77,"tag":148,"props":9920,"children":9921},{"style":171},[9922],{"type":83,"value":382},{"type":77,"tag":148,"props":9924,"children":9925},{"style":177},[9926],{"type":83,"value":9880},{"type":77,"tag":148,"props":9928,"children":9929},{"style":171},[9930],{"type":83,"value":1114},{"type":77,"tag":148,"props":9932,"children":9933},{"style":208},[9934],{"type":83,"value":2369},{"type":77,"tag":148,"props":9936,"children":9937},{"style":171},[9938],{"type":83,"value":1483},{"type":77,"tag":148,"props":9940,"children":9941},{"style":177},[9942],{"type":83,"value":9880},{"type":77,"tag":148,"props":9944,"children":9945},{"style":171},[9946],{"type":83,"value":382},{"type":77,"tag":148,"props":9948,"children":9949},{"style":177},[9950],{"type":83,"value":9951},"progress",{"type":77,"tag":148,"props":9953,"children":9954},{"style":171},[9955],{"type":83,"value":1114},{"type":77,"tag":148,"props":9957,"children":9958},{"style":208},[9959],{"type":83,"value":9960},"%)",{"type":77,"tag":148,"props":9962,"children":9963},{"style":171},[9964],{"type":83,"value":9965},"`",{"type":77,"tag":148,"props":9967,"children":9968},{"style":177},[9969],{"type":83,"value":317},{"type":77,"tag":148,"props":9971,"children":9972},{"style":171},[9973],{"type":83,"value":475},{"type":77,"tag":148,"props":9975,"children":9976},{"class":150,"line":404},[9977,9981],{"type":77,"tag":148,"props":9978,"children":9979},{"style":171},[9980],{"type":83,"value":1114},{"type":77,"tag":148,"props":9982,"children":9983},{"style":177},[9984],{"type":83,"value":551},{"type":77,"tag":148,"props":9986,"children":9987},{"class":150,"line":434},[9988],{"type":77,"tag":148,"props":9989,"children":9990},{"emptyLinePlaceholder":261},[9991],{"type":83,"value":264},{"type":77,"tag":148,"props":9993,"children":9994},{"class":150,"line":478},[9995],{"type":77,"tag":148,"props":9996,"children":9997},{"style":155},[9998],{"type":83,"value":9999},"\u002F\u002F videoStatus: { jobId, status, progress?, url?, error?, usage? }\n",{"type":77,"tag":148,"props":10001,"children":10002},{"class":150,"line":491},[10003],{"type":77,"tag":148,"props":10004,"children":10005},{"style":155},[10006],{"type":83,"value":10007},"\u002F\u002F result (on completion): { url }\n",{"type":77,"tag":131,"props":10009,"children":10011},{"id":10010},"_6-cost-tracking-fal-billable-units",[10012],{"type":83,"value":10013},"6. Cost tracking (fal billable units)",{"type":77,"tag":90,"props":10015,"children":10016},{},[10017,10019,10025,10026,10031,10032,10038,10039,10045,10046,10052,10054,10059,10061,10067,10069,10075,10077,10083,10085,10090,10092,10098],{"type":83,"value":10018},"fal bills media generation by usage-based units, not tokens. Every fal media\nadapter (",{"type":77,"tag":107,"props":10020,"children":10022},{"className":10021},[],[10023],{"type":83,"value":10024},"falImage",{"type":83,"value":3416},{"type":77,"tag":107,"props":10027,"children":10029},{"className":10028},[],[10030],{"type":83,"value":5805},{"type":83,"value":3416},{"type":77,"tag":107,"props":10033,"children":10035},{"className":10034},[],[10036],{"type":83,"value":10037},"falSpeech",{"type":83,"value":3416},{"type":77,"tag":107,"props":10040,"children":10042},{"className":10041},[],[10043],{"type":83,"value":10044},"falTranscription",{"type":83,"value":3416},{"type":77,"tag":107,"props":10047,"children":10049},{"className":10048},[],[10050],{"type":83,"value":10051},"falVideo",{"type":83,"value":10053},")\nsurfaces the real billed quantity on the result as ",{"type":77,"tag":107,"props":10055,"children":10057},{"className":10056},[],[10058],{"type":83,"value":9597},{"type":83,"value":10060},", read\nfrom fal's ",{"type":77,"tag":107,"props":10062,"children":10064},{"className":10063},[],[10065],{"type":83,"value":10066},"x-fal-billable-units",{"type":83,"value":10068}," response header — no ",{"type":77,"tag":107,"props":10070,"children":10072},{"className":10071},[],[10073],{"type":83,"value":10074},"fetch",{"type":83,"value":10076}," interceptor\nneeded. It rides on the canonical ",{"type":77,"tag":107,"props":10078,"children":10080},{"className":10079},[],[10081],{"type":83,"value":10082},"TokenUsage",{"type":83,"value":10084}," shape (token fields are ",{"type":77,"tag":107,"props":10086,"children":10088},{"className":10087},[],[10089],{"type":83,"value":7122},{"type":83,"value":10091}," for\nmedia), mirroring how duration-billed transcription surfaces ",{"type":77,"tag":107,"props":10093,"children":10095},{"className":10094},[],[10096],{"type":83,"value":10097},"durationSeconds",{"type":83,"value":382},{"type":77,"tag":138,"props":10100,"children":10102},{"className":140,"code":10101,"language":51,"meta":142,"style":142},"import { generateImage } from '@tanstack\u002Fai'\nimport { falImage } from '@tanstack\u002Fai-fal'\n\nconst result = await generateImage({\n  adapter: falImage('fal-ai\u002Fflux\u002Fdev'),\n  prompt: 'a serene mountain lake',\n})\n\n\u002F\u002F usage.unitsBilled is the priced quantity. Multiply by the endpoint unit\n\u002F\u002F price (GET https:\u002F\u002Fapi.fal.ai\u002Fv1\u002Fmodels\u002Fpricing?endpoint_id=…) for exact cost.\nif (result.usage?.unitsBilled != null) {\n  const cost = result.usage.unitsBilled * unitPrice\n}\n",[10103],{"type":77,"tag":107,"props":10104,"children":10105},{"__ignoreMap":142},[10106,10141,10177,10184,10215,10255,10283,10294,10301,10309,10317,10366,10413],{"type":77,"tag":148,"props":10107,"children":10108},{"class":150,"line":151},[10109,10113,10117,10121,10125,10129,10133,10137],{"type":77,"tag":148,"props":10110,"children":10111},{"style":165},[10112],{"type":83,"value":168},{"type":77,"tag":148,"props":10114,"children":10115},{"style":171},[10116],{"type":83,"value":174},{"type":77,"tag":148,"props":10118,"children":10119},{"style":177},[10120],{"type":83,"value":180},{"type":77,"tag":148,"props":10122,"children":10123},{"style":171},[10124],{"type":83,"value":195},{"type":77,"tag":148,"props":10126,"children":10127},{"style":165},[10128],{"type":83,"value":200},{"type":77,"tag":148,"props":10130,"children":10131},{"style":171},[10132],{"type":83,"value":205},{"type":77,"tag":148,"props":10134,"children":10135},{"style":208},[10136],{"type":83,"value":211},{"type":77,"tag":148,"props":10138,"children":10139},{"style":171},[10140],{"type":83,"value":216},{"type":77,"tag":148,"props":10142,"children":10143},{"class":150,"line":161},[10144,10148,10152,10157,10161,10165,10169,10173],{"type":77,"tag":148,"props":10145,"children":10146},{"style":165},[10147],{"type":83,"value":168},{"type":77,"tag":148,"props":10149,"children":10150},{"style":171},[10151],{"type":83,"value":174},{"type":77,"tag":148,"props":10153,"children":10154},{"style":177},[10155],{"type":83,"value":10156}," falImage",{"type":77,"tag":148,"props":10158,"children":10159},{"style":171},[10160],{"type":83,"value":195},{"type":77,"tag":148,"props":10162,"children":10163},{"style":165},[10164],{"type":83,"value":200},{"type":77,"tag":148,"props":10166,"children":10167},{"style":171},[10168],{"type":83,"value":205},{"type":77,"tag":148,"props":10170,"children":10171},{"style":208},[10172],{"type":83,"value":4721},{"type":77,"tag":148,"props":10174,"children":10175},{"style":171},[10176],{"type":83,"value":216},{"type":77,"tag":148,"props":10178,"children":10179},{"class":150,"line":219},[10180],{"type":77,"tag":148,"props":10181,"children":10182},{"emptyLinePlaceholder":261},[10183],{"type":83,"value":264},{"type":77,"tag":148,"props":10185,"children":10186},{"class":150,"line":257},[10187,10191,10195,10199,10203,10207,10211],{"type":77,"tag":148,"props":10188,"children":10189},{"style":276},[10190],{"type":83,"value":2799},{"type":77,"tag":148,"props":10192,"children":10193},{"style":177},[10194],{"type":83,"value":5905},{"type":77,"tag":148,"props":10196,"children":10197},{"style":171},[10198],{"type":83,"value":1038},{"type":77,"tag":148,"props":10200,"children":10201},{"style":165},[10202],{"type":83,"value":372},{"type":77,"tag":148,"props":10204,"children":10205},{"style":287},[10206],{"type":83,"value":180},{"type":77,"tag":148,"props":10208,"children":10209},{"style":177},[10210],{"type":83,"value":295},{"type":77,"tag":148,"props":10212,"children":10213},{"style":171},[10214],{"type":83,"value":431},{"type":77,"tag":148,"props":10216,"children":10217},{"class":150,"line":267},[10218,10222,10226,10230,10234,10238,10243,10247,10251],{"type":77,"tag":148,"props":10219,"children":10220},{"style":390},[10221],{"type":83,"value":2832},{"type":77,"tag":148,"props":10223,"children":10224},{"style":171},[10225],{"type":83,"value":306},{"type":77,"tag":148,"props":10227,"children":10228},{"style":287},[10229],{"type":83,"value":10156},{"type":77,"tag":148,"props":10231,"children":10232},{"style":177},[10233],{"type":83,"value":295},{"type":77,"tag":148,"props":10235,"children":10236},{"style":171},[10237],{"type":83,"value":457},{"type":77,"tag":148,"props":10239,"children":10240},{"style":208},[10241],{"type":83,"value":10242},"fal-ai\u002Fflux\u002Fdev",{"type":77,"tag":148,"props":10244,"children":10245},{"style":171},[10246],{"type":83,"value":457},{"type":77,"tag":148,"props":10248,"children":10249},{"style":177},[10250],{"type":83,"value":317},{"type":77,"tag":148,"props":10252,"children":10253},{"style":171},[10254],{"type":83,"value":475},{"type":77,"tag":148,"props":10256,"children":10257},{"class":150,"line":325},[10258,10262,10266,10270,10275,10279],{"type":77,"tag":148,"props":10259,"children":10260},{"style":390},[10261],{"type":83,"value":2872},{"type":77,"tag":148,"props":10263,"children":10264},{"style":171},[10265],{"type":83,"value":306},{"type":77,"tag":148,"props":10267,"children":10268},{"style":171},[10269],{"type":83,"value":205},{"type":77,"tag":148,"props":10271,"children":10272},{"style":208},[10273],{"type":83,"value":10274},"a serene mountain lake",{"type":77,"tag":148,"props":10276,"children":10277},{"style":171},[10278],{"type":83,"value":457},{"type":77,"tag":148,"props":10280,"children":10281},{"style":171},[10282],{"type":83,"value":475},{"type":77,"tag":148,"props":10284,"children":10285},{"class":150,"line":396},[10286,10290],{"type":77,"tag":148,"props":10287,"children":10288},{"style":171},[10289],{"type":83,"value":1114},{"type":77,"tag":148,"props":10291,"children":10292},{"style":177},[10293],{"type":83,"value":551},{"type":77,"tag":148,"props":10295,"children":10296},{"class":150,"line":404},[10297],{"type":77,"tag":148,"props":10298,"children":10299},{"emptyLinePlaceholder":261},[10300],{"type":83,"value":264},{"type":77,"tag":148,"props":10302,"children":10303},{"class":150,"line":434},[10304],{"type":77,"tag":148,"props":10305,"children":10306},{"style":155},[10307],{"type":83,"value":10308},"\u002F\u002F usage.unitsBilled is the priced quantity. Multiply by the endpoint unit\n",{"type":77,"tag":148,"props":10310,"children":10311},{"class":150,"line":478},[10312],{"type":77,"tag":148,"props":10313,"children":10314},{"style":155},[10315],{"type":83,"value":10316},"\u002F\u002F price (GET https:\u002F\u002Fapi.fal.ai\u002Fv1\u002Fmodels\u002Fpricing?endpoint_id=…) for exact cost.\n",{"type":77,"tag":148,"props":10318,"children":10319},{"class":150,"line":491},[10320,10325,10330,10334,10339,10343,10348,10353,10358,10362],{"type":77,"tag":148,"props":10321,"children":10322},{"style":165},[10323],{"type":83,"value":10324},"if",{"type":77,"tag":148,"props":10326,"children":10327},{"style":177},[10328],{"type":83,"value":10329}," (result",{"type":77,"tag":148,"props":10331,"children":10332},{"style":171},[10333],{"type":83,"value":382},{"type":77,"tag":148,"props":10335,"children":10336},{"style":177},[10337],{"type":83,"value":10338},"usage",{"type":77,"tag":148,"props":10340,"children":10341},{"style":171},[10342],{"type":83,"value":1355},{"type":77,"tag":148,"props":10344,"children":10345},{"style":177},[10346],{"type":83,"value":10347},"unitsBilled ",{"type":77,"tag":148,"props":10349,"children":10350},{"style":171},[10351],{"type":83,"value":10352},"!=",{"type":77,"tag":148,"props":10354,"children":10355},{"style":171},[10356],{"type":83,"value":10357}," null",{"type":77,"tag":148,"props":10359,"children":10360},{"style":177},[10361],{"type":83,"value":8309},{"type":77,"tag":148,"props":10363,"children":10364},{"style":171},[10365],{"type":83,"value":431},{"type":77,"tag":148,"props":10367,"children":10368},{"class":150,"line":504},[10369,10373,10378,10382,10386,10390,10394,10398,10403,10408],{"type":77,"tag":148,"props":10370,"children":10371},{"style":276},[10372],{"type":83,"value":331},{"type":77,"tag":148,"props":10374,"children":10375},{"style":177},[10376],{"type":83,"value":10377}," cost",{"type":77,"tag":148,"props":10379,"children":10380},{"style":171},[10381],{"type":83,"value":367},{"type":77,"tag":148,"props":10383,"children":10384},{"style":177},[10385],{"type":83,"value":797},{"type":77,"tag":148,"props":10387,"children":10388},{"style":171},[10389],{"type":83,"value":382},{"type":77,"tag":148,"props":10391,"children":10392},{"style":177},[10393],{"type":83,"value":10338},{"type":77,"tag":148,"props":10395,"children":10396},{"style":171},[10397],{"type":83,"value":382},{"type":77,"tag":148,"props":10399,"children":10400},{"style":177},[10401],{"type":83,"value":10402},"unitsBilled",{"type":77,"tag":148,"props":10404,"children":10405},{"style":171},[10406],{"type":83,"value":10407}," *",{"type":77,"tag":148,"props":10409,"children":10410},{"style":177},[10411],{"type":83,"value":10412}," unitPrice\n",{"type":77,"tag":148,"props":10414,"children":10415},{"class":150,"line":517},[10416],{"type":77,"tag":148,"props":10417,"children":10418},{"style":171},[10419],{"type":83,"value":594},{"type":77,"tag":90,"props":10421,"children":10422},{},[10423,10425,10431,10433,10438,10440,10446],{"type":83,"value":10424},"For video, the units arrive with the completed result: ",{"type":77,"tag":107,"props":10426,"children":10428},{"className":10427},[],[10429],{"type":83,"value":10430},"getVideoJobStatus()",{"type":83,"value":10432},"\nreturns ",{"type":77,"tag":107,"props":10434,"children":10436},{"className":10435},[],[10437],{"type":83,"value":10338},{"type":83,"value":10439}," and emits a ",{"type":77,"tag":107,"props":10441,"children":10443},{"className":10442},[],[10444],{"type":83,"value":10445},"video:usage",{"type":83,"value":10447}," devtools event when fal reports it.",{"type":77,"tag":2627,"props":10449,"children":10450},{},[],{"type":77,"tag":124,"props":10452,"children":10454},{"id":10453},"common-hook-api",[10455],{"type":83,"value":10456},"Common Hook API",{"type":77,"tag":90,"props":10458,"children":10459},{},[10460],{"type":83,"value":10461},"All generation hooks return the same shape:",{"type":77,"tag":5249,"props":10463,"children":10464},{},[10465,10486],{"type":77,"tag":5253,"props":10466,"children":10467},{},[10468],{"type":77,"tag":5257,"props":10469,"children":10470},{},[10471,10476,10481],{"type":77,"tag":5261,"props":10472,"children":10473},{},[10474],{"type":83,"value":10475},"Property",{"type":77,"tag":5261,"props":10477,"children":10478},{},[10479],{"type":83,"value":10480},"Type",{"type":77,"tag":5261,"props":10482,"children":10483},{},[10484],{"type":83,"value":10485},"Description",{"type":77,"tag":5272,"props":10487,"children":10488},{},[10489,10515,10547,10572,10597,10626,10652],{"type":77,"tag":5257,"props":10490,"children":10491},{},[10492,10501,10510],{"type":77,"tag":5279,"props":10493,"children":10494},{},[10495],{"type":77,"tag":107,"props":10496,"children":10498},{"className":10497},[],[10499],{"type":83,"value":10500},"generate",{"type":77,"tag":5279,"props":10502,"children":10503},{},[10504],{"type":77,"tag":107,"props":10505,"children":10507},{"className":10506},[],[10508],{"type":83,"value":10509},"(input) => Promise\u003Cvoid>",{"type":77,"tag":5279,"props":10511,"children":10512},{},[10513],{"type":83,"value":10514},"Trigger generation",{"type":77,"tag":5257,"props":10516,"children":10517},{},[10518,10526,10535],{"type":77,"tag":5279,"props":10519,"children":10520},{},[10521],{"type":77,"tag":107,"props":10522,"children":10524},{"className":10523},[],[10525],{"type":83,"value":1350},{"type":77,"tag":5279,"props":10527,"children":10528},{},[10529],{"type":77,"tag":107,"props":10530,"children":10532},{"className":10531},[],[10533],{"type":83,"value":10534},"T | null",{"type":77,"tag":5279,"props":10536,"children":10537},{},[10538,10540,10546],{"type":83,"value":10539},"Result (optionally transformed via ",{"type":77,"tag":107,"props":10541,"children":10543},{"className":10542},[],[10544],{"type":83,"value":10545},"onResult",{"type":83,"value":317},{"type":77,"tag":5257,"props":10548,"children":10549},{},[10550,10558,10567],{"type":77,"tag":5279,"props":10551,"children":10552},{},[10553],{"type":77,"tag":107,"props":10554,"children":10556},{"className":10555},[],[10557],{"type":83,"value":2537},{"type":77,"tag":5279,"props":10559,"children":10560},{},[10561],{"type":77,"tag":107,"props":10562,"children":10564},{"className":10563},[],[10565],{"type":83,"value":10566},"boolean",{"type":77,"tag":5279,"props":10568,"children":10569},{},[10570],{"type":83,"value":10571},"Whether generation is in progress",{"type":77,"tag":5257,"props":10573,"children":10574},{},[10575,10583,10592],{"type":77,"tag":5279,"props":10576,"children":10577},{},[10578],{"type":77,"tag":107,"props":10579,"children":10581},{"className":10580},[],[10582],{"type":83,"value":1306},{"type":77,"tag":5279,"props":10584,"children":10585},{},[10586],{"type":77,"tag":107,"props":10587,"children":10589},{"className":10588},[],[10590],{"type":83,"value":10591},"Error | undefined",{"type":77,"tag":5279,"props":10593,"children":10594},{},[10595],{"type":83,"value":10596},"Current error",{"type":77,"tag":5257,"props":10598,"children":10599},{},[10600,10608,10617],{"type":77,"tag":5279,"props":10601,"children":10602},{},[10603],{"type":77,"tag":107,"props":10604,"children":10606},{"className":10605},[],[10607],{"type":83,"value":9880},{"type":77,"tag":5279,"props":10609,"children":10610},{},[10611],{"type":77,"tag":107,"props":10612,"children":10614},{"className":10613},[],[10615],{"type":83,"value":10616},"GenerationClientState",{"type":77,"tag":5279,"props":10618,"children":10619},{},[10620],{"type":77,"tag":107,"props":10621,"children":10623},{"className":10622},[],[10624],{"type":83,"value":10625},"'idle' | 'generating' | 'success' | 'error'",{"type":77,"tag":5257,"props":10627,"children":10628},{},[10629,10638,10647],{"type":77,"tag":5279,"props":10630,"children":10631},{},[10632],{"type":77,"tag":107,"props":10633,"children":10635},{"className":10634},[],[10636],{"type":83,"value":10637},"stop",{"type":77,"tag":5279,"props":10639,"children":10640},{},[10641],{"type":77,"tag":107,"props":10642,"children":10644},{"className":10643},[],[10645],{"type":83,"value":10646},"() => void",{"type":77,"tag":5279,"props":10648,"children":10649},{},[10650],{"type":83,"value":10651},"Abort current generation",{"type":77,"tag":5257,"props":10653,"children":10654},{},[10655,10663,10671],{"type":77,"tag":5279,"props":10656,"children":10657},{},[10658],{"type":77,"tag":107,"props":10659,"children":10661},{"className":10660},[],[10662],{"type":83,"value":1621},{"type":77,"tag":5279,"props":10664,"children":10665},{},[10666],{"type":77,"tag":107,"props":10667,"children":10669},{"className":10668},[],[10670],{"type":83,"value":10646},{"type":77,"tag":5279,"props":10672,"children":10673},{},[10674],{"type":83,"value":10675},"Clear state, return to idle",{"type":77,"tag":90,"props":10677,"children":10678},{},[10679,10681,10687,10689,10695,10697,10702,10704,10709],{"type":83,"value":10680},"Provide either ",{"type":77,"tag":107,"props":10682,"children":10684},{"className":10683},[],[10685],{"type":83,"value":10686},"connection",{"type":83,"value":10688}," (streaming SSE transport) or ",{"type":77,"tag":107,"props":10690,"children":10692},{"className":10691},[],[10693],{"type":83,"value":10694},"fetcher",{"type":83,"value":10696},"\n(direct async call \u002F server function returning ",{"type":77,"tag":107,"props":10698,"children":10700},{"className":10699},[],[10701],{"type":83,"value":1702},{"type":83,"value":10703},"). Use ",{"type":77,"tag":107,"props":10705,"children":10707},{"className":10706},[],[10708],{"type":83,"value":10545},{"type":83,"value":10710},"\nto transform what is stored:",{"type":77,"tag":138,"props":10712,"children":10714},{"className":603,"code":10713,"language":605,"meta":142,"style":142},"const { result } = useGenerateSpeech({\n  connection: fetchServerSentEvents('\u002Fapi\u002Fgenerate\u002Fspeech'),\n  onResult: (raw) => ({\n    audioUrl: `data:${raw.contentType};base64,${raw.audio}`,\n    duration: raw.duration,\n  }),\n})\n\u002F\u002F result is typed as { audioUrl: string; duration?: number } | null\n",[10715],{"type":77,"tag":107,"props":10716,"children":10717},{"__ignoreMap":142},[10718,10753,10792,10829,10898,10927,10942,10953],{"type":77,"tag":148,"props":10719,"children":10720},{"class":150,"line":151},[10721,10725,10729,10733,10737,10741,10745,10749],{"type":77,"tag":148,"props":10722,"children":10723},{"style":276},[10724],{"type":83,"value":2799},{"type":77,"tag":148,"props":10726,"children":10727},{"style":171},[10728],{"type":83,"value":174},{"type":77,"tag":148,"props":10730,"children":10731},{"style":177},[10732],{"type":83,"value":5905},{"type":77,"tag":148,"props":10734,"children":10735},{"style":171},[10736],{"type":83,"value":1114},{"type":77,"tag":148,"props":10738,"children":10739},{"style":171},[10740],{"type":83,"value":367},{"type":77,"tag":148,"props":10742,"children":10743},{"style":287},[10744],{"type":83,"value":6606},{"type":77,"tag":148,"props":10746,"children":10747},{"style":177},[10748],{"type":83,"value":295},{"type":77,"tag":148,"props":10750,"children":10751},{"style":171},[10752],{"type":83,"value":431},{"type":77,"tag":148,"props":10754,"children":10755},{"class":150,"line":161},[10756,10760,10764,10768,10772,10776,10780,10784,10788],{"type":77,"tag":148,"props":10757,"children":10758},{"style":390},[10759],{"type":83,"value":6171},{"type":77,"tag":148,"props":10761,"children":10762},{"style":171},[10763],{"type":83,"value":306},{"type":77,"tag":148,"props":10765,"children":10766},{"style":287},[10767],{"type":83,"value":634},{"type":77,"tag":148,"props":10769,"children":10770},{"style":177},[10771],{"type":83,"value":295},{"type":77,"tag":148,"props":10773,"children":10774},{"style":171},[10775],{"type":83,"value":457},{"type":77,"tag":148,"props":10777,"children":10778},{"style":208},[10779],{"type":83,"value":6720},{"type":77,"tag":148,"props":10781,"children":10782},{"style":171},[10783],{"type":83,"value":457},{"type":77,"tag":148,"props":10785,"children":10786},{"style":177},[10787],{"type":83,"value":317},{"type":77,"tag":148,"props":10789,"children":10790},{"style":171},[10791],{"type":83,"value":475},{"type":77,"tag":148,"props":10793,"children":10794},{"class":150,"line":219},[10795,10800,10804,10808,10813,10817,10821,10825],{"type":77,"tag":148,"props":10796,"children":10797},{"style":287},[10798],{"type":83,"value":10799},"  onResult",{"type":77,"tag":148,"props":10801,"children":10802},{"style":171},[10803],{"type":83,"value":306},{"type":77,"tag":148,"props":10805,"children":10806},{"style":171},[10807],{"type":83,"value":2369},{"type":77,"tag":148,"props":10809,"children":10810},{"style":298},[10811],{"type":83,"value":10812},"raw",{"type":77,"tag":148,"props":10814,"children":10815},{"style":171},[10816],{"type":83,"value":317},{"type":77,"tag":148,"props":10818,"children":10819},{"style":276},[10820],{"type":83,"value":994},{"type":77,"tag":148,"props":10822,"children":10823},{"style":177},[10824],{"type":83,"value":2369},{"type":77,"tag":148,"props":10826,"children":10827},{"style":171},[10828],{"type":83,"value":431},{"type":77,"tag":148,"props":10830,"children":10831},{"class":150,"line":257},[10832,10837,10841,10845,10849,10853,10857,10861,10866,10870,10874,10878,10882,10886,10890,10894],{"type":77,"tag":148,"props":10833,"children":10834},{"style":390},[10835],{"type":83,"value":10836},"    audioUrl",{"type":77,"tag":148,"props":10838,"children":10839},{"style":171},[10840],{"type":83,"value":306},{"type":77,"tag":148,"props":10842,"children":10843},{"style":171},[10844],{"type":83,"value":1473},{"type":77,"tag":148,"props":10846,"children":10847},{"style":208},[10848],{"type":83,"value":5184},{"type":77,"tag":148,"props":10850,"children":10851},{"style":171},[10852],{"type":83,"value":1483},{"type":77,"tag":148,"props":10854,"children":10855},{"style":177},[10856],{"type":83,"value":10812},{"type":77,"tag":148,"props":10858,"children":10859},{"style":171},[10860],{"type":83,"value":382},{"type":77,"tag":148,"props":10862,"children":10863},{"style":177},[10864],{"type":83,"value":10865},"contentType",{"type":77,"tag":148,"props":10867,"children":10868},{"style":171},[10869],{"type":83,"value":1114},{"type":77,"tag":148,"props":10871,"children":10872},{"style":208},[10873],{"type":83,"value":7185},{"type":77,"tag":148,"props":10875,"children":10876},{"style":171},[10877],{"type":83,"value":1483},{"type":77,"tag":148,"props":10879,"children":10880},{"style":177},[10881],{"type":83,"value":10812},{"type":77,"tag":148,"props":10883,"children":10884},{"style":171},[10885],{"type":83,"value":382},{"type":77,"tag":148,"props":10887,"children":10888},{"style":177},[10889],{"type":83,"value":22},{"type":77,"tag":148,"props":10891,"children":10892},{"style":171},[10893],{"type":83,"value":1501},{"type":77,"tag":148,"props":10895,"children":10896},{"style":171},[10897],{"type":83,"value":475},{"type":77,"tag":148,"props":10899,"children":10900},{"class":150,"line":267},[10901,10906,10910,10915,10919,10923],{"type":77,"tag":148,"props":10902,"children":10903},{"style":390},[10904],{"type":83,"value":10905},"    duration",{"type":77,"tag":148,"props":10907,"children":10908},{"style":171},[10909],{"type":83,"value":306},{"type":77,"tag":148,"props":10911,"children":10912},{"style":177},[10913],{"type":83,"value":10914}," raw",{"type":77,"tag":148,"props":10916,"children":10917},{"style":171},[10918],{"type":83,"value":382},{"type":77,"tag":148,"props":10920,"children":10921},{"style":177},[10922],{"type":83,"value":8681},{"type":77,"tag":148,"props":10924,"children":10925},{"style":171},[10926],{"type":83,"value":475},{"type":77,"tag":148,"props":10928,"children":10929},{"class":150,"line":325},[10930,10934,10938],{"type":77,"tag":148,"props":10931,"children":10932},{"style":171},[10933],{"type":83,"value":546},{"type":77,"tag":148,"props":10935,"children":10936},{"style":177},[10937],{"type":83,"value":317},{"type":77,"tag":148,"props":10939,"children":10940},{"style":171},[10941],{"type":83,"value":475},{"type":77,"tag":148,"props":10943,"children":10944},{"class":150,"line":396},[10945,10949],{"type":77,"tag":148,"props":10946,"children":10947},{"style":171},[10948],{"type":83,"value":1114},{"type":77,"tag":148,"props":10950,"children":10951},{"style":177},[10952],{"type":83,"value":551},{"type":77,"tag":148,"props":10954,"children":10955},{"class":150,"line":404},[10956],{"type":77,"tag":148,"props":10957,"children":10958},{"style":155},[10959],{"type":83,"value":10960},"\u002F\u002F result is typed as { audioUrl: string; duration?: number } | null\n",{"type":77,"tag":2627,"props":10962,"children":10963},{},[],{"type":77,"tag":124,"props":10965,"children":10967},{"id":10966},"common-mistakes",[10968],{"type":83,"value":10969},"Common Mistakes",{"type":77,"tag":131,"props":10971,"children":10973},{"id":10972},"a-high-using-the-removed-embedding-function",[10974,10976,10982],{"type":83,"value":10975},"a. HIGH: Using the removed ",{"type":77,"tag":107,"props":10977,"children":10979},{"className":10978},[],[10980],{"type":83,"value":10981},"embedding()",{"type":83,"value":284},{"type":77,"tag":90,"props":10984,"children":10985},{},[10986,10988,10993,10995,11001],{"type":83,"value":10987},"The ",{"type":77,"tag":107,"props":10989,"children":10991},{"className":10990},[],[10992],{"type":83,"value":10981},{"type":83,"value":10994}," function and ",{"type":77,"tag":107,"props":10996,"children":10998},{"className":10997},[],[10999],{"type":83,"value":11000},"openaiEmbed",{"type":83,"value":11002}," adapter were removed in v0.5.0.\nAgents trained on older code may still generate this pattern.",{"type":77,"tag":90,"props":11004,"children":11005},{},[11006],{"type":77,"tag":94,"props":11007,"children":11008},{},[11009],{"type":83,"value":11010},"Wrong:",{"type":77,"tag":138,"props":11012,"children":11014},{"className":140,"code":11013,"language":51,"meta":142,"style":142},"import { embedding } from '@tanstack\u002Fai'\nimport { openaiEmbed } from '@tanstack\u002Fai-openai'\n\nconst result = await embedding({\n  adapter: openaiEmbed(),\n  model: 'text-embedding-3-small',\n  input: 'Hello, world!',\n})\n",[11015],{"type":77,"tag":107,"props":11016,"children":11017},{"__ignoreMap":142},[11018,11054,11090,11097,11128,11151,11180,11209],{"type":77,"tag":148,"props":11019,"children":11020},{"class":150,"line":151},[11021,11025,11029,11034,11038,11042,11046,11050],{"type":77,"tag":148,"props":11022,"children":11023},{"style":165},[11024],{"type":83,"value":168},{"type":77,"tag":148,"props":11026,"children":11027},{"style":171},[11028],{"type":83,"value":174},{"type":77,"tag":148,"props":11030,"children":11031},{"style":177},[11032],{"type":83,"value":11033}," embedding",{"type":77,"tag":148,"props":11035,"children":11036},{"style":171},[11037],{"type":83,"value":195},{"type":77,"tag":148,"props":11039,"children":11040},{"style":165},[11041],{"type":83,"value":200},{"type":77,"tag":148,"props":11043,"children":11044},{"style":171},[11045],{"type":83,"value":205},{"type":77,"tag":148,"props":11047,"children":11048},{"style":208},[11049],{"type":83,"value":211},{"type":77,"tag":148,"props":11051,"children":11052},{"style":171},[11053],{"type":83,"value":216},{"type":77,"tag":148,"props":11055,"children":11056},{"class":150,"line":161},[11057,11061,11065,11070,11074,11078,11082,11086],{"type":77,"tag":148,"props":11058,"children":11059},{"style":165},[11060],{"type":83,"value":168},{"type":77,"tag":148,"props":11062,"children":11063},{"style":171},[11064],{"type":83,"value":174},{"type":77,"tag":148,"props":11066,"children":11067},{"style":177},[11068],{"type":83,"value":11069}," openaiEmbed",{"type":77,"tag":148,"props":11071,"children":11072},{"style":171},[11073],{"type":83,"value":195},{"type":77,"tag":148,"props":11075,"children":11076},{"style":165},[11077],{"type":83,"value":200},{"type":77,"tag":148,"props":11079,"children":11080},{"style":171},[11081],{"type":83,"value":205},{"type":77,"tag":148,"props":11083,"children":11084},{"style":208},[11085],{"type":83,"value":250},{"type":77,"tag":148,"props":11087,"children":11088},{"style":171},[11089],{"type":83,"value":216},{"type":77,"tag":148,"props":11091,"children":11092},{"class":150,"line":219},[11093],{"type":77,"tag":148,"props":11094,"children":11095},{"emptyLinePlaceholder":261},[11096],{"type":83,"value":264},{"type":77,"tag":148,"props":11098,"children":11099},{"class":150,"line":257},[11100,11104,11108,11112,11116,11120,11124],{"type":77,"tag":148,"props":11101,"children":11102},{"style":276},[11103],{"type":83,"value":2799},{"type":77,"tag":148,"props":11105,"children":11106},{"style":177},[11107],{"type":83,"value":5905},{"type":77,"tag":148,"props":11109,"children":11110},{"style":171},[11111],{"type":83,"value":1038},{"type":77,"tag":148,"props":11113,"children":11114},{"style":165},[11115],{"type":83,"value":372},{"type":77,"tag":148,"props":11117,"children":11118},{"style":287},[11119],{"type":83,"value":11033},{"type":77,"tag":148,"props":11121,"children":11122},{"style":177},[11123],{"type":83,"value":295},{"type":77,"tag":148,"props":11125,"children":11126},{"style":171},[11127],{"type":83,"value":431},{"type":77,"tag":148,"props":11129,"children":11130},{"class":150,"line":267},[11131,11135,11139,11143,11147],{"type":77,"tag":148,"props":11132,"children":11133},{"style":390},[11134],{"type":83,"value":2832},{"type":77,"tag":148,"props":11136,"children":11137},{"style":171},[11138],{"type":83,"value":306},{"type":77,"tag":148,"props":11140,"children":11141},{"style":287},[11142],{"type":83,"value":11069},{"type":77,"tag":148,"props":11144,"children":11145},{"style":177},[11146],{"type":83,"value":716},{"type":77,"tag":148,"props":11148,"children":11149},{"style":171},[11150],{"type":83,"value":475},{"type":77,"tag":148,"props":11152,"children":11153},{"class":150,"line":325},[11154,11159,11163,11167,11172,11176],{"type":77,"tag":148,"props":11155,"children":11156},{"style":390},[11157],{"type":83,"value":11158},"  model",{"type":77,"tag":148,"props":11160,"children":11161},{"style":171},[11162],{"type":83,"value":306},{"type":77,"tag":148,"props":11164,"children":11165},{"style":171},[11166],{"type":83,"value":205},{"type":77,"tag":148,"props":11168,"children":11169},{"style":208},[11170],{"type":83,"value":11171},"text-embedding-3-small",{"type":77,"tag":148,"props":11173,"children":11174},{"style":171},[11175],{"type":83,"value":457},{"type":77,"tag":148,"props":11177,"children":11178},{"style":171},[11179],{"type":83,"value":475},{"type":77,"tag":148,"props":11181,"children":11182},{"class":150,"line":396},[11183,11188,11192,11196,11201,11205],{"type":77,"tag":148,"props":11184,"children":11185},{"style":390},[11186],{"type":83,"value":11187},"  input",{"type":77,"tag":148,"props":11189,"children":11190},{"style":171},[11191],{"type":83,"value":306},{"type":77,"tag":148,"props":11193,"children":11194},{"style":171},[11195],{"type":83,"value":205},{"type":77,"tag":148,"props":11197,"children":11198},{"style":208},[11199],{"type":83,"value":11200},"Hello, world!",{"type":77,"tag":148,"props":11202,"children":11203},{"style":171},[11204],{"type":83,"value":457},{"type":77,"tag":148,"props":11206,"children":11207},{"style":171},[11208],{"type":83,"value":475},{"type":77,"tag":148,"props":11210,"children":11211},{"class":150,"line":404},[11212,11216],{"type":77,"tag":148,"props":11213,"children":11214},{"style":171},[11215],{"type":83,"value":1114},{"type":77,"tag":148,"props":11217,"children":11218},{"style":177},[11219],{"type":83,"value":551},{"type":77,"tag":90,"props":11221,"children":11222},{},[11223],{"type":77,"tag":94,"props":11224,"children":11225},{},[11226],{"type":83,"value":11227},"Correct -- use the provider SDK directly:",{"type":77,"tag":138,"props":11229,"children":11231},{"className":140,"code":11230,"language":51,"meta":142,"style":142},"import OpenAI from 'openai'\n\nconst openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY })\n\nconst result = await openai.embeddings.create({\n  model: 'text-embedding-3-small',\n  input: 'Hello, world!',\n})\n",[11232],{"type":77,"tag":107,"props":11233,"children":11234},{"__ignoreMap":142},[11235,11264,11271,11344,11351,11401,11428,11455],{"type":77,"tag":148,"props":11236,"children":11237},{"class":150,"line":151},[11238,11242,11247,11252,11256,11260],{"type":77,"tag":148,"props":11239,"children":11240},{"style":165},[11241],{"type":83,"value":168},{"type":77,"tag":148,"props":11243,"children":11244},{"style":177},[11245],{"type":83,"value":11246}," OpenAI ",{"type":77,"tag":148,"props":11248,"children":11249},{"style":165},[11250],{"type":83,"value":11251},"from",{"type":77,"tag":148,"props":11253,"children":11254},{"style":171},[11255],{"type":83,"value":205},{"type":77,"tag":148,"props":11257,"children":11258},{"style":208},[11259],{"type":83,"value":45},{"type":77,"tag":148,"props":11261,"children":11262},{"style":171},[11263],{"type":83,"value":216},{"type":77,"tag":148,"props":11265,"children":11266},{"class":150,"line":161},[11267],{"type":77,"tag":148,"props":11268,"children":11269},{"emptyLinePlaceholder":261},[11270],{"type":83,"value":264},{"type":77,"tag":148,"props":11272,"children":11273},{"class":150,"line":219},[11274,11278,11283,11287,11291,11296,11300,11304,11309,11313,11318,11322,11327,11331,11336,11340],{"type":77,"tag":148,"props":11275,"children":11276},{"style":276},[11277],{"type":83,"value":2799},{"type":77,"tag":148,"props":11279,"children":11280},{"style":177},[11281],{"type":83,"value":11282}," openai ",{"type":77,"tag":148,"props":11284,"children":11285},{"style":171},[11286],{"type":83,"value":1038},{"type":77,"tag":148,"props":11288,"children":11289},{"style":171},[11290],{"type":83,"value":8326},{"type":77,"tag":148,"props":11292,"children":11293},{"style":287},[11294],{"type":83,"value":11295}," OpenAI",{"type":77,"tag":148,"props":11297,"children":11298},{"style":177},[11299],{"type":83,"value":295},{"type":77,"tag":148,"props":11301,"children":11302},{"style":171},[11303],{"type":83,"value":1104},{"type":77,"tag":148,"props":11305,"children":11306},{"style":390},[11307],{"type":83,"value":11308}," apiKey",{"type":77,"tag":148,"props":11310,"children":11311},{"style":171},[11312],{"type":83,"value":306},{"type":77,"tag":148,"props":11314,"children":11315},{"style":177},[11316],{"type":83,"value":11317}," process",{"type":77,"tag":148,"props":11319,"children":11320},{"style":171},[11321],{"type":83,"value":382},{"type":77,"tag":148,"props":11323,"children":11324},{"style":177},[11325],{"type":83,"value":11326},"env",{"type":77,"tag":148,"props":11328,"children":11329},{"style":171},[11330],{"type":83,"value":382},{"type":77,"tag":148,"props":11332,"children":11333},{"style":177},[11334],{"type":83,"value":11335},"OPENAI_API_KEY ",{"type":77,"tag":148,"props":11337,"children":11338},{"style":171},[11339],{"type":83,"value":1114},{"type":77,"tag":148,"props":11341,"children":11342},{"style":177},[11343],{"type":83,"value":551},{"type":77,"tag":148,"props":11345,"children":11346},{"class":150,"line":257},[11347],{"type":77,"tag":148,"props":11348,"children":11349},{"emptyLinePlaceholder":261},[11350],{"type":83,"value":264},{"type":77,"tag":148,"props":11352,"children":11353},{"class":150,"line":267},[11354,11358,11362,11366,11370,11375,11379,11384,11388,11393,11397],{"type":77,"tag":148,"props":11355,"children":11356},{"style":276},[11357],{"type":83,"value":2799},{"type":77,"tag":148,"props":11359,"children":11360},{"style":177},[11361],{"type":83,"value":5905},{"type":77,"tag":148,"props":11363,"children":11364},{"style":171},[11365],{"type":83,"value":1038},{"type":77,"tag":148,"props":11367,"children":11368},{"style":165},[11369],{"type":83,"value":372},{"type":77,"tag":148,"props":11371,"children":11372},{"style":177},[11373],{"type":83,"value":11374}," openai",{"type":77,"tag":148,"props":11376,"children":11377},{"style":171},[11378],{"type":83,"value":382},{"type":77,"tag":148,"props":11380,"children":11381},{"style":177},[11382],{"type":83,"value":11383},"embeddings",{"type":77,"tag":148,"props":11385,"children":11386},{"style":171},[11387],{"type":83,"value":382},{"type":77,"tag":148,"props":11389,"children":11390},{"style":287},[11391],{"type":83,"value":11392},"create",{"type":77,"tag":148,"props":11394,"children":11395},{"style":177},[11396],{"type":83,"value":295},{"type":77,"tag":148,"props":11398,"children":11399},{"style":171},[11400],{"type":83,"value":431},{"type":77,"tag":148,"props":11402,"children":11403},{"class":150,"line":325},[11404,11408,11412,11416,11420,11424],{"type":77,"tag":148,"props":11405,"children":11406},{"style":390},[11407],{"type":83,"value":11158},{"type":77,"tag":148,"props":11409,"children":11410},{"style":171},[11411],{"type":83,"value":306},{"type":77,"tag":148,"props":11413,"children":11414},{"style":171},[11415],{"type":83,"value":205},{"type":77,"tag":148,"props":11417,"children":11418},{"style":208},[11419],{"type":83,"value":11171},{"type":77,"tag":148,"props":11421,"children":11422},{"style":171},[11423],{"type":83,"value":457},{"type":77,"tag":148,"props":11425,"children":11426},{"style":171},[11427],{"type":83,"value":475},{"type":77,"tag":148,"props":11429,"children":11430},{"class":150,"line":396},[11431,11435,11439,11443,11447,11451],{"type":77,"tag":148,"props":11432,"children":11433},{"style":390},[11434],{"type":83,"value":11187},{"type":77,"tag":148,"props":11436,"children":11437},{"style":171},[11438],{"type":83,"value":306},{"type":77,"tag":148,"props":11440,"children":11441},{"style":171},[11442],{"type":83,"value":205},{"type":77,"tag":148,"props":11444,"children":11445},{"style":208},[11446],{"type":83,"value":11200},{"type":77,"tag":148,"props":11448,"children":11449},{"style":171},[11450],{"type":83,"value":457},{"type":77,"tag":148,"props":11452,"children":11453},{"style":171},[11454],{"type":83,"value":475},{"type":77,"tag":148,"props":11456,"children":11457},{"class":150,"line":404},[11458,11462],{"type":77,"tag":148,"props":11459,"children":11460},{"style":171},[11461],{"type":83,"value":1114},{"type":77,"tag":148,"props":11463,"children":11464},{"style":177},[11465],{"type":83,"value":551},{"type":77,"tag":86,"props":11467,"children":11468},{},[11469],{"type":77,"tag":90,"props":11470,"children":11471},{},[11472],{"type":83,"value":11473},"Source: docs\u002Fmigration\u002Fmigration.md. Note: Fixed in v0.5.0 but agents\ntrained on older code may still generate this pattern.",{"type":77,"tag":131,"props":11475,"children":11477},{"id":11476},"b-high-forgetting-toserversenteventsresponse-with-tanstack-start-server-functions",[11478,11480,11486],{"type":83,"value":11479},"b. HIGH: Forgetting ",{"type":77,"tag":107,"props":11481,"children":11483},{"className":11482},[],[11484],{"type":83,"value":11485},"toServerSentEventsResponse",{"type":83,"value":11487}," with TanStack Start server functions",{"type":77,"tag":90,"props":11489,"children":11490},{},[11491,11493,11499,11501,11506],{"type":83,"value":11492},"When using TanStack Start server functions with ",{"type":77,"tag":107,"props":11494,"children":11496},{"className":11495},[],[11497],{"type":83,"value":11498},"stream: true",{"type":83,"value":11500},", you MUST\nwrap the stream with ",{"type":77,"tag":107,"props":11502,"children":11504},{"className":11503},[],[11505],{"type":83,"value":120},{"type":83,"value":11507},". Returning the raw\nstream from a server function will not work.",{"type":77,"tag":90,"props":11509,"children":11510},{},[11511],{"type":77,"tag":94,"props":11512,"children":11513},{},[11514],{"type":83,"value":11010},{"type":77,"tag":138,"props":11516,"children":11518},{"className":140,"code":11517,"language":51,"meta":142,"style":142},"export const generateImageStreamFn = createServerFn({ method: 'POST' }).handler(\n  ({ data }) => {\n    \u002F\u002F BUG: returning raw stream -- client cannot parse this\n    return generateImage({\n      adapter: openaiImage('gpt-image-1'),\n      prompt: data.prompt,\n      stream: true,\n    })\n  },\n)\n",[11519],{"type":77,"tag":107,"props":11520,"children":11521},{"__ignoreMap":142},[11522,11593,11617,11625,11644,11684,11712,11732,11744,11751],{"type":77,"tag":148,"props":11523,"children":11524},{"class":150,"line":151},[11525,11529,11533,11537,11541,11545,11549,11553,11557,11561,11565,11569,11573,11577,11581,11585,11589],{"type":77,"tag":148,"props":11526,"children":11527},{"style":165},[11528],{"type":83,"value":273},{"type":77,"tag":148,"props":11530,"children":11531},{"style":276},[11532],{"type":83,"value":1853},{"type":77,"tag":148,"props":11534,"children":11535},{"style":177},[11536],{"type":83,"value":1858},{"type":77,"tag":148,"props":11538,"children":11539},{"style":171},[11540],{"type":83,"value":1038},{"type":77,"tag":148,"props":11542,"children":11543},{"style":287},[11544],{"type":83,"value":1735},{"type":77,"tag":148,"props":11546,"children":11547},{"style":177},[11548],{"type":83,"value":295},{"type":77,"tag":148,"props":11550,"children":11551},{"style":171},[11552],{"type":83,"value":1104},{"type":77,"tag":148,"props":11554,"children":11555},{"style":390},[11556],{"type":83,"value":1879},{"type":77,"tag":148,"props":11558,"children":11559},{"style":171},[11560],{"type":83,"value":306},{"type":77,"tag":148,"props":11562,"children":11563},{"style":171},[11564],{"type":83,"value":205},{"type":77,"tag":148,"props":11566,"children":11567},{"style":208},[11568],{"type":83,"value":1892},{"type":77,"tag":148,"props":11570,"children":11571},{"style":171},[11572],{"type":83,"value":457},{"type":77,"tag":148,"props":11574,"children":11575},{"style":171},[11576],{"type":83,"value":195},{"type":77,"tag":148,"props":11578,"children":11579},{"style":177},[11580],{"type":83,"value":317},{"type":77,"tag":148,"props":11582,"children":11583},{"style":171},[11584],{"type":83,"value":382},{"type":77,"tag":148,"props":11586,"children":11587},{"style":287},[11588],{"type":83,"value":1996},{"type":77,"tag":148,"props":11590,"children":11591},{"style":177},[11592],{"type":83,"value":2039},{"type":77,"tag":148,"props":11594,"children":11595},{"class":150,"line":161},[11596,11601,11605,11609,11613],{"type":77,"tag":148,"props":11597,"children":11598},{"style":171},[11599],{"type":83,"value":11600},"  ({",{"type":77,"tag":148,"props":11602,"children":11603},{"style":298},[11604],{"type":83,"value":2010},{"type":77,"tag":148,"props":11606,"children":11607},{"style":171},[11608],{"type":83,"value":1975},{"type":77,"tag":148,"props":11610,"children":11611},{"style":276},[11612],{"type":83,"value":994},{"type":77,"tag":148,"props":11614,"children":11615},{"style":171},[11616],{"type":83,"value":322},{"type":77,"tag":148,"props":11618,"children":11619},{"class":150,"line":219},[11620],{"type":77,"tag":148,"props":11621,"children":11622},{"style":155},[11623],{"type":83,"value":11624},"    \u002F\u002F BUG: returning raw stream -- client cannot parse this\n",{"type":77,"tag":148,"props":11626,"children":11627},{"class":150,"line":257},[11628,11632,11636,11640],{"type":77,"tag":148,"props":11629,"children":11630},{"style":165},[11631],{"type":83,"value":2030},{"type":77,"tag":148,"props":11633,"children":11634},{"style":287},[11635],{"type":83,"value":180},{"type":77,"tag":148,"props":11637,"children":11638},{"style":390},[11639],{"type":83,"value":295},{"type":77,"tag":148,"props":11641,"children":11642},{"style":171},[11643],{"type":83,"value":431},{"type":77,"tag":148,"props":11645,"children":11646},{"class":150,"line":267},[11647,11652,11656,11660,11664,11668,11672,11676,11680],{"type":77,"tag":148,"props":11648,"children":11649},{"style":390},[11650],{"type":83,"value":11651},"      adapter",{"type":77,"tag":148,"props":11653,"children":11654},{"style":171},[11655],{"type":83,"value":306},{"type":77,"tag":148,"props":11657,"children":11658},{"style":287},[11659],{"type":83,"value":233},{"type":77,"tag":148,"props":11661,"children":11662},{"style":390},[11663],{"type":83,"value":295},{"type":77,"tag":148,"props":11665,"children":11666},{"style":171},[11667],{"type":83,"value":457},{"type":77,"tag":148,"props":11669,"children":11670},{"style":208},[11671],{"type":83,"value":462},{"type":77,"tag":148,"props":11673,"children":11674},{"style":171},[11675],{"type":83,"value":457},{"type":77,"tag":148,"props":11677,"children":11678},{"style":390},[11679],{"type":83,"value":317},{"type":77,"tag":148,"props":11681,"children":11682},{"style":171},[11683],{"type":83,"value":475},{"type":77,"tag":148,"props":11685,"children":11686},{"class":150,"line":325},[11687,11692,11696,11700,11704,11708],{"type":77,"tag":148,"props":11688,"children":11689},{"style":390},[11690],{"type":83,"value":11691},"      prompt",{"type":77,"tag":148,"props":11693,"children":11694},{"style":171},[11695],{"type":83,"value":306},{"type":77,"tag":148,"props":11697,"children":11698},{"style":177},[11699],{"type":83,"value":2010},{"type":77,"tag":148,"props":11701,"children":11702},{"style":171},[11703],{"type":83,"value":382},{"type":77,"tag":148,"props":11705,"children":11706},{"style":177},[11707],{"type":83,"value":737},{"type":77,"tag":148,"props":11709,"children":11710},{"style":171},[11711],{"type":83,"value":475},{"type":77,"tag":148,"props":11713,"children":11714},{"class":150,"line":396},[11715,11720,11724,11728],{"type":77,"tag":148,"props":11716,"children":11717},{"style":390},[11718],{"type":83,"value":11719},"      stream",{"type":77,"tag":148,"props":11721,"children":11722},{"style":171},[11723],{"type":83,"value":306},{"type":77,"tag":148,"props":11725,"children":11726},{"style":530},[11727],{"type":83,"value":533},{"type":77,"tag":148,"props":11729,"children":11730},{"style":171},[11731],{"type":83,"value":475},{"type":77,"tag":148,"props":11733,"children":11734},{"class":150,"line":404},[11735,11740],{"type":77,"tag":148,"props":11736,"children":11737},{"style":171},[11738],{"type":83,"value":11739},"    }",{"type":77,"tag":148,"props":11741,"children":11742},{"style":390},[11743],{"type":83,"value":551},{"type":77,"tag":148,"props":11745,"children":11746},{"class":150,"line":434},[11747],{"type":77,"tag":148,"props":11748,"children":11749},{"style":171},[11750],{"type":83,"value":3055},{"type":77,"tag":148,"props":11752,"children":11753},{"class":150,"line":478},[11754],{"type":77,"tag":148,"props":11755,"children":11756},{"style":177},[11757],{"type":83,"value":551},{"type":77,"tag":90,"props":11759,"children":11760},{},[11761],{"type":77,"tag":94,"props":11762,"children":11763},{},[11764],{"type":83,"value":11765},"Correct:",{"type":77,"tag":138,"props":11767,"children":11769},{"className":140,"code":11768,"language":51,"meta":142,"style":142},"import { generateImage, toServerSentEventsResponse } from '@tanstack\u002Fai'\nimport { openaiImage } from '@tanstack\u002Fai-openai'\n\nexport const generateImageStreamFn = createServerFn({ method: 'POST' }).handler(\n  ({ data }) => {\n    return toServerSentEventsResponse(\n      generateImage({\n        adapter: openaiImage('gpt-image-1'),\n        prompt: data.prompt,\n        stream: true,\n      }),\n    )\n  },\n)\n",[11770],{"type":77,"tag":107,"props":11771,"children":11772},{"__ignoreMap":142},[11773,11816,11851,11858,11929,11952,11967,11982,12021,12048,12067,12082,12089,12096],{"type":77,"tag":148,"props":11774,"children":11775},{"class":150,"line":151},[11776,11780,11784,11788,11792,11796,11800,11804,11808,11812],{"type":77,"tag":148,"props":11777,"children":11778},{"style":165},[11779],{"type":83,"value":168},{"type":77,"tag":148,"props":11781,"children":11782},{"style":171},[11783],{"type":83,"value":174},{"type":77,"tag":148,"props":11785,"children":11786},{"style":177},[11787],{"type":83,"value":180},{"type":77,"tag":148,"props":11789,"children":11790},{"style":171},[11791],{"type":83,"value":185},{"type":77,"tag":148,"props":11793,"children":11794},{"style":177},[11795],{"type":83,"value":190},{"type":77,"tag":148,"props":11797,"children":11798},{"style":171},[11799],{"type":83,"value":195},{"type":77,"tag":148,"props":11801,"children":11802},{"style":165},[11803],{"type":83,"value":200},{"type":77,"tag":148,"props":11805,"children":11806},{"style":171},[11807],{"type":83,"value":205},{"type":77,"tag":148,"props":11809,"children":11810},{"style":208},[11811],{"type":83,"value":211},{"type":77,"tag":148,"props":11813,"children":11814},{"style":171},[11815],{"type":83,"value":216},{"type":77,"tag":148,"props":11817,"children":11818},{"class":150,"line":161},[11819,11823,11827,11831,11835,11839,11843,11847],{"type":77,"tag":148,"props":11820,"children":11821},{"style":165},[11822],{"type":83,"value":168},{"type":77,"tag":148,"props":11824,"children":11825},{"style":171},[11826],{"type":83,"value":174},{"type":77,"tag":148,"props":11828,"children":11829},{"style":177},[11830],{"type":83,"value":233},{"type":77,"tag":148,"props":11832,"children":11833},{"style":171},[11834],{"type":83,"value":195},{"type":77,"tag":148,"props":11836,"children":11837},{"style":165},[11838],{"type":83,"value":200},{"type":77,"tag":148,"props":11840,"children":11841},{"style":171},[11842],{"type":83,"value":205},{"type":77,"tag":148,"props":11844,"children":11845},{"style":208},[11846],{"type":83,"value":250},{"type":77,"tag":148,"props":11848,"children":11849},{"style":171},[11850],{"type":83,"value":216},{"type":77,"tag":148,"props":11852,"children":11853},{"class":150,"line":219},[11854],{"type":77,"tag":148,"props":11855,"children":11856},{"emptyLinePlaceholder":261},[11857],{"type":83,"value":264},{"type":77,"tag":148,"props":11859,"children":11860},{"class":150,"line":257},[11861,11865,11869,11873,11877,11881,11885,11889,11893,11897,11901,11905,11909,11913,11917,11921,11925],{"type":77,"tag":148,"props":11862,"children":11863},{"style":165},[11864],{"type":83,"value":273},{"type":77,"tag":148,"props":11866,"children":11867},{"style":276},[11868],{"type":83,"value":1853},{"type":77,"tag":148,"props":11870,"children":11871},{"style":177},[11872],{"type":83,"value":1858},{"type":77,"tag":148,"props":11874,"children":11875},{"style":171},[11876],{"type":83,"value":1038},{"type":77,"tag":148,"props":11878,"children":11879},{"style":287},[11880],{"type":83,"value":1735},{"type":77,"tag":148,"props":11882,"children":11883},{"style":177},[11884],{"type":83,"value":295},{"type":77,"tag":148,"props":11886,"children":11887},{"style":171},[11888],{"type":83,"value":1104},{"type":77,"tag":148,"props":11890,"children":11891},{"style":390},[11892],{"type":83,"value":1879},{"type":77,"tag":148,"props":11894,"children":11895},{"style":171},[11896],{"type":83,"value":306},{"type":77,"tag":148,"props":11898,"children":11899},{"style":171},[11900],{"type":83,"value":205},{"type":77,"tag":148,"props":11902,"children":11903},{"style":208},[11904],{"type":83,"value":1892},{"type":77,"tag":148,"props":11906,"children":11907},{"style":171},[11908],{"type":83,"value":457},{"type":77,"tag":148,"props":11910,"children":11911},{"style":171},[11912],{"type":83,"value":195},{"type":77,"tag":148,"props":11914,"children":11915},{"style":177},[11916],{"type":83,"value":317},{"type":77,"tag":148,"props":11918,"children":11919},{"style":171},[11920],{"type":83,"value":382},{"type":77,"tag":148,"props":11922,"children":11923},{"style":287},[11924],{"type":83,"value":1996},{"type":77,"tag":148,"props":11926,"children":11927},{"style":177},[11928],{"type":83,"value":2039},{"type":77,"tag":148,"props":11930,"children":11931},{"class":150,"line":267},[11932,11936,11940,11944,11948],{"type":77,"tag":148,"props":11933,"children":11934},{"style":171},[11935],{"type":83,"value":11600},{"type":77,"tag":148,"props":11937,"children":11938},{"style":298},[11939],{"type":83,"value":2010},{"type":77,"tag":148,"props":11941,"children":11942},{"style":171},[11943],{"type":83,"value":1975},{"type":77,"tag":148,"props":11945,"children":11946},{"style":276},[11947],{"type":83,"value":994},{"type":77,"tag":148,"props":11949,"children":11950},{"style":171},[11951],{"type":83,"value":322},{"type":77,"tag":148,"props":11953,"children":11954},{"class":150,"line":325},[11955,11959,11963],{"type":77,"tag":148,"props":11956,"children":11957},{"style":165},[11958],{"type":83,"value":2030},{"type":77,"tag":148,"props":11960,"children":11961},{"style":287},[11962],{"type":83,"value":190},{"type":77,"tag":148,"props":11964,"children":11965},{"style":390},[11966],{"type":83,"value":2039},{"type":77,"tag":148,"props":11968,"children":11969},{"class":150,"line":396},[11970,11974,11978],{"type":77,"tag":148,"props":11971,"children":11972},{"style":287},[11973],{"type":83,"value":2047},{"type":77,"tag":148,"props":11975,"children":11976},{"style":390},[11977],{"type":83,"value":295},{"type":77,"tag":148,"props":11979,"children":11980},{"style":171},[11981],{"type":83,"value":431},{"type":77,"tag":148,"props":11983,"children":11984},{"class":150,"line":404},[11985,11989,11993,11997,12001,12005,12009,12013,12017],{"type":77,"tag":148,"props":11986,"children":11987},{"style":390},[11988],{"type":83,"value":2063},{"type":77,"tag":148,"props":11990,"children":11991},{"style":171},[11992],{"type":83,"value":306},{"type":77,"tag":148,"props":11994,"children":11995},{"style":287},[11996],{"type":83,"value":233},{"type":77,"tag":148,"props":11998,"children":11999},{"style":390},[12000],{"type":83,"value":295},{"type":77,"tag":148,"props":12002,"children":12003},{"style":171},[12004],{"type":83,"value":457},{"type":77,"tag":148,"props":12006,"children":12007},{"style":208},[12008],{"type":83,"value":462},{"type":77,"tag":148,"props":12010,"children":12011},{"style":171},[12012],{"type":83,"value":457},{"type":77,"tag":148,"props":12014,"children":12015},{"style":390},[12016],{"type":83,"value":317},{"type":77,"tag":148,"props":12018,"children":12019},{"style":171},[12020],{"type":83,"value":475},{"type":77,"tag":148,"props":12022,"children":12023},{"class":150,"line":434},[12024,12028,12032,12036,12040,12044],{"type":77,"tag":148,"props":12025,"children":12026},{"style":390},[12027],{"type":83,"value":2121},{"type":77,"tag":148,"props":12029,"children":12030},{"style":171},[12031],{"type":83,"value":306},{"type":77,"tag":148,"props":12033,"children":12034},{"style":177},[12035],{"type":83,"value":2010},{"type":77,"tag":148,"props":12037,"children":12038},{"style":171},[12039],{"type":83,"value":382},{"type":77,"tag":148,"props":12041,"children":12042},{"style":177},[12043],{"type":83,"value":737},{"type":77,"tag":148,"props":12045,"children":12046},{"style":171},[12047],{"type":83,"value":475},{"type":77,"tag":148,"props":12049,"children":12050},{"class":150,"line":478},[12051,12055,12059,12063],{"type":77,"tag":148,"props":12052,"children":12053},{"style":390},[12054],{"type":83,"value":2149},{"type":77,"tag":148,"props":12056,"children":12057},{"style":171},[12058],{"type":83,"value":306},{"type":77,"tag":148,"props":12060,"children":12061},{"style":530},[12062],{"type":83,"value":533},{"type":77,"tag":148,"props":12064,"children":12065},{"style":171},[12066],{"type":83,"value":475},{"type":77,"tag":148,"props":12068,"children":12069},{"class":150,"line":491},[12070,12074,12078],{"type":77,"tag":148,"props":12071,"children":12072},{"style":171},[12073],{"type":83,"value":2169},{"type":77,"tag":148,"props":12075,"children":12076},{"style":390},[12077],{"type":83,"value":317},{"type":77,"tag":148,"props":12079,"children":12080},{"style":171},[12081],{"type":83,"value":475},{"type":77,"tag":148,"props":12083,"children":12084},{"class":150,"line":504},[12085],{"type":77,"tag":148,"props":12086,"children":12087},{"style":390},[12088],{"type":83,"value":2185},{"type":77,"tag":148,"props":12090,"children":12091},{"class":150,"line":517},[12092],{"type":77,"tag":148,"props":12093,"children":12094},{"style":171},[12095],{"type":83,"value":3055},{"type":77,"tag":148,"props":12097,"children":12098},{"class":150,"line":540},[12099],{"type":77,"tag":148,"props":12100,"children":12101},{"style":177},[12102],{"type":83,"value":551},{"type":77,"tag":86,"props":12104,"children":12105},{},[12106],{"type":77,"tag":90,"props":12107,"children":12108},{},[12109],{"type":83,"value":12110},"Source: maintainer interview.",{"type":77,"tag":131,"props":12112,"children":12114},{"id":12113},"c-medium-not-downloading-openai-image-urls-before-they-expire",[12115],{"type":83,"value":12116},"c. MEDIUM: Not downloading OpenAI image URLs before they expire",{"type":77,"tag":90,"props":12118,"children":12119},{},[12120],{"type":83,"value":12121},"OpenAI image URLs expire after 1 hour. If you store the URL and display it\nlater, the image will silently break. Always download or display the image\nimmediately, or convert to base64 for persistence.",{"type":77,"tag":138,"props":12123,"children":12125},{"className":140,"code":12124,"language":51,"meta":142,"style":142},"const result = await generateImage({\n  adapter: openaiImage('dall-e-3'),\n  prompt: 'A mountain landscape',\n})\n\n\u002F\u002F GOOD: download immediately\nfor (const img of result.images) {\n  if (img.url) {\n    const response = await fetch(img.url)\n    const blob = await response.blob()\n    \u002F\u002F Save blob to storage...\n  }\n}\n\n\u002F\u002F GOOD: use b64Json when available (no expiration)\n\u002F\u002F gpt-image-1 returns b64Json by default\n",[12126],{"type":77,"tag":107,"props":12127,"children":12128},{"__ignoreMap":142},[12129,12160,12200,12228,12239,12246,12254,12297,12329,12375,12412,12420,12428,12435,12442,12450],{"type":77,"tag":148,"props":12130,"children":12131},{"class":150,"line":151},[12132,12136,12140,12144,12148,12152,12156],{"type":77,"tag":148,"props":12133,"children":12134},{"style":276},[12135],{"type":83,"value":2799},{"type":77,"tag":148,"props":12137,"children":12138},{"style":177},[12139],{"type":83,"value":5905},{"type":77,"tag":148,"props":12141,"children":12142},{"style":171},[12143],{"type":83,"value":1038},{"type":77,"tag":148,"props":12145,"children":12146},{"style":165},[12147],{"type":83,"value":372},{"type":77,"tag":148,"props":12149,"children":12150},{"style":287},[12151],{"type":83,"value":180},{"type":77,"tag":148,"props":12153,"children":12154},{"style":177},[12155],{"type":83,"value":295},{"type":77,"tag":148,"props":12157,"children":12158},{"style":171},[12159],{"type":83,"value":431},{"type":77,"tag":148,"props":12161,"children":12162},{"class":150,"line":161},[12163,12167,12171,12175,12179,12183,12188,12192,12196],{"type":77,"tag":148,"props":12164,"children":12165},{"style":390},[12166],{"type":83,"value":2832},{"type":77,"tag":148,"props":12168,"children":12169},{"style":171},[12170],{"type":83,"value":306},{"type":77,"tag":148,"props":12172,"children":12173},{"style":287},[12174],{"type":83,"value":233},{"type":77,"tag":148,"props":12176,"children":12177},{"style":177},[12178],{"type":83,"value":295},{"type":77,"tag":148,"props":12180,"children":12181},{"style":171},[12182],{"type":83,"value":457},{"type":77,"tag":148,"props":12184,"children":12185},{"style":208},[12186],{"type":83,"value":12187},"dall-e-3",{"type":77,"tag":148,"props":12189,"children":12190},{"style":171},[12191],{"type":83,"value":457},{"type":77,"tag":148,"props":12193,"children":12194},{"style":177},[12195],{"type":83,"value":317},{"type":77,"tag":148,"props":12197,"children":12198},{"style":171},[12199],{"type":83,"value":475},{"type":77,"tag":148,"props":12201,"children":12202},{"class":150,"line":219},[12203,12207,12211,12215,12220,12224],{"type":77,"tag":148,"props":12204,"children":12205},{"style":390},[12206],{"type":83,"value":2872},{"type":77,"tag":148,"props":12208,"children":12209},{"style":171},[12210],{"type":83,"value":306},{"type":77,"tag":148,"props":12212,"children":12213},{"style":171},[12214],{"type":83,"value":205},{"type":77,"tag":148,"props":12216,"children":12217},{"style":208},[12218],{"type":83,"value":12219},"A mountain landscape",{"type":77,"tag":148,"props":12221,"children":12222},{"style":171},[12223],{"type":83,"value":457},{"type":77,"tag":148,"props":12225,"children":12226},{"style":171},[12227],{"type":83,"value":475},{"type":77,"tag":148,"props":12229,"children":12230},{"class":150,"line":257},[12231,12235],{"type":77,"tag":148,"props":12232,"children":12233},{"style":171},[12234],{"type":83,"value":1114},{"type":77,"tag":148,"props":12236,"children":12237},{"style":177},[12238],{"type":83,"value":551},{"type":77,"tag":148,"props":12240,"children":12241},{"class":150,"line":267},[12242],{"type":77,"tag":148,"props":12243,"children":12244},{"emptyLinePlaceholder":261},[12245],{"type":83,"value":264},{"type":77,"tag":148,"props":12247,"children":12248},{"class":150,"line":325},[12249],{"type":77,"tag":148,"props":12250,"children":12251},{"style":155},[12252],{"type":83,"value":12253},"\u002F\u002F GOOD: download immediately\n",{"type":77,"tag":148,"props":12255,"children":12256},{"class":150,"line":396},[12257,12262,12266,12270,12275,12280,12284,12288,12293],{"type":77,"tag":148,"props":12258,"children":12259},{"style":165},[12260],{"type":83,"value":12261},"for",{"type":77,"tag":148,"props":12263,"children":12264},{"style":177},[12265],{"type":83,"value":2369},{"type":77,"tag":148,"props":12267,"children":12268},{"style":276},[12269],{"type":83,"value":2799},{"type":77,"tag":148,"props":12271,"children":12272},{"style":177},[12273],{"type":83,"value":12274}," img ",{"type":77,"tag":148,"props":12276,"children":12277},{"style":171},[12278],{"type":83,"value":12279},"of",{"type":77,"tag":148,"props":12281,"children":12282},{"style":177},[12283],{"type":83,"value":797},{"type":77,"tag":148,"props":12285,"children":12286},{"style":171},[12287],{"type":83,"value":382},{"type":77,"tag":148,"props":12289,"children":12290},{"style":177},[12291],{"type":83,"value":12292},"images) ",{"type":77,"tag":148,"props":12294,"children":12295},{"style":171},[12296],{"type":83,"value":431},{"type":77,"tag":148,"props":12298,"children":12299},{"class":150,"line":404},[12300,12305,12309,12313,12317,12321,12325],{"type":77,"tag":148,"props":12301,"children":12302},{"style":165},[12303],{"type":83,"value":12304},"  if",{"type":77,"tag":148,"props":12306,"children":12307},{"style":390},[12308],{"type":83,"value":2369},{"type":77,"tag":148,"props":12310,"children":12311},{"style":177},[12312],{"type":83,"value":1381},{"type":77,"tag":148,"props":12314,"children":12315},{"style":171},[12316],{"type":83,"value":382},{"type":77,"tag":148,"props":12318,"children":12319},{"style":177},[12320],{"type":83,"value":3810},{"type":77,"tag":148,"props":12322,"children":12323},{"style":390},[12324],{"type":83,"value":8309},{"type":77,"tag":148,"props":12326,"children":12327},{"style":171},[12328],{"type":83,"value":431},{"type":77,"tag":148,"props":12330,"children":12331},{"class":150,"line":434},[12332,12337,12342,12346,12350,12355,12359,12363,12367,12371],{"type":77,"tag":148,"props":12333,"children":12334},{"style":276},[12335],{"type":83,"value":12336},"    const",{"type":77,"tag":148,"props":12338,"children":12339},{"style":177},[12340],{"type":83,"value":12341}," response",{"type":77,"tag":148,"props":12343,"children":12344},{"style":171},[12345],{"type":83,"value":367},{"type":77,"tag":148,"props":12347,"children":12348},{"style":165},[12349],{"type":83,"value":372},{"type":77,"tag":148,"props":12351,"children":12352},{"style":287},[12353],{"type":83,"value":12354}," fetch",{"type":77,"tag":148,"props":12356,"children":12357},{"style":390},[12358],{"type":83,"value":295},{"type":77,"tag":148,"props":12360,"children":12361},{"style":177},[12362],{"type":83,"value":1381},{"type":77,"tag":148,"props":12364,"children":12365},{"style":171},[12366],{"type":83,"value":382},{"type":77,"tag":148,"props":12368,"children":12369},{"style":177},[12370],{"type":83,"value":3810},{"type":77,"tag":148,"props":12372,"children":12373},{"style":390},[12374],{"type":83,"value":551},{"type":77,"tag":148,"props":12376,"children":12377},{"class":150,"line":478},[12378,12382,12387,12391,12395,12399,12403,12408],{"type":77,"tag":148,"props":12379,"children":12380},{"style":276},[12381],{"type":83,"value":12336},{"type":77,"tag":148,"props":12383,"children":12384},{"style":177},[12385],{"type":83,"value":12386}," blob",{"type":77,"tag":148,"props":12388,"children":12389},{"style":171},[12390],{"type":83,"value":367},{"type":77,"tag":148,"props":12392,"children":12393},{"style":165},[12394],{"type":83,"value":372},{"type":77,"tag":148,"props":12396,"children":12397},{"style":177},[12398],{"type":83,"value":12341},{"type":77,"tag":148,"props":12400,"children":12401},{"style":171},[12402],{"type":83,"value":382},{"type":77,"tag":148,"props":12404,"children":12405},{"style":287},[12406],{"type":83,"value":12407},"blob",{"type":77,"tag":148,"props":12409,"children":12410},{"style":390},[12411],{"type":83,"value":393},{"type":77,"tag":148,"props":12413,"children":12414},{"class":150,"line":491},[12415],{"type":77,"tag":148,"props":12416,"children":12417},{"style":155},[12418],{"type":83,"value":12419},"    \u002F\u002F Save blob to storage...\n",{"type":77,"tag":148,"props":12421,"children":12422},{"class":150,"line":504},[12423],{"type":77,"tag":148,"props":12424,"children":12425},{"style":171},[12426],{"type":83,"value":12427},"  }\n",{"type":77,"tag":148,"props":12429,"children":12430},{"class":150,"line":517},[12431],{"type":77,"tag":148,"props":12432,"children":12433},{"style":171},[12434],{"type":83,"value":594},{"type":77,"tag":148,"props":12436,"children":12437},{"class":150,"line":540},[12438],{"type":77,"tag":148,"props":12439,"children":12440},{"emptyLinePlaceholder":261},[12441],{"type":83,"value":264},{"type":77,"tag":148,"props":12443,"children":12444},{"class":150,"line":554},[12445],{"type":77,"tag":148,"props":12446,"children":12447},{"style":155},[12448],{"type":83,"value":12449},"\u002F\u002F GOOD: use b64Json when available (no expiration)\n",{"type":77,"tag":148,"props":12451,"children":12452},{"class":150,"line":562},[12453],{"type":77,"tag":148,"props":12454,"children":12455},{"style":155},[12456],{"type":83,"value":12457},"\u002F\u002F gpt-image-1 returns b64Json by default\n",{"type":77,"tag":86,"props":12459,"children":12460},{},[12461],{"type":77,"tag":90,"props":12462,"children":12463},{},[12464],{"type":83,"value":12465},"Source: docs\u002Fmedia\u002Fimage-generation.md.",{"type":77,"tag":131,"props":12467,"children":12469},{"id":12468},"d-medium-using-stream-true-for-activities-that-do-not-support-streaming",[12470,12472,12477],{"type":83,"value":12471},"d. MEDIUM: Using ",{"type":77,"tag":107,"props":12473,"children":12475},{"className":12474},[],[12476],{"type":83,"value":11498},{"type":83,"value":12478}," for activities that do not support streaming",{"type":77,"tag":90,"props":12480,"children":12481},{},[12482,12484,12489,12491,12496,12497,12503,12504,12510,12511,12517,12518,12523,12524,12530,12532,12537,12539,12545],{"type":83,"value":12483},"Not all generation activities support streaming. Passing ",{"type":77,"tag":107,"props":12485,"children":12487},{"className":12486},[],[12488],{"type":83,"value":11498},{"type":83,"value":12490}," to\nan activity that does not support it may hang or produce unexpected results.\nCheck the activity documentation before enabling streaming. All built-in\nactivities (",{"type":77,"tag":107,"props":12492,"children":12494},{"className":12493},[],[12495],{"type":83,"value":5502},{"type":83,"value":3416},{"type":77,"tag":107,"props":12498,"children":12500},{"className":12499},[],[12501],{"type":83,"value":12502},"generateAudio",{"type":83,"value":3416},{"type":77,"tag":107,"props":12505,"children":12507},{"className":12506},[],[12508],{"type":83,"value":12509},"generateSpeech",{"type":83,"value":475},{"type":77,"tag":107,"props":12512,"children":12514},{"className":12513},[],[12515],{"type":83,"value":12516},"generateTranscription",{"type":83,"value":3416},{"type":77,"tag":107,"props":12519,"children":12521},{"className":12520},[],[12522],{"type":83,"value":5513},{"type":83,"value":3416},{"type":77,"tag":107,"props":12525,"children":12527},{"className":12526},[],[12528],{"type":83,"value":12529},"summarize",{"type":83,"value":12531},") support ",{"type":77,"tag":107,"props":12533,"children":12535},{"className":12534},[],[12536],{"type":83,"value":11498},{"type":83,"value":12538},",\nbut custom ",{"type":77,"tag":107,"props":12540,"children":12542},{"className":12541},[],[12543],{"type":83,"value":12544},"useGeneration",{"type":83,"value":12546}," setups may not.",{"type":77,"tag":86,"props":12548,"children":12549},{},[12550],{"type":77,"tag":90,"props":12551,"children":12552},{},[12553],{"type":83,"value":12554},"Source: docs\u002Fmedia\u002Fgenerations.md.",{"type":77,"tag":131,"props":12556,"children":12558},{"id":12557},"e-high-passing-responsemimetype-or-negativeprompt-to-gemini-lyria",[12559,12561,12567,12568,12574],{"type":83,"value":12560},"e. HIGH: Passing ",{"type":77,"tag":107,"props":12562,"children":12564},{"className":12563},[],[12565],{"type":83,"value":12566},"responseMimeType",{"type":83,"value":6843},{"type":77,"tag":107,"props":12569,"children":12571},{"className":12570},[],[12572],{"type":83,"value":12573},"negativePrompt",{"type":83,"value":12575}," to Gemini Lyria",{"type":77,"tag":90,"props":12577,"children":12578},{},[12579,12581,12587,12589,12594,12596,12601,12602,12607,12609,12615,12617,12622,12624,12630,12632,12638],{"type":83,"value":12580},"Gemini's ",{"type":77,"tag":107,"props":12582,"children":12584},{"className":12583},[],[12585],{"type":83,"value":12586},"GenerateContentConfig",{"type":83,"value":12588}," (used by Lyria 3 Pro \u002F Lyria 3 Clip) does\n",{"type":77,"tag":94,"props":12590,"children":12591},{},[12592],{"type":83,"value":12593},"not",{"type":83,"value":12595}," support ",{"type":77,"tag":107,"props":12597,"children":12599},{"className":12598},[],[12600],{"type":83,"value":12566},{"type":83,"value":6843},{"type":77,"tag":107,"props":12603,"children":12605},{"className":12604},[],[12606],{"type":83,"value":12573},{"type":83,"value":12608},". Lyria 3 Clip always\nreturns 30-second ",{"type":77,"tag":107,"props":12610,"children":12612},{"className":12611},[],[12613],{"type":83,"value":12614},"audio\u002Fmp3",{"type":83,"value":12616},"; Lyria 3 Pro returns ",{"type":77,"tag":107,"props":12618,"children":12620},{"className":12619},[],[12621],{"type":83,"value":12614},{"type":83,"value":12623},". These fields\nare not in ",{"type":77,"tag":107,"props":12625,"children":12627},{"className":12626},[],[12628],{"type":83,"value":12629},"GeminiAudioProviderOptions",{"type":83,"value":12631}," — don't reach for them via ",{"type":77,"tag":107,"props":12633,"children":12635},{"className":12634},[],[12636],{"type":83,"value":12637},"as any",{"type":83,"value":382},{"type":77,"tag":138,"props":12640,"children":12642},{"className":140,"code":12641,"language":51,"meta":142,"style":142},"\u002F\u002F WRONG — both fields are silently ignored or rejected by the SDK\ngenerateAudio({\n  adapter: geminiAudio('lyria-3-pro-preview'),\n  prompt: 'ambient piano',\n  modelOptions: {\n    responseMimeType: 'audio\u002Fwav', \u002F\u002F unsupported\n    negativePrompt: 'vocals', \u002F\u002F unsupported\n  } as any,\n})\n\n\u002F\u002F CORRECT — shape the prompt itself for what you want\ngenerateAudio({\n  adapter: geminiAudio('lyria-3-pro-preview'),\n  prompt: 'ambient piano, no vocals',\n})\n",[12643],{"type":77,"tag":107,"props":12644,"children":12645},{"__ignoreMap":142},[12646,12654,12669,12710,12738,12753,12787,12820,12841,12852,12859,12867,12882,12921,12949],{"type":77,"tag":148,"props":12647,"children":12648},{"class":150,"line":151},[12649],{"type":77,"tag":148,"props":12650,"children":12651},{"style":155},[12652],{"type":83,"value":12653},"\u002F\u002F WRONG — both fields are silently ignored or rejected by the SDK\n",{"type":77,"tag":148,"props":12655,"children":12656},{"class":150,"line":161},[12657,12661,12665],{"type":77,"tag":148,"props":12658,"children":12659},{"style":287},[12660],{"type":83,"value":12502},{"type":77,"tag":148,"props":12662,"children":12663},{"style":177},[12664],{"type":83,"value":295},{"type":77,"tag":148,"props":12666,"children":12667},{"style":171},[12668],{"type":83,"value":431},{"type":77,"tag":148,"props":12670,"children":12671},{"class":150,"line":219},[12672,12676,12680,12685,12689,12693,12698,12702,12706],{"type":77,"tag":148,"props":12673,"children":12674},{"style":390},[12675],{"type":83,"value":2832},{"type":77,"tag":148,"props":12677,"children":12678},{"style":171},[12679],{"type":83,"value":306},{"type":77,"tag":148,"props":12681,"children":12682},{"style":287},[12683],{"type":83,"value":12684}," geminiAudio",{"type":77,"tag":148,"props":12686,"children":12687},{"style":177},[12688],{"type":83,"value":295},{"type":77,"tag":148,"props":12690,"children":12691},{"style":171},[12692],{"type":83,"value":457},{"type":77,"tag":148,"props":12694,"children":12695},{"style":208},[12696],{"type":83,"value":12697},"lyria-3-pro-preview",{"type":77,"tag":148,"props":12699,"children":12700},{"style":171},[12701],{"type":83,"value":457},{"type":77,"tag":148,"props":12703,"children":12704},{"style":177},[12705],{"type":83,"value":317},{"type":77,"tag":148,"props":12707,"children":12708},{"style":171},[12709],{"type":83,"value":475},{"type":77,"tag":148,"props":12711,"children":12712},{"class":150,"line":257},[12713,12717,12721,12725,12730,12734],{"type":77,"tag":148,"props":12714,"children":12715},{"style":390},[12716],{"type":83,"value":2872},{"type":77,"tag":148,"props":12718,"children":12719},{"style":171},[12720],{"type":83,"value":306},{"type":77,"tag":148,"props":12722,"children":12723},{"style":171},[12724],{"type":83,"value":205},{"type":77,"tag":148,"props":12726,"children":12727},{"style":208},[12728],{"type":83,"value":12729},"ambient piano",{"type":77,"tag":148,"props":12731,"children":12732},{"style":171},[12733],{"type":83,"value":457},{"type":77,"tag":148,"props":12735,"children":12736},{"style":171},[12737],{"type":83,"value":475},{"type":77,"tag":148,"props":12739,"children":12740},{"class":150,"line":267},[12741,12745,12749],{"type":77,"tag":148,"props":12742,"children":12743},{"style":390},[12744],{"type":83,"value":2952},{"type":77,"tag":148,"props":12746,"children":12747},{"style":171},[12748],{"type":83,"value":306},{"type":77,"tag":148,"props":12750,"children":12751},{"style":171},[12752],{"type":83,"value":322},{"type":77,"tag":148,"props":12754,"children":12755},{"class":150,"line":325},[12756,12761,12765,12769,12774,12778,12782],{"type":77,"tag":148,"props":12757,"children":12758},{"style":390},[12759],{"type":83,"value":12760},"    responseMimeType",{"type":77,"tag":148,"props":12762,"children":12763},{"style":171},[12764],{"type":83,"value":306},{"type":77,"tag":148,"props":12766,"children":12767},{"style":171},[12768],{"type":83,"value":205},{"type":77,"tag":148,"props":12770,"children":12771},{"style":208},[12772],{"type":83,"value":12773},"audio\u002Fwav",{"type":77,"tag":148,"props":12775,"children":12776},{"style":171},[12777],{"type":83,"value":457},{"type":77,"tag":148,"props":12779,"children":12780},{"style":171},[12781],{"type":83,"value":185},{"type":77,"tag":148,"props":12783,"children":12784},{"style":155},[12785],{"type":83,"value":12786}," \u002F\u002F unsupported\n",{"type":77,"tag":148,"props":12788,"children":12789},{"class":150,"line":396},[12790,12795,12799,12803,12808,12812,12816],{"type":77,"tag":148,"props":12791,"children":12792},{"style":390},[12793],{"type":83,"value":12794},"    negativePrompt",{"type":77,"tag":148,"props":12796,"children":12797},{"style":171},[12798],{"type":83,"value":306},{"type":77,"tag":148,"props":12800,"children":12801},{"style":171},[12802],{"type":83,"value":205},{"type":77,"tag":148,"props":12804,"children":12805},{"style":208},[12806],{"type":83,"value":12807},"vocals",{"type":77,"tag":148,"props":12809,"children":12810},{"style":171},[12811],{"type":83,"value":457},{"type":77,"tag":148,"props":12813,"children":12814},{"style":171},[12815],{"type":83,"value":185},{"type":77,"tag":148,"props":12817,"children":12818},{"style":155},[12819],{"type":83,"value":12786},{"type":77,"tag":148,"props":12821,"children":12822},{"class":150,"line":404},[12823,12827,12832,12837],{"type":77,"tag":148,"props":12824,"children":12825},{"style":171},[12826],{"type":83,"value":546},{"type":77,"tag":148,"props":12828,"children":12829},{"style":165},[12830],{"type":83,"value":12831}," as",{"type":77,"tag":148,"props":12833,"children":12834},{"style":309},[12835],{"type":83,"value":12836}," any",{"type":77,"tag":148,"props":12838,"children":12839},{"style":171},[12840],{"type":83,"value":475},{"type":77,"tag":148,"props":12842,"children":12843},{"class":150,"line":434},[12844,12848],{"type":77,"tag":148,"props":12845,"children":12846},{"style":171},[12847],{"type":83,"value":1114},{"type":77,"tag":148,"props":12849,"children":12850},{"style":177},[12851],{"type":83,"value":551},{"type":77,"tag":148,"props":12853,"children":12854},{"class":150,"line":478},[12855],{"type":77,"tag":148,"props":12856,"children":12857},{"emptyLinePlaceholder":261},[12858],{"type":83,"value":264},{"type":77,"tag":148,"props":12860,"children":12861},{"class":150,"line":491},[12862],{"type":77,"tag":148,"props":12863,"children":12864},{"style":155},[12865],{"type":83,"value":12866},"\u002F\u002F CORRECT — shape the prompt itself for what you want\n",{"type":77,"tag":148,"props":12868,"children":12869},{"class":150,"line":504},[12870,12874,12878],{"type":77,"tag":148,"props":12871,"children":12872},{"style":287},[12873],{"type":83,"value":12502},{"type":77,"tag":148,"props":12875,"children":12876},{"style":177},[12877],{"type":83,"value":295},{"type":77,"tag":148,"props":12879,"children":12880},{"style":171},[12881],{"type":83,"value":431},{"type":77,"tag":148,"props":12883,"children":12884},{"class":150,"line":517},[12885,12889,12893,12897,12901,12905,12909,12913,12917],{"type":77,"tag":148,"props":12886,"children":12887},{"style":390},[12888],{"type":83,"value":2832},{"type":77,"tag":148,"props":12890,"children":12891},{"style":171},[12892],{"type":83,"value":306},{"type":77,"tag":148,"props":12894,"children":12895},{"style":287},[12896],{"type":83,"value":12684},{"type":77,"tag":148,"props":12898,"children":12899},{"style":177},[12900],{"type":83,"value":295},{"type":77,"tag":148,"props":12902,"children":12903},{"style":171},[12904],{"type":83,"value":457},{"type":77,"tag":148,"props":12906,"children":12907},{"style":208},[12908],{"type":83,"value":12697},{"type":77,"tag":148,"props":12910,"children":12911},{"style":171},[12912],{"type":83,"value":457},{"type":77,"tag":148,"props":12914,"children":12915},{"style":177},[12916],{"type":83,"value":317},{"type":77,"tag":148,"props":12918,"children":12919},{"style":171},[12920],{"type":83,"value":475},{"type":77,"tag":148,"props":12922,"children":12923},{"class":150,"line":540},[12924,12928,12932,12936,12941,12945],{"type":77,"tag":148,"props":12925,"children":12926},{"style":390},[12927],{"type":83,"value":2872},{"type":77,"tag":148,"props":12929,"children":12930},{"style":171},[12931],{"type":83,"value":306},{"type":77,"tag":148,"props":12933,"children":12934},{"style":171},[12935],{"type":83,"value":205},{"type":77,"tag":148,"props":12937,"children":12938},{"style":208},[12939],{"type":83,"value":12940},"ambient piano, no vocals",{"type":77,"tag":148,"props":12942,"children":12943},{"style":171},[12944],{"type":83,"value":457},{"type":77,"tag":148,"props":12946,"children":12947},{"style":171},[12948],{"type":83,"value":475},{"type":77,"tag":148,"props":12950,"children":12951},{"class":150,"line":554},[12952,12956],{"type":77,"tag":148,"props":12953,"children":12954},{"style":171},[12955],{"type":83,"value":1114},{"type":77,"tag":148,"props":12957,"children":12958},{"style":177},[12959],{"type":83,"value":551},{"type":77,"tag":86,"props":12961,"children":12962},{},[12963],{"type":77,"tag":90,"props":12964,"children":12965},{},[12966,12968,12973],{"type":83,"value":12967},"Source: Gemini API ",{"type":77,"tag":107,"props":12969,"children":12971},{"className":12970},[],[12972],{"type":83,"value":12586},{"type":83,"value":12974}," type; docs\u002Fmedia\u002Faudio-generation.md.",{"type":77,"tag":131,"props":12976,"children":12978},{"id":12977},"f-medium-passing-duration-to-lyria-expecting-it-to-control-length",[12979,12981,12986],{"type":83,"value":12980},"f. MEDIUM: Passing ",{"type":77,"tag":107,"props":12982,"children":12984},{"className":12983},[],[12985],{"type":83,"value":8681},{"type":83,"value":12987}," to Lyria expecting it to control length",{"type":77,"tag":90,"props":12989,"children":12990},{},[12991,12993,12998,13000,13004,13006,13011,13013,13018,13020,13026,13027,13033],{"type":83,"value":12992},"Lyria 3 Clip is fixed at 30 seconds — the ",{"type":77,"tag":107,"props":12994,"children":12996},{"className":12995},[],[12997],{"type":83,"value":8681},{"type":83,"value":12999}," option is ignored on\nthat model. Lyria 3 Pro accepts duration via natural-language in the\n",{"type":77,"tag":94,"props":13001,"children":13002},{},[13003],{"type":83,"value":737},{"type":83,"value":13005}," (\"2-minute ambient track with a 30-second build\"), not via the\n",{"type":77,"tag":107,"props":13007,"children":13009},{"className":13008},[],[13010],{"type":83,"value":8681},{"type":83,"value":13012}," field. ",{"type":77,"tag":107,"props":13014,"children":13016},{"className":13015},[],[13017],{"type":83,"value":8681},{"type":83,"value":13019}," works for fal audio models (mapped to each\nmodel's native field like ",{"type":77,"tag":107,"props":13021,"children":13023},{"className":13022},[],[13024],{"type":83,"value":13025},"music_length_ms",{"type":83,"value":6843},{"type":77,"tag":107,"props":13028,"children":13030},{"className":13029},[],[13031],{"type":83,"value":13032},"seconds_total",{"type":83,"value":13034},"), but not\nfor Lyria.",{"type":77,"tag":138,"props":13036,"children":13038},{"className":140,"code":13037,"language":51,"meta":142,"style":142},"\u002F\u002F For Lyria: put length guidance in the prompt\ngenerateAudio({\n  adapter: geminiAudio('lyria-3-pro-preview'),\n  prompt: 'A 2-minute ambient piano piece with gentle strings',\n  \u002F\u002F duration: 120  \u002F\u002F ← does nothing; rely on the prompt\n})\n\n\u002F\u002F For fal: duration works and is translated per-model\ngenerateAudio({\n  adapter: falAudio('fal-ai\u002Fminimax-music\u002Fv2'),\n  prompt: 'upbeat synth melody',\n  duration: 60, \u002F\u002F → music_length_ms: 60_000\n})\n",[13039],{"type":77,"tag":107,"props":13040,"children":13041},{"__ignoreMap":142},[13042,13050,13065,13104,13132,13145,13156,13163,13171,13186,13226,13254,13279],{"type":77,"tag":148,"props":13043,"children":13044},{"class":150,"line":151},[13045],{"type":77,"tag":148,"props":13046,"children":13047},{"style":155},[13048],{"type":83,"value":13049},"\u002F\u002F For Lyria: put length guidance in the prompt\n",{"type":77,"tag":148,"props":13051,"children":13052},{"class":150,"line":161},[13053,13057,13061],{"type":77,"tag":148,"props":13054,"children":13055},{"style":287},[13056],{"type":83,"value":12502},{"type":77,"tag":148,"props":13058,"children":13059},{"style":177},[13060],{"type":83,"value":295},{"type":77,"tag":148,"props":13062,"children":13063},{"style":171},[13064],{"type":83,"value":431},{"type":77,"tag":148,"props":13066,"children":13067},{"class":150,"line":219},[13068,13072,13076,13080,13084,13088,13092,13096,13100],{"type":77,"tag":148,"props":13069,"children":13070},{"style":390},[13071],{"type":83,"value":2832},{"type":77,"tag":148,"props":13073,"children":13074},{"style":171},[13075],{"type":83,"value":306},{"type":77,"tag":148,"props":13077,"children":13078},{"style":287},[13079],{"type":83,"value":12684},{"type":77,"tag":148,"props":13081,"children":13082},{"style":177},[13083],{"type":83,"value":295},{"type":77,"tag":148,"props":13085,"children":13086},{"style":171},[13087],{"type":83,"value":457},{"type":77,"tag":148,"props":13089,"children":13090},{"style":208},[13091],{"type":83,"value":12697},{"type":77,"tag":148,"props":13093,"children":13094},{"style":171},[13095],{"type":83,"value":457},{"type":77,"tag":148,"props":13097,"children":13098},{"style":177},[13099],{"type":83,"value":317},{"type":77,"tag":148,"props":13101,"children":13102},{"style":171},[13103],{"type":83,"value":475},{"type":77,"tag":148,"props":13105,"children":13106},{"class":150,"line":257},[13107,13111,13115,13119,13124,13128],{"type":77,"tag":148,"props":13108,"children":13109},{"style":390},[13110],{"type":83,"value":2872},{"type":77,"tag":148,"props":13112,"children":13113},{"style":171},[13114],{"type":83,"value":306},{"type":77,"tag":148,"props":13116,"children":13117},{"style":171},[13118],{"type":83,"value":205},{"type":77,"tag":148,"props":13120,"children":13121},{"style":208},[13122],{"type":83,"value":13123},"A 2-minute ambient piano piece with gentle strings",{"type":77,"tag":148,"props":13125,"children":13126},{"style":171},[13127],{"type":83,"value":457},{"type":77,"tag":148,"props":13129,"children":13130},{"style":171},[13131],{"type":83,"value":475},{"type":77,"tag":148,"props":13133,"children":13134},{"class":150,"line":267},[13135,13140],{"type":77,"tag":148,"props":13136,"children":13137},{"style":155},[13138],{"type":83,"value":13139},"  \u002F\u002F duration: 120",{"type":77,"tag":148,"props":13141,"children":13142},{"style":155},[13143],{"type":83,"value":13144},"  \u002F\u002F ← does nothing; rely on the prompt\n",{"type":77,"tag":148,"props":13146,"children":13147},{"class":150,"line":325},[13148,13152],{"type":77,"tag":148,"props":13149,"children":13150},{"style":171},[13151],{"type":83,"value":1114},{"type":77,"tag":148,"props":13153,"children":13154},{"style":177},[13155],{"type":83,"value":551},{"type":77,"tag":148,"props":13157,"children":13158},{"class":150,"line":396},[13159],{"type":77,"tag":148,"props":13160,"children":13161},{"emptyLinePlaceholder":261},[13162],{"type":83,"value":264},{"type":77,"tag":148,"props":13164,"children":13165},{"class":150,"line":404},[13166],{"type":77,"tag":148,"props":13167,"children":13168},{"style":155},[13169],{"type":83,"value":13170},"\u002F\u002F For fal: duration works and is translated per-model\n",{"type":77,"tag":148,"props":13172,"children":13173},{"class":150,"line":434},[13174,13178,13182],{"type":77,"tag":148,"props":13175,"children":13176},{"style":287},[13177],{"type":83,"value":12502},{"type":77,"tag":148,"props":13179,"children":13180},{"style":177},[13181],{"type":83,"value":295},{"type":77,"tag":148,"props":13183,"children":13184},{"style":171},[13185],{"type":83,"value":431},{"type":77,"tag":148,"props":13187,"children":13188},{"class":150,"line":478},[13189,13193,13197,13201,13205,13209,13214,13218,13222],{"type":77,"tag":148,"props":13190,"children":13191},{"style":390},[13192],{"type":83,"value":2832},{"type":77,"tag":148,"props":13194,"children":13195},{"style":171},[13196],{"type":83,"value":306},{"type":77,"tag":148,"props":13198,"children":13199},{"style":287},[13200],{"type":83,"value":5866},{"type":77,"tag":148,"props":13202,"children":13203},{"style":177},[13204],{"type":83,"value":295},{"type":77,"tag":148,"props":13206,"children":13207},{"style":171},[13208],{"type":83,"value":457},{"type":77,"tag":148,"props":13210,"children":13211},{"style":208},[13212],{"type":83,"value":13213},"fal-ai\u002Fminimax-music\u002Fv2",{"type":77,"tag":148,"props":13215,"children":13216},{"style":171},[13217],{"type":83,"value":457},{"type":77,"tag":148,"props":13219,"children":13220},{"style":177},[13221],{"type":83,"value":317},{"type":77,"tag":148,"props":13223,"children":13224},{"style":171},[13225],{"type":83,"value":475},{"type":77,"tag":148,"props":13227,"children":13228},{"class":150,"line":491},[13229,13233,13237,13241,13246,13250],{"type":77,"tag":148,"props":13230,"children":13231},{"style":390},[13232],{"type":83,"value":2872},{"type":77,"tag":148,"props":13234,"children":13235},{"style":171},[13236],{"type":83,"value":306},{"type":77,"tag":148,"props":13238,"children":13239},{"style":171},[13240],{"type":83,"value":205},{"type":77,"tag":148,"props":13242,"children":13243},{"style":208},[13244],{"type":83,"value":13245},"upbeat synth melody",{"type":77,"tag":148,"props":13247,"children":13248},{"style":171},[13249],{"type":83,"value":457},{"type":77,"tag":148,"props":13251,"children":13252},{"style":171},[13253],{"type":83,"value":475},{"type":77,"tag":148,"props":13255,"children":13256},{"class":150,"line":504},[13257,13261,13265,13270,13274],{"type":77,"tag":148,"props":13258,"children":13259},{"style":390},[13260],{"type":83,"value":6001},{"type":77,"tag":148,"props":13262,"children":13263},{"style":171},[13264],{"type":83,"value":306},{"type":77,"tag":148,"props":13266,"children":13267},{"style":2937},[13268],{"type":83,"value":13269}," 60",{"type":77,"tag":148,"props":13271,"children":13272},{"style":171},[13273],{"type":83,"value":185},{"type":77,"tag":148,"props":13275,"children":13276},{"style":155},[13277],{"type":83,"value":13278}," \u002F\u002F → music_length_ms: 60_000\n",{"type":77,"tag":148,"props":13280,"children":13281},{"class":150,"line":517},[13282,13286],{"type":77,"tag":148,"props":13283,"children":13284},{"style":171},[13285],{"type":83,"value":1114},{"type":77,"tag":148,"props":13287,"children":13288},{"style":177},[13289],{"type":83,"value":551},{"type":77,"tag":86,"props":13291,"children":13292},{},[13293],{"type":77,"tag":90,"props":13294,"children":13295},{},[13296],{"type":83,"value":13297},"Source: Google Lyria 3 docs; docs\u002Fmedia\u002Faudio-generation.md.",{"type":77,"tag":131,"props":13299,"children":13301},{"id":13300},"g-medium-gemini-tts-multi-speaker-with-0-or-3-speakers",[13302],{"type":83,"value":13303},"g. MEDIUM: Gemini TTS multi-speaker with 0 or 3+ speakers",{"type":77,"tag":90,"props":13305,"children":13306},{},[13307,13313,13315,13320],{"type":77,"tag":107,"props":13308,"children":13310},{"className":13309},[],[13311],{"type":83,"value":13312},"multiSpeakerVoiceConfig.speakerVoiceConfigs",{"type":83,"value":13314}," is validated to be length 1 or 2. Passing an empty array or three+ entries throws at the adapter boundary\n(not at Gemini's API) with a clear error. Don't try to work around it with\n",{"type":77,"tag":107,"props":13316,"children":13318},{"className":13317},[],[13319],{"type":83,"value":12637},{"type":83,"value":382},{"type":77,"tag":138,"props":13322,"children":13324},{"className":140,"code":13323,"language":51,"meta":142,"style":142},"generateSpeech({\n  adapter: geminiSpeech('gemini-2.5-pro-preview-tts'),\n  text: '[Alice] Hi. [Bob] Hello!',\n  modelOptions: {\n    multiSpeakerVoiceConfig: {\n      speakerVoiceConfigs: [\n        {\n          speaker: 'Alice',\n          voiceConfig: { prebuiltVoiceConfig: { voiceName: 'Kore' } },\n        },\n        {\n          speaker: 'Bob',\n          voiceConfig: { prebuiltVoiceConfig: { voiceName: 'Puck' } },\n        },\n      ],\n    },\n  },\n})\n",[13325],{"type":77,"tag":107,"props":13326,"children":13327},{"__ignoreMap":142},[13328,13343,13384,13412,13427,13443,13459,13467,13496,13555,13563,13570,13598,13654,13661,13673,13680,13687],{"type":77,"tag":148,"props":13329,"children":13330},{"class":150,"line":151},[13331,13335,13339],{"type":77,"tag":148,"props":13332,"children":13333},{"style":287},[13334],{"type":83,"value":12509},{"type":77,"tag":148,"props":13336,"children":13337},{"style":177},[13338],{"type":83,"value":295},{"type":77,"tag":148,"props":13340,"children":13341},{"style":171},[13342],{"type":83,"value":431},{"type":77,"tag":148,"props":13344,"children":13345},{"class":150,"line":161},[13346,13350,13354,13359,13363,13367,13372,13376,13380],{"type":77,"tag":148,"props":13347,"children":13348},{"style":390},[13349],{"type":83,"value":2832},{"type":77,"tag":148,"props":13351,"children":13352},{"style":171},[13353],{"type":83,"value":306},{"type":77,"tag":148,"props":13355,"children":13356},{"style":287},[13357],{"type":83,"value":13358}," geminiSpeech",{"type":77,"tag":148,"props":13360,"children":13361},{"style":177},[13362],{"type":83,"value":295},{"type":77,"tag":148,"props":13364,"children":13365},{"style":171},[13366],{"type":83,"value":457},{"type":77,"tag":148,"props":13368,"children":13369},{"style":208},[13370],{"type":83,"value":13371},"gemini-2.5-pro-preview-tts",{"type":77,"tag":148,"props":13373,"children":13374},{"style":171},[13375],{"type":83,"value":457},{"type":77,"tag":148,"props":13377,"children":13378},{"style":177},[13379],{"type":83,"value":317},{"type":77,"tag":148,"props":13381,"children":13382},{"style":171},[13383],{"type":83,"value":475},{"type":77,"tag":148,"props":13385,"children":13386},{"class":150,"line":219},[13387,13391,13395,13399,13404,13408],{"type":77,"tag":148,"props":13388,"children":13389},{"style":390},[13390],{"type":83,"value":6422},{"type":77,"tag":148,"props":13392,"children":13393},{"style":171},[13394],{"type":83,"value":306},{"type":77,"tag":148,"props":13396,"children":13397},{"style":171},[13398],{"type":83,"value":205},{"type":77,"tag":148,"props":13400,"children":13401},{"style":208},[13402],{"type":83,"value":13403},"[Alice] Hi. [Bob] Hello!",{"type":77,"tag":148,"props":13405,"children":13406},{"style":171},[13407],{"type":83,"value":457},{"type":77,"tag":148,"props":13409,"children":13410},{"style":171},[13411],{"type":83,"value":475},{"type":77,"tag":148,"props":13413,"children":13414},{"class":150,"line":257},[13415,13419,13423],{"type":77,"tag":148,"props":13416,"children":13417},{"style":390},[13418],{"type":83,"value":2952},{"type":77,"tag":148,"props":13420,"children":13421},{"style":171},[13422],{"type":83,"value":306},{"type":77,"tag":148,"props":13424,"children":13425},{"style":171},[13426],{"type":83,"value":322},{"type":77,"tag":148,"props":13428,"children":13429},{"class":150,"line":267},[13430,13435,13439],{"type":77,"tag":148,"props":13431,"children":13432},{"style":390},[13433],{"type":83,"value":13434},"    multiSpeakerVoiceConfig",{"type":77,"tag":148,"props":13436,"children":13437},{"style":171},[13438],{"type":83,"value":306},{"type":77,"tag":148,"props":13440,"children":13441},{"style":171},[13442],{"type":83,"value":322},{"type":77,"tag":148,"props":13444,"children":13445},{"class":150,"line":325},[13446,13451,13455],{"type":77,"tag":148,"props":13447,"children":13448},{"style":390},[13449],{"type":83,"value":13450},"      speakerVoiceConfigs",{"type":77,"tag":148,"props":13452,"children":13453},{"style":171},[13454],{"type":83,"value":306},{"type":77,"tag":148,"props":13456,"children":13457},{"style":177},[13458],{"type":83,"value":3689},{"type":77,"tag":148,"props":13460,"children":13461},{"class":150,"line":396},[13462],{"type":77,"tag":148,"props":13463,"children":13464},{"style":171},[13465],{"type":83,"value":13466},"        {\n",{"type":77,"tag":148,"props":13468,"children":13469},{"class":150,"line":404},[13470,13475,13479,13483,13488,13492],{"type":77,"tag":148,"props":13471,"children":13472},{"style":390},[13473],{"type":83,"value":13474},"          speaker",{"type":77,"tag":148,"props":13476,"children":13477},{"style":171},[13478],{"type":83,"value":306},{"type":77,"tag":148,"props":13480,"children":13481},{"style":171},[13482],{"type":83,"value":205},{"type":77,"tag":148,"props":13484,"children":13485},{"style":208},[13486],{"type":83,"value":13487},"Alice",{"type":77,"tag":148,"props":13489,"children":13490},{"style":171},[13491],{"type":83,"value":457},{"type":77,"tag":148,"props":13493,"children":13494},{"style":171},[13495],{"type":83,"value":475},{"type":77,"tag":148,"props":13497,"children":13498},{"class":150,"line":434},[13499,13504,13508,13512,13517,13521,13525,13530,13534,13538,13543,13547,13551],{"type":77,"tag":148,"props":13500,"children":13501},{"style":390},[13502],{"type":83,"value":13503},"          voiceConfig",{"type":77,"tag":148,"props":13505,"children":13506},{"style":171},[13507],{"type":83,"value":306},{"type":77,"tag":148,"props":13509,"children":13510},{"style":171},[13511],{"type":83,"value":174},{"type":77,"tag":148,"props":13513,"children":13514},{"style":390},[13515],{"type":83,"value":13516}," prebuiltVoiceConfig",{"type":77,"tag":148,"props":13518,"children":13519},{"style":171},[13520],{"type":83,"value":306},{"type":77,"tag":148,"props":13522,"children":13523},{"style":171},[13524],{"type":83,"value":174},{"type":77,"tag":148,"props":13526,"children":13527},{"style":390},[13528],{"type":83,"value":13529}," voiceName",{"type":77,"tag":148,"props":13531,"children":13532},{"style":171},[13533],{"type":83,"value":306},{"type":77,"tag":148,"props":13535,"children":13536},{"style":171},[13537],{"type":83,"value":205},{"type":77,"tag":148,"props":13539,"children":13540},{"style":208},[13541],{"type":83,"value":13542},"Kore",{"type":77,"tag":148,"props":13544,"children":13545},{"style":171},[13546],{"type":83,"value":457},{"type":77,"tag":148,"props":13548,"children":13549},{"style":171},[13550],{"type":83,"value":195},{"type":77,"tag":148,"props":13552,"children":13553},{"style":171},[13554],{"type":83,"value":3377},{"type":77,"tag":148,"props":13556,"children":13557},{"class":150,"line":478},[13558],{"type":77,"tag":148,"props":13559,"children":13560},{"style":171},[13561],{"type":83,"value":13562},"        },\n",{"type":77,"tag":148,"props":13564,"children":13565},{"class":150,"line":491},[13566],{"type":77,"tag":148,"props":13567,"children":13568},{"style":171},[13569],{"type":83,"value":13466},{"type":77,"tag":148,"props":13571,"children":13572},{"class":150,"line":504},[13573,13577,13581,13585,13590,13594],{"type":77,"tag":148,"props":13574,"children":13575},{"style":390},[13576],{"type":83,"value":13474},{"type":77,"tag":148,"props":13578,"children":13579},{"style":171},[13580],{"type":83,"value":306},{"type":77,"tag":148,"props":13582,"children":13583},{"style":171},[13584],{"type":83,"value":205},{"type":77,"tag":148,"props":13586,"children":13587},{"style":208},[13588],{"type":83,"value":13589},"Bob",{"type":77,"tag":148,"props":13591,"children":13592},{"style":171},[13593],{"type":83,"value":457},{"type":77,"tag":148,"props":13595,"children":13596},{"style":171},[13597],{"type":83,"value":475},{"type":77,"tag":148,"props":13599,"children":13600},{"class":150,"line":517},[13601,13605,13609,13613,13617,13621,13625,13629,13633,13637,13642,13646,13650],{"type":77,"tag":148,"props":13602,"children":13603},{"style":390},[13604],{"type":83,"value":13503},{"type":77,"tag":148,"props":13606,"children":13607},{"style":171},[13608],{"type":83,"value":306},{"type":77,"tag":148,"props":13610,"children":13611},{"style":171},[13612],{"type":83,"value":174},{"type":77,"tag":148,"props":13614,"children":13615},{"style":390},[13616],{"type":83,"value":13516},{"type":77,"tag":148,"props":13618,"children":13619},{"style":171},[13620],{"type":83,"value":306},{"type":77,"tag":148,"props":13622,"children":13623},{"style":171},[13624],{"type":83,"value":174},{"type":77,"tag":148,"props":13626,"children":13627},{"style":390},[13628],{"type":83,"value":13529},{"type":77,"tag":148,"props":13630,"children":13631},{"style":171},[13632],{"type":83,"value":306},{"type":77,"tag":148,"props":13634,"children":13635},{"style":171},[13636],{"type":83,"value":205},{"type":77,"tag":148,"props":13638,"children":13639},{"style":208},[13640],{"type":83,"value":13641},"Puck",{"type":77,"tag":148,"props":13643,"children":13644},{"style":171},[13645],{"type":83,"value":457},{"type":77,"tag":148,"props":13647,"children":13648},{"style":171},[13649],{"type":83,"value":195},{"type":77,"tag":148,"props":13651,"children":13652},{"style":171},[13653],{"type":83,"value":3377},{"type":77,"tag":148,"props":13655,"children":13656},{"class":150,"line":540},[13657],{"type":77,"tag":148,"props":13658,"children":13659},{"style":171},[13660],{"type":83,"value":13562},{"type":77,"tag":148,"props":13662,"children":13663},{"class":150,"line":554},[13664,13669],{"type":77,"tag":148,"props":13665,"children":13666},{"style":177},[13667],{"type":83,"value":13668},"      ]",{"type":77,"tag":148,"props":13670,"children":13671},{"style":171},[13672],{"type":83,"value":475},{"type":77,"tag":148,"props":13674,"children":13675},{"class":150,"line":562},[13676],{"type":77,"tag":148,"props":13677,"children":13678},{"style":171},[13679],{"type":83,"value":4612},{"type":77,"tag":148,"props":13681,"children":13682},{"class":150,"line":588},[13683],{"type":77,"tag":148,"props":13684,"children":13685},{"style":171},[13686],{"type":83,"value":3055},{"type":77,"tag":148,"props":13688,"children":13689},{"class":150,"line":1076},[13690,13694],{"type":77,"tag":148,"props":13691,"children":13692},{"style":171},[13693],{"type":83,"value":1114},{"type":77,"tag":148,"props":13695,"children":13696},{"style":177},[13697],{"type":83,"value":551},{"type":77,"tag":86,"props":13699,"children":13700},{},[13701],{"type":77,"tag":90,"props":13702,"children":13703},{},[13704],{"type":83,"value":13705},"Source: Gemini TTS adapter validation; CodeRabbit review of PR #463.",{"type":77,"tag":131,"props":13707,"children":13709},{"id":13708},"h-high-passing-image-prompt-parts-to-a-model-that-doesnt-support-image-conditioned-generation",[13710],{"type":83,"value":13711},"h. HIGH: Passing image prompt parts to a model that doesn't support image-conditioned generation",{"type":77,"tag":90,"props":13713,"children":13714},{},[13715,13717,13722,13724,13729],{"type":83,"value":13716},"Not every model accepts image-conditioned prompts. The ",{"type":77,"tag":107,"props":13718,"children":13720},{"className":13719},[],[13721],{"type":83,"value":737},{"type":83,"value":13723}," type is\nnarrowed per model, so passing an image part to a text-only model\n(dall-e-3, Imagen, grok-2-image) is a ",{"type":77,"tag":94,"props":13725,"children":13726},{},[13727],{"type":83,"value":13728},"compile-time error",{"type":83,"value":13730},"; adapters\nalso throw a clear runtime error as a backstop, so users learn at call\ntime rather than getting silently wrong output.",{"type":77,"tag":138,"props":13732,"children":13734},{"className":140,"code":13733,"language":51,"meta":142,"style":142},"\u002F\u002F WRONG — dall-e-3 has no edit\u002Finputs API; image parts are a type error\ngenerateImage({\n  adapter: openaiImage('dall-e-3'),\n  prompt: [\n    { type: 'text', content: 'Edit this' },\n    { type: 'image', source: { type: 'url', value: url } }, \u002F\u002F ❌ type error\n  ],\n})\n\n\u002F\u002F WRONG — Imagen is text-to-image only; same compile-time rejection\ngenerateImage({\n  adapter: geminiImage('imagen-4.0-generate-001'),\n  prompt: [\n    { type: 'text', content: 'Edit this' },\n    { type: 'image', source: { type: 'url', value: url } }, \u002F\u002F ❌ type error\n  ],\n})\n\n\u002F\u002F CORRECT — use a model that supports image-conditioned generation\ngenerateImage({\n  adapter: openaiImage('gpt-image-2'), \u002F\u002F edits up to 16 images\n  prompt: [\n    { type: 'text', content: 'Edit this' },\n    { type: 'image', source: { type: 'url', value: url } },\n  ],\n})\n\ngenerateImage({\n  adapter: geminiImage('gemini-3.1-flash-image-preview'), \u002F\u002F native multimodal\n  prompt: [\n    { type: 'text', content: 'Edit this' },\n    { type: 'image', source: { type: 'url', value: url } },\n  ],\n})\n",[13735],{"type":77,"tag":107,"props":13736,"children":13737},{"__ignoreMap":142},[13738,13746,13761,13800,13815,13871,13965,13976,13987,13994,14002,14017,14056,14071,14126,14217,14228,14239,14246,14254,14269,14313,14328,14383,14470,14481,14492,14499,14514,14558,14573,14628,14715,14726],{"type":77,"tag":148,"props":13739,"children":13740},{"class":150,"line":151},[13741],{"type":77,"tag":148,"props":13742,"children":13743},{"style":155},[13744],{"type":83,"value":13745},"\u002F\u002F WRONG — dall-e-3 has no edit\u002Finputs API; image parts are a type error\n",{"type":77,"tag":148,"props":13747,"children":13748},{"class":150,"line":161},[13749,13753,13757],{"type":77,"tag":148,"props":13750,"children":13751},{"style":287},[13752],{"type":83,"value":5502},{"type":77,"tag":148,"props":13754,"children":13755},{"style":177},[13756],{"type":83,"value":295},{"type":77,"tag":148,"props":13758,"children":13759},{"style":171},[13760],{"type":83,"value":431},{"type":77,"tag":148,"props":13762,"children":13763},{"class":150,"line":219},[13764,13768,13772,13776,13780,13784,13788,13792,13796],{"type":77,"tag":148,"props":13765,"children":13766},{"style":390},[13767],{"type":83,"value":2832},{"type":77,"tag":148,"props":13769,"children":13770},{"style":171},[13771],{"type":83,"value":306},{"type":77,"tag":148,"props":13773,"children":13774},{"style":287},[13775],{"type":83,"value":233},{"type":77,"tag":148,"props":13777,"children":13778},{"style":177},[13779],{"type":83,"value":295},{"type":77,"tag":148,"props":13781,"children":13782},{"style":171},[13783],{"type":83,"value":457},{"type":77,"tag":148,"props":13785,"children":13786},{"style":208},[13787],{"type":83,"value":12187},{"type":77,"tag":148,"props":13789,"children":13790},{"style":171},[13791],{"type":83,"value":457},{"type":77,"tag":148,"props":13793,"children":13794},{"style":177},[13795],{"type":83,"value":317},{"type":77,"tag":148,"props":13797,"children":13798},{"style":171},[13799],{"type":83,"value":475},{"type":77,"tag":148,"props":13801,"children":13802},{"class":150,"line":257},[13803,13807,13811],{"type":77,"tag":148,"props":13804,"children":13805},{"style":390},[13806],{"type":83,"value":2872},{"type":77,"tag":148,"props":13808,"children":13809},{"style":171},[13810],{"type":83,"value":306},{"type":77,"tag":148,"props":13812,"children":13813},{"style":177},[13814],{"type":83,"value":3689},{"type":77,"tag":148,"props":13816,"children":13817},{"class":150,"line":267},[13818,13822,13826,13830,13834,13838,13842,13846,13850,13854,13858,13863,13867],{"type":77,"tag":148,"props":13819,"children":13820},{"style":171},[13821],{"type":83,"value":3697},{"type":77,"tag":148,"props":13823,"children":13824},{"style":390},[13825],{"type":83,"value":3702},{"type":77,"tag":148,"props":13827,"children":13828},{"style":171},[13829],{"type":83,"value":306},{"type":77,"tag":148,"props":13831,"children":13832},{"style":171},[13833],{"type":83,"value":205},{"type":77,"tag":148,"props":13835,"children":13836},{"style":208},[13837],{"type":83,"value":83},{"type":77,"tag":148,"props":13839,"children":13840},{"style":171},[13841],{"type":83,"value":457},{"type":77,"tag":148,"props":13843,"children":13844},{"style":171},[13845],{"type":83,"value":185},{"type":77,"tag":148,"props":13847,"children":13848},{"style":390},[13849],{"type":83,"value":3727},{"type":77,"tag":148,"props":13851,"children":13852},{"style":171},[13853],{"type":83,"value":306},{"type":77,"tag":148,"props":13855,"children":13856},{"style":171},[13857],{"type":83,"value":205},{"type":77,"tag":148,"props":13859,"children":13860},{"style":208},[13861],{"type":83,"value":13862},"Edit this",{"type":77,"tag":148,"props":13864,"children":13865},{"style":171},[13866],{"type":83,"value":457},{"type":77,"tag":148,"props":13868,"children":13869},{"style":171},[13870],{"type":83,"value":3377},{"type":77,"tag":148,"props":13872,"children":13873},{"class":150,"line":325},[13874,13878,13882,13886,13890,13894,13898,13902,13906,13910,13914,13918,13922,13926,13930,13934,13938,13942,13946,13951,13955,13960],{"type":77,"tag":148,"props":13875,"children":13876},{"style":171},[13877],{"type":83,"value":3697},{"type":77,"tag":148,"props":13879,"children":13880},{"style":390},[13881],{"type":83,"value":3702},{"type":77,"tag":148,"props":13883,"children":13884},{"style":171},[13885],{"type":83,"value":306},{"type":77,"tag":148,"props":13887,"children":13888},{"style":171},[13889],{"type":83,"value":205},{"type":77,"tag":148,"props":13891,"children":13892},{"style":208},[13893],{"type":83,"value":3772},{"type":77,"tag":148,"props":13895,"children":13896},{"style":171},[13897],{"type":83,"value":457},{"type":77,"tag":148,"props":13899,"children":13900},{"style":171},[13901],{"type":83,"value":185},{"type":77,"tag":148,"props":13903,"children":13904},{"style":390},[13905],{"type":83,"value":3785},{"type":77,"tag":148,"props":13907,"children":13908},{"style":171},[13909],{"type":83,"value":306},{"type":77,"tag":148,"props":13911,"children":13912},{"style":171},[13913],{"type":83,"value":174},{"type":77,"tag":148,"props":13915,"children":13916},{"style":390},[13917],{"type":83,"value":3702},{"type":77,"tag":148,"props":13919,"children":13920},{"style":171},[13921],{"type":83,"value":306},{"type":77,"tag":148,"props":13923,"children":13924},{"style":171},[13925],{"type":83,"value":205},{"type":77,"tag":148,"props":13927,"children":13928},{"style":208},[13929],{"type":83,"value":3810},{"type":77,"tag":148,"props":13931,"children":13932},{"style":171},[13933],{"type":83,"value":457},{"type":77,"tag":148,"props":13935,"children":13936},{"style":171},[13937],{"type":83,"value":185},{"type":77,"tag":148,"props":13939,"children":13940},{"style":390},[13941],{"type":83,"value":3823},{"type":77,"tag":148,"props":13943,"children":13944},{"style":171},[13945],{"type":83,"value":306},{"type":77,"tag":148,"props":13947,"children":13948},{"style":177},[13949],{"type":83,"value":13950}," url ",{"type":77,"tag":148,"props":13952,"children":13953},{"style":171},[13954],{"type":83,"value":1114},{"type":77,"tag":148,"props":13956,"children":13957},{"style":171},[13958],{"type":83,"value":13959}," },",{"type":77,"tag":148,"props":13961,"children":13962},{"style":155},[13963],{"type":83,"value":13964}," \u002F\u002F ❌ type error\n",{"type":77,"tag":148,"props":13966,"children":13967},{"class":150,"line":396},[13968,13972],{"type":77,"tag":148,"props":13969,"children":13970},{"style":177},[13971],{"type":83,"value":3856},{"type":77,"tag":148,"props":13973,"children":13974},{"style":171},[13975],{"type":83,"value":475},{"type":77,"tag":148,"props":13977,"children":13978},{"class":150,"line":404},[13979,13983],{"type":77,"tag":148,"props":13980,"children":13981},{"style":171},[13982],{"type":83,"value":1114},{"type":77,"tag":148,"props":13984,"children":13985},{"style":177},[13986],{"type":83,"value":551},{"type":77,"tag":148,"props":13988,"children":13989},{"class":150,"line":434},[13990],{"type":77,"tag":148,"props":13991,"children":13992},{"emptyLinePlaceholder":261},[13993],{"type":83,"value":264},{"type":77,"tag":148,"props":13995,"children":13996},{"class":150,"line":478},[13997],{"type":77,"tag":148,"props":13998,"children":13999},{"style":155},[14000],{"type":83,"value":14001},"\u002F\u002F WRONG — Imagen is text-to-image only; same compile-time rejection\n",{"type":77,"tag":148,"props":14003,"children":14004},{"class":150,"line":491},[14005,14009,14013],{"type":77,"tag":148,"props":14006,"children":14007},{"style":287},[14008],{"type":83,"value":5502},{"type":77,"tag":148,"props":14010,"children":14011},{"style":177},[14012],{"type":83,"value":295},{"type":77,"tag":148,"props":14014,"children":14015},{"style":171},[14016],{"type":83,"value":431},{"type":77,"tag":148,"props":14018,"children":14019},{"class":150,"line":504},[14020,14024,14028,14032,14036,14040,14044,14048,14052],{"type":77,"tag":148,"props":14021,"children":14022},{"style":390},[14023],{"type":83,"value":2832},{"type":77,"tag":148,"props":14025,"children":14026},{"style":171},[14027],{"type":83,"value":306},{"type":77,"tag":148,"props":14029,"children":14030},{"style":287},[14031],{"type":83,"value":2755},{"type":77,"tag":148,"props":14033,"children":14034},{"style":177},[14035],{"type":83,"value":295},{"type":77,"tag":148,"props":14037,"children":14038},{"style":171},[14039],{"type":83,"value":457},{"type":77,"tag":148,"props":14041,"children":14042},{"style":208},[14043],{"type":83,"value":3295},{"type":77,"tag":148,"props":14045,"children":14046},{"style":171},[14047],{"type":83,"value":457},{"type":77,"tag":148,"props":14049,"children":14050},{"style":177},[14051],{"type":83,"value":317},{"type":77,"tag":148,"props":14053,"children":14054},{"style":171},[14055],{"type":83,"value":475},{"type":77,"tag":148,"props":14057,"children":14058},{"class":150,"line":517},[14059,14063,14067],{"type":77,"tag":148,"props":14060,"children":14061},{"style":390},[14062],{"type":83,"value":2872},{"type":77,"tag":148,"props":14064,"children":14065},{"style":171},[14066],{"type":83,"value":306},{"type":77,"tag":148,"props":14068,"children":14069},{"style":177},[14070],{"type":83,"value":3689},{"type":77,"tag":148,"props":14072,"children":14073},{"class":150,"line":540},[14074,14078,14082,14086,14090,14094,14098,14102,14106,14110,14114,14118,14122],{"type":77,"tag":148,"props":14075,"children":14076},{"style":171},[14077],{"type":83,"value":3697},{"type":77,"tag":148,"props":14079,"children":14080},{"style":390},[14081],{"type":83,"value":3702},{"type":77,"tag":148,"props":14083,"children":14084},{"style":171},[14085],{"type":83,"value":306},{"type":77,"tag":148,"props":14087,"children":14088},{"style":171},[14089],{"type":83,"value":205},{"type":77,"tag":148,"props":14091,"children":14092},{"style":208},[14093],{"type":83,"value":83},{"type":77,"tag":148,"props":14095,"children":14096},{"style":171},[14097],{"type":83,"value":457},{"type":77,"tag":148,"props":14099,"children":14100},{"style":171},[14101],{"type":83,"value":185},{"type":77,"tag":148,"props":14103,"children":14104},{"style":390},[14105],{"type":83,"value":3727},{"type":77,"tag":148,"props":14107,"children":14108},{"style":171},[14109],{"type":83,"value":306},{"type":77,"tag":148,"props":14111,"children":14112},{"style":171},[14113],{"type":83,"value":205},{"type":77,"tag":148,"props":14115,"children":14116},{"style":208},[14117],{"type":83,"value":13862},{"type":77,"tag":148,"props":14119,"children":14120},{"style":171},[14121],{"type":83,"value":457},{"type":77,"tag":148,"props":14123,"children":14124},{"style":171},[14125],{"type":83,"value":3377},{"type":77,"tag":148,"props":14127,"children":14128},{"class":150,"line":554},[14129,14133,14137,14141,14145,14149,14153,14157,14161,14165,14169,14173,14177,14181,14185,14189,14193,14197,14201,14205,14209,14213],{"type":77,"tag":148,"props":14130,"children":14131},{"style":171},[14132],{"type":83,"value":3697},{"type":77,"tag":148,"props":14134,"children":14135},{"style":390},[14136],{"type":83,"value":3702},{"type":77,"tag":148,"props":14138,"children":14139},{"style":171},[14140],{"type":83,"value":306},{"type":77,"tag":148,"props":14142,"children":14143},{"style":171},[14144],{"type":83,"value":205},{"type":77,"tag":148,"props":14146,"children":14147},{"style":208},[14148],{"type":83,"value":3772},{"type":77,"tag":148,"props":14150,"children":14151},{"style":171},[14152],{"type":83,"value":457},{"type":77,"tag":148,"props":14154,"children":14155},{"style":171},[14156],{"type":83,"value":185},{"type":77,"tag":148,"props":14158,"children":14159},{"style":390},[14160],{"type":83,"value":3785},{"type":77,"tag":148,"props":14162,"children":14163},{"style":171},[14164],{"type":83,"value":306},{"type":77,"tag":148,"props":14166,"children":14167},{"style":171},[14168],{"type":83,"value":174},{"type":77,"tag":148,"props":14170,"children":14171},{"style":390},[14172],{"type":83,"value":3702},{"type":77,"tag":148,"props":14174,"children":14175},{"style":171},[14176],{"type":83,"value":306},{"type":77,"tag":148,"props":14178,"children":14179},{"style":171},[14180],{"type":83,"value":205},{"type":77,"tag":148,"props":14182,"children":14183},{"style":208},[14184],{"type":83,"value":3810},{"type":77,"tag":148,"props":14186,"children":14187},{"style":171},[14188],{"type":83,"value":457},{"type":77,"tag":148,"props":14190,"children":14191},{"style":171},[14192],{"type":83,"value":185},{"type":77,"tag":148,"props":14194,"children":14195},{"style":390},[14196],{"type":83,"value":3823},{"type":77,"tag":148,"props":14198,"children":14199},{"style":171},[14200],{"type":83,"value":306},{"type":77,"tag":148,"props":14202,"children":14203},{"style":177},[14204],{"type":83,"value":13950},{"type":77,"tag":148,"props":14206,"children":14207},{"style":171},[14208],{"type":83,"value":1114},{"type":77,"tag":148,"props":14210,"children":14211},{"style":171},[14212],{"type":83,"value":13959},{"type":77,"tag":148,"props":14214,"children":14215},{"style":155},[14216],{"type":83,"value":13964},{"type":77,"tag":148,"props":14218,"children":14219},{"class":150,"line":562},[14220,14224],{"type":77,"tag":148,"props":14221,"children":14222},{"style":177},[14223],{"type":83,"value":3856},{"type":77,"tag":148,"props":14225,"children":14226},{"style":171},[14227],{"type":83,"value":475},{"type":77,"tag":148,"props":14229,"children":14230},{"class":150,"line":588},[14231,14235],{"type":77,"tag":148,"props":14232,"children":14233},{"style":171},[14234],{"type":83,"value":1114},{"type":77,"tag":148,"props":14236,"children":14237},{"style":177},[14238],{"type":83,"value":551},{"type":77,"tag":148,"props":14240,"children":14241},{"class":150,"line":1076},[14242],{"type":77,"tag":148,"props":14243,"children":14244},{"emptyLinePlaceholder":261},[14245],{"type":83,"value":264},{"type":77,"tag":148,"props":14247,"children":14248},{"class":150,"line":1125},[14249],{"type":77,"tag":148,"props":14250,"children":14251},{"style":155},[14252],{"type":83,"value":14253},"\u002F\u002F CORRECT — use a model that supports image-conditioned generation\n",{"type":77,"tag":148,"props":14255,"children":14256},{"class":150,"line":1174},[14257,14261,14265],{"type":77,"tag":148,"props":14258,"children":14259},{"style":287},[14260],{"type":83,"value":5502},{"type":77,"tag":148,"props":14262,"children":14263},{"style":177},[14264],{"type":83,"value":295},{"type":77,"tag":148,"props":14266,"children":14267},{"style":171},[14268],{"type":83,"value":431},{"type":77,"tag":148,"props":14270,"children":14271},{"class":150,"line":1183},[14272,14276,14280,14284,14288,14292,14296,14300,14304,14308],{"type":77,"tag":148,"props":14273,"children":14274},{"style":390},[14275],{"type":83,"value":2832},{"type":77,"tag":148,"props":14277,"children":14278},{"style":171},[14279],{"type":83,"value":306},{"type":77,"tag":148,"props":14281,"children":14282},{"style":287},[14283],{"type":83,"value":233},{"type":77,"tag":148,"props":14285,"children":14286},{"style":177},[14287],{"type":83,"value":295},{"type":77,"tag":148,"props":14289,"children":14290},{"style":171},[14291],{"type":83,"value":457},{"type":77,"tag":148,"props":14293,"children":14294},{"style":208},[14295],{"type":83,"value":3661},{"type":77,"tag":148,"props":14297,"children":14298},{"style":171},[14299],{"type":83,"value":457},{"type":77,"tag":148,"props":14301,"children":14302},{"style":177},[14303],{"type":83,"value":317},{"type":77,"tag":148,"props":14305,"children":14306},{"style":171},[14307],{"type":83,"value":185},{"type":77,"tag":148,"props":14309,"children":14310},{"style":155},[14311],{"type":83,"value":14312}," \u002F\u002F edits up to 16 images\n",{"type":77,"tag":148,"props":14314,"children":14315},{"class":150,"line":1236},[14316,14320,14324],{"type":77,"tag":148,"props":14317,"children":14318},{"style":390},[14319],{"type":83,"value":2872},{"type":77,"tag":148,"props":14321,"children":14322},{"style":171},[14323],{"type":83,"value":306},{"type":77,"tag":148,"props":14325,"children":14326},{"style":177},[14327],{"type":83,"value":3689},{"type":77,"tag":148,"props":14329,"children":14330},{"class":150,"line":1254},[14331,14335,14339,14343,14347,14351,14355,14359,14363,14367,14371,14375,14379],{"type":77,"tag":148,"props":14332,"children":14333},{"style":171},[14334],{"type":83,"value":3697},{"type":77,"tag":148,"props":14336,"children":14337},{"style":390},[14338],{"type":83,"value":3702},{"type":77,"tag":148,"props":14340,"children":14341},{"style":171},[14342],{"type":83,"value":306},{"type":77,"tag":148,"props":14344,"children":14345},{"style":171},[14346],{"type":83,"value":205},{"type":77,"tag":148,"props":14348,"children":14349},{"style":208},[14350],{"type":83,"value":83},{"type":77,"tag":148,"props":14352,"children":14353},{"style":171},[14354],{"type":83,"value":457},{"type":77,"tag":148,"props":14356,"children":14357},{"style":171},[14358],{"type":83,"value":185},{"type":77,"tag":148,"props":14360,"children":14361},{"style":390},[14362],{"type":83,"value":3727},{"type":77,"tag":148,"props":14364,"children":14365},{"style":171},[14366],{"type":83,"value":306},{"type":77,"tag":148,"props":14368,"children":14369},{"style":171},[14370],{"type":83,"value":205},{"type":77,"tag":148,"props":14372,"children":14373},{"style":208},[14374],{"type":83,"value":13862},{"type":77,"tag":148,"props":14376,"children":14377},{"style":171},[14378],{"type":83,"value":457},{"type":77,"tag":148,"props":14380,"children":14381},{"style":171},[14382],{"type":83,"value":3377},{"type":77,"tag":148,"props":14384,"children":14385},{"class":150,"line":1262},[14386,14390,14394,14398,14402,14406,14410,14414,14418,14422,14426,14430,14434,14438,14442,14446,14450,14454,14458,14462,14466],{"type":77,"tag":148,"props":14387,"children":14388},{"style":171},[14389],{"type":83,"value":3697},{"type":77,"tag":148,"props":14391,"children":14392},{"style":390},[14393],{"type":83,"value":3702},{"type":77,"tag":148,"props":14395,"children":14396},{"style":171},[14397],{"type":83,"value":306},{"type":77,"tag":148,"props":14399,"children":14400},{"style":171},[14401],{"type":83,"value":205},{"type":77,"tag":148,"props":14403,"children":14404},{"style":208},[14405],{"type":83,"value":3772},{"type":77,"tag":148,"props":14407,"children":14408},{"style":171},[14409],{"type":83,"value":457},{"type":77,"tag":148,"props":14411,"children":14412},{"style":171},[14413],{"type":83,"value":185},{"type":77,"tag":148,"props":14415,"children":14416},{"style":390},[14417],{"type":83,"value":3785},{"type":77,"tag":148,"props":14419,"children":14420},{"style":171},[14421],{"type":83,"value":306},{"type":77,"tag":148,"props":14423,"children":14424},{"style":171},[14425],{"type":83,"value":174},{"type":77,"tag":148,"props":14427,"children":14428},{"style":390},[14429],{"type":83,"value":3702},{"type":77,"tag":148,"props":14431,"children":14432},{"style":171},[14433],{"type":83,"value":306},{"type":77,"tag":148,"props":14435,"children":14436},{"style":171},[14437],{"type":83,"value":205},{"type":77,"tag":148,"props":14439,"children":14440},{"style":208},[14441],{"type":83,"value":3810},{"type":77,"tag":148,"props":14443,"children":14444},{"style":171},[14445],{"type":83,"value":457},{"type":77,"tag":148,"props":14447,"children":14448},{"style":171},[14449],{"type":83,"value":185},{"type":77,"tag":148,"props":14451,"children":14452},{"style":390},[14453],{"type":83,"value":3823},{"type":77,"tag":148,"props":14455,"children":14456},{"style":171},[14457],{"type":83,"value":306},{"type":77,"tag":148,"props":14459,"children":14460},{"style":177},[14461],{"type":83,"value":13950},{"type":77,"tag":148,"props":14463,"children":14464},{"style":171},[14465],{"type":83,"value":1114},{"type":77,"tag":148,"props":14467,"children":14468},{"style":171},[14469],{"type":83,"value":3377},{"type":77,"tag":148,"props":14471,"children":14472},{"class":150,"line":1332},[14473,14477],{"type":77,"tag":148,"props":14474,"children":14475},{"style":177},[14476],{"type":83,"value":3856},{"type":77,"tag":148,"props":14478,"children":14479},{"style":171},[14480],{"type":83,"value":475},{"type":77,"tag":148,"props":14482,"children":14483},{"class":150,"line":1340},[14484,14488],{"type":77,"tag":148,"props":14485,"children":14486},{"style":171},[14487],{"type":83,"value":1114},{"type":77,"tag":148,"props":14489,"children":14490},{"style":177},[14491],{"type":83,"value":551},{"type":77,"tag":148,"props":14493,"children":14494},{"class":150,"line":1405},[14495],{"type":77,"tag":148,"props":14496,"children":14497},{"emptyLinePlaceholder":261},[14498],{"type":83,"value":264},{"type":77,"tag":148,"props":14500,"children":14501},{"class":150,"line":1419},[14502,14506,14510],{"type":77,"tag":148,"props":14503,"children":14504},{"style":287},[14505],{"type":83,"value":5502},{"type":77,"tag":148,"props":14507,"children":14508},{"style":177},[14509],{"type":83,"value":295},{"type":77,"tag":148,"props":14511,"children":14512},{"style":171},[14513],{"type":83,"value":431},{"type":77,"tag":148,"props":14515,"children":14516},{"class":150,"line":1441},[14517,14521,14525,14529,14533,14537,14541,14545,14549,14553],{"type":77,"tag":148,"props":14518,"children":14519},{"style":390},[14520],{"type":83,"value":2832},{"type":77,"tag":148,"props":14522,"children":14523},{"style":171},[14524],{"type":83,"value":306},{"type":77,"tag":148,"props":14526,"children":14527},{"style":287},[14528],{"type":83,"value":2755},{"type":77,"tag":148,"props":14530,"children":14531},{"style":177},[14532],{"type":83,"value":295},{"type":77,"tag":148,"props":14534,"children":14535},{"style":171},[14536],{"type":83,"value":457},{"type":77,"tag":148,"props":14538,"children":14539},{"style":208},[14540],{"type":83,"value":3141},{"type":77,"tag":148,"props":14542,"children":14543},{"style":171},[14544],{"type":83,"value":457},{"type":77,"tag":148,"props":14546,"children":14547},{"style":177},[14548],{"type":83,"value":317},{"type":77,"tag":148,"props":14550,"children":14551},{"style":171},[14552],{"type":83,"value":185},{"type":77,"tag":148,"props":14554,"children":14555},{"style":155},[14556],{"type":83,"value":14557}," \u002F\u002F native multimodal\n",{"type":77,"tag":148,"props":14559,"children":14560},{"class":150,"line":1508},[14561,14565,14569],{"type":77,"tag":148,"props":14562,"children":14563},{"style":390},[14564],{"type":83,"value":2872},{"type":77,"tag":148,"props":14566,"children":14567},{"style":171},[14568],{"type":83,"value":306},{"type":77,"tag":148,"props":14570,"children":14571},{"style":177},[14572],{"type":83,"value":3689},{"type":77,"tag":148,"props":14574,"children":14575},{"class":150,"line":1555},[14576,14580,14584,14588,14592,14596,14600,14604,14608,14612,14616,14620,14624],{"type":77,"tag":148,"props":14577,"children":14578},{"style":171},[14579],{"type":83,"value":3697},{"type":77,"tag":148,"props":14581,"children":14582},{"style":390},[14583],{"type":83,"value":3702},{"type":77,"tag":148,"props":14585,"children":14586},{"style":171},[14587],{"type":83,"value":306},{"type":77,"tag":148,"props":14589,"children":14590},{"style":171},[14591],{"type":83,"value":205},{"type":77,"tag":148,"props":14593,"children":14594},{"style":208},[14595],{"type":83,"value":83},{"type":77,"tag":148,"props":14597,"children":14598},{"style":171},[14599],{"type":83,"value":457},{"type":77,"tag":148,"props":14601,"children":14602},{"style":171},[14603],{"type":83,"value":185},{"type":77,"tag":148,"props":14605,"children":14606},{"style":390},[14607],{"type":83,"value":3727},{"type":77,"tag":148,"props":14609,"children":14610},{"style":171},[14611],{"type":83,"value":306},{"type":77,"tag":148,"props":14613,"children":14614},{"style":171},[14615],{"type":83,"value":205},{"type":77,"tag":148,"props":14617,"children":14618},{"style":208},[14619],{"type":83,"value":13862},{"type":77,"tag":148,"props":14621,"children":14622},{"style":171},[14623],{"type":83,"value":457},{"type":77,"tag":148,"props":14625,"children":14626},{"style":171},[14627],{"type":83,"value":3377},{"type":77,"tag":148,"props":14629,"children":14630},{"class":150,"line":1564},[14631,14635,14639,14643,14647,14651,14655,14659,14663,14667,14671,14675,14679,14683,14687,14691,14695,14699,14703,14707,14711],{"type":77,"tag":148,"props":14632,"children":14633},{"style":171},[14634],{"type":83,"value":3697},{"type":77,"tag":148,"props":14636,"children":14637},{"style":390},[14638],{"type":83,"value":3702},{"type":77,"tag":148,"props":14640,"children":14641},{"style":171},[14642],{"type":83,"value":306},{"type":77,"tag":148,"props":14644,"children":14645},{"style":171},[14646],{"type":83,"value":205},{"type":77,"tag":148,"props":14648,"children":14649},{"style":208},[14650],{"type":83,"value":3772},{"type":77,"tag":148,"props":14652,"children":14653},{"style":171},[14654],{"type":83,"value":457},{"type":77,"tag":148,"props":14656,"children":14657},{"style":171},[14658],{"type":83,"value":185},{"type":77,"tag":148,"props":14660,"children":14661},{"style":390},[14662],{"type":83,"value":3785},{"type":77,"tag":148,"props":14664,"children":14665},{"style":171},[14666],{"type":83,"value":306},{"type":77,"tag":148,"props":14668,"children":14669},{"style":171},[14670],{"type":83,"value":174},{"type":77,"tag":148,"props":14672,"children":14673},{"style":390},[14674],{"type":83,"value":3702},{"type":77,"tag":148,"props":14676,"children":14677},{"style":171},[14678],{"type":83,"value":306},{"type":77,"tag":148,"props":14680,"children":14681},{"style":171},[14682],{"type":83,"value":205},{"type":77,"tag":148,"props":14684,"children":14685},{"style":208},[14686],{"type":83,"value":3810},{"type":77,"tag":148,"props":14688,"children":14689},{"style":171},[14690],{"type":83,"value":457},{"type":77,"tag":148,"props":14692,"children":14693},{"style":171},[14694],{"type":83,"value":185},{"type":77,"tag":148,"props":14696,"children":14697},{"style":390},[14698],{"type":83,"value":3823},{"type":77,"tag":148,"props":14700,"children":14701},{"style":171},[14702],{"type":83,"value":306},{"type":77,"tag":148,"props":14704,"children":14705},{"style":177},[14706],{"type":83,"value":13950},{"type":77,"tag":148,"props":14708,"children":14709},{"style":171},[14710],{"type":83,"value":1114},{"type":77,"tag":148,"props":14712,"children":14713},{"style":171},[14714],{"type":83,"value":3377},{"type":77,"tag":148,"props":14716,"children":14717},{"class":150,"line":1577},[14718,14722],{"type":77,"tag":148,"props":14719,"children":14720},{"style":177},[14721],{"type":83,"value":3856},{"type":77,"tag":148,"props":14723,"children":14724},{"style":171},[14725],{"type":83,"value":475},{"type":77,"tag":148,"props":14727,"children":14728},{"class":150,"line":1585},[14729,14733],{"type":77,"tag":148,"props":14730,"children":14731},{"style":171},[14732],{"type":83,"value":1114},{"type":77,"tag":148,"props":14734,"children":14735},{"style":177},[14736],{"type":83,"value":551},{"type":77,"tag":86,"props":14738,"children":14739},{},[14740],{"type":77,"tag":90,"props":14741,"children":14742},{},[14743],{"type":83,"value":14744},"Source: docs\u002Fmedia\u002Fimage-generation.md, docs\u002Fmedia\u002Fvideo-generation.md.",{"type":77,"tag":131,"props":14746,"children":14748},{"id":14747},"i-low-writing-a-logging-middleware-to-see-media-chunks-flow-through",[14749],{"type":83,"value":14750},"i. LOW: Writing a logging middleware to see media chunks flow through",{"type":77,"tag":90,"props":14752,"children":14753},{},[14754,14756,14761,14762,14767,14768,14773,14774,14779,14780,14785,14787,14793,14795,14801,14803,14809],{"type":83,"value":14755},"Every media activity — ",{"type":77,"tag":107,"props":14757,"children":14759},{"className":14758},[],[14760],{"type":83,"value":12502},{"type":83,"value":3416},{"type":77,"tag":107,"props":14763,"children":14765},{"className":14764},[],[14766],{"type":83,"value":12509},{"type":83,"value":475},{"type":77,"tag":107,"props":14769,"children":14771},{"className":14770},[],[14772],{"type":83,"value":12516},{"type":83,"value":3416},{"type":77,"tag":107,"props":14775,"children":14777},{"className":14776},[],[14778],{"type":83,"value":5502},{"type":83,"value":3416},{"type":77,"tag":107,"props":14781,"children":14783},{"className":14782},[],[14784],{"type":83,"value":5513},{"type":83,"value":14786}," — accepts the\nsame ",{"type":77,"tag":107,"props":14788,"children":14790},{"className":14789},[],[14791],{"type":83,"value":14792},"debug?: DebugOption",{"type":83,"value":14794}," option that ",{"type":77,"tag":107,"props":14796,"children":14798},{"className":14797},[],[14799],{"type":83,"value":14800},"chat()",{"type":83,"value":14802}," does. Reach for ",{"type":77,"tag":107,"props":14804,"children":14806},{"className":14805},[],[14807],{"type":83,"value":14808},"debug",{"type":83,"value":14810},"\ninstead of wiring up logging middleware.",{"type":77,"tag":138,"props":14812,"children":14814},{"className":140,"code":14813,"language":51,"meta":142,"style":142},"\u002F\u002F When a speech generation sounds wrong or a transcription returns garbage\ngenerateSpeech({\n  adapter: openaiSpeech('tts-1'),\n  text: 'Hello',\n  debug: { provider: true, output: true }, \u002F\u002F raw SDK chunks + yielded chunks\n})\n",[14815],{"type":77,"tag":107,"props":14816,"children":14817},{"__ignoreMap":142},[14818,14826,14841,14881,14909,14964],{"type":77,"tag":148,"props":14819,"children":14820},{"class":150,"line":151},[14821],{"type":77,"tag":148,"props":14822,"children":14823},{"style":155},[14824],{"type":83,"value":14825},"\u002F\u002F When a speech generation sounds wrong or a transcription returns garbage\n",{"type":77,"tag":148,"props":14827,"children":14828},{"class":150,"line":161},[14829,14833,14837],{"type":77,"tag":148,"props":14830,"children":14831},{"style":287},[14832],{"type":83,"value":12509},{"type":77,"tag":148,"props":14834,"children":14835},{"style":177},[14836],{"type":83,"value":295},{"type":77,"tag":148,"props":14838,"children":14839},{"style":171},[14840],{"type":83,"value":431},{"type":77,"tag":148,"props":14842,"children":14843},{"class":150,"line":219},[14844,14848,14852,14856,14860,14864,14869,14873,14877],{"type":77,"tag":148,"props":14845,"children":14846},{"style":390},[14847],{"type":83,"value":2832},{"type":77,"tag":148,"props":14849,"children":14850},{"style":171},[14851],{"type":83,"value":306},{"type":77,"tag":148,"props":14853,"children":14854},{"style":287},[14855],{"type":83,"value":6316},{"type":77,"tag":148,"props":14857,"children":14858},{"style":177},[14859],{"type":83,"value":295},{"type":77,"tag":148,"props":14861,"children":14862},{"style":171},[14863],{"type":83,"value":457},{"type":77,"tag":148,"props":14865,"children":14866},{"style":208},[14867],{"type":83,"value":14868},"tts-1",{"type":77,"tag":148,"props":14870,"children":14871},{"style":171},[14872],{"type":83,"value":457},{"type":77,"tag":148,"props":14874,"children":14875},{"style":177},[14876],{"type":83,"value":317},{"type":77,"tag":148,"props":14878,"children":14879},{"style":171},[14880],{"type":83,"value":475},{"type":77,"tag":148,"props":14882,"children":14883},{"class":150,"line":257},[14884,14888,14892,14896,14901,14905],{"type":77,"tag":148,"props":14885,"children":14886},{"style":390},[14887],{"type":83,"value":6422},{"type":77,"tag":148,"props":14889,"children":14890},{"style":171},[14891],{"type":83,"value":306},{"type":77,"tag":148,"props":14893,"children":14894},{"style":171},[14895],{"type":83,"value":205},{"type":77,"tag":148,"props":14897,"children":14898},{"style":208},[14899],{"type":83,"value":14900},"Hello",{"type":77,"tag":148,"props":14902,"children":14903},{"style":171},[14904],{"type":83,"value":457},{"type":77,"tag":148,"props":14906,"children":14907},{"style":171},[14908],{"type":83,"value":475},{"type":77,"tag":148,"props":14910,"children":14911},{"class":150,"line":267},[14912,14917,14921,14925,14930,14934,14938,14942,14947,14951,14955,14959],{"type":77,"tag":148,"props":14913,"children":14914},{"style":390},[14915],{"type":83,"value":14916},"  debug",{"type":77,"tag":148,"props":14918,"children":14919},{"style":171},[14920],{"type":83,"value":306},{"type":77,"tag":148,"props":14922,"children":14923},{"style":171},[14924],{"type":83,"value":174},{"type":77,"tag":148,"props":14926,"children":14927},{"style":390},[14928],{"type":83,"value":14929}," provider",{"type":77,"tag":148,"props":14931,"children":14932},{"style":171},[14933],{"type":83,"value":306},{"type":77,"tag":148,"props":14935,"children":14936},{"style":530},[14937],{"type":83,"value":533},{"type":77,"tag":148,"props":14939,"children":14940},{"style":171},[14941],{"type":83,"value":185},{"type":77,"tag":148,"props":14943,"children":14944},{"style":390},[14945],{"type":83,"value":14946}," output",{"type":77,"tag":148,"props":14948,"children":14949},{"style":171},[14950],{"type":83,"value":306},{"type":77,"tag":148,"props":14952,"children":14953},{"style":530},[14954],{"type":83,"value":533},{"type":77,"tag":148,"props":14956,"children":14957},{"style":171},[14958],{"type":83,"value":13959},{"type":77,"tag":148,"props":14960,"children":14961},{"style":155},[14962],{"type":83,"value":14963}," \u002F\u002F raw SDK chunks + yielded chunks\n",{"type":77,"tag":148,"props":14965,"children":14966},{"class":150,"line":325},[14967,14971],{"type":77,"tag":148,"props":14968,"children":14969},{"style":171},[14970],{"type":83,"value":1114},{"type":77,"tag":148,"props":14972,"children":14973},{"style":177},[14974],{"type":83,"value":551},{"type":77,"tag":90,"props":14976,"children":14977},{},[14978,14980,14986],{"type":83,"value":14979},"See the ",{"type":77,"tag":107,"props":14981,"children":14983},{"className":14982},[],[14984],{"type":83,"value":14985},"ai-core\u002Fdebug-logging",{"type":83,"value":14987}," sub-skill for full details on categories\nand piping into a custom logger.",{"type":77,"tag":86,"props":14989,"children":14990},{},[14991],{"type":77,"tag":90,"props":14992,"children":14993},{},[14994],{"type":83,"value":14995},"Source: docs\u002Fadvanced\u002Fdebug-logging.md.",{"type":77,"tag":2627,"props":14997,"children":14998},{},[],{"type":77,"tag":124,"props":15000,"children":15002},{"id":15001},"cross-references",[15003],{"type":83,"value":15004},"Cross-References",{"type":77,"tag":15006,"props":15007,"children":15008},"ul",{},[15009,15051],{"type":77,"tag":15010,"props":15011,"children":15012},"li",{},[15013,15015,15020,15022,15027,15029,15034,15036,15041,15043,15049],{"type":83,"value":15014},"See also: ",{"type":77,"tag":94,"props":15016,"children":15017},{},[15018],{"type":83,"value":15019},"ai-core\u002Fadapter-configuration\u002FSKILL.md",{"type":83,"value":15021}," -- Each media\nactivity requires a specific activity adapter (e.g., ",{"type":77,"tag":107,"props":15023,"children":15025},{"className":15024},[],[15026],{"type":83,"value":2652},{"type":83,"value":15028}," for\nimages, ",{"type":77,"tag":107,"props":15030,"children":15032},{"className":15031},[],[15033],{"type":83,"value":6255},{"type":83,"value":15035}," for speech, ",{"type":77,"tag":107,"props":15037,"children":15039},{"className":15038},[],[15040],{"type":83,"value":6782},{"type":83,"value":15042}," for transcription,\n",{"type":77,"tag":107,"props":15044,"children":15046},{"className":15045},[],[15047],{"type":83,"value":15048},"openaiVideo",{"type":83,"value":15050}," for video). The adapter-configuration skill covers provider\nsetup, API keys, and model selection.",{"type":77,"tag":15010,"props":15052,"children":15053},{},[15054,15055,15060,15062,15068,15070,15075],{"type":83,"value":15014},{"type":77,"tag":94,"props":15056,"children":15057},{},[15058],{"type":83,"value":15059},"ai-core\u002Fdebug-logging\u002FSKILL.md",{"type":83,"value":15061}," -- When a media request\nreturns unexpected output or fails mid-stream, toggle ",{"type":77,"tag":107,"props":15063,"children":15065},{"className":15064},[],[15066],{"type":83,"value":15067},"debug: true",{"type":83,"value":15069}," on\nany ",{"type":77,"tag":107,"props":15071,"children":15073},{"className":15072},[],[15074],{"type":83,"value":112},{"type":83,"value":15076}," call to see request metadata, raw provider chunks, and\nerrors. Covers per-category toggling and piping into pino\u002Fwinston.",{"type":77,"tag":15078,"props":15079,"children":15080},"style",{},[15081],{"type":83,"value":15082},"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":15084,"total":15226},[15085,15101,15113,15125,15140,15152,15162,15172,15185,15195,15206,15216],{"slug":15086,"name":15086,"fn":15087,"description":15088,"org":15089,"tags":15090,"stars":15098,"repoUrl":15099,"updatedAt":15100},"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},[15091,15094,15097],{"name":15092,"slug":15093,"type":16},"Data Analysis","data-analysis",{"name":15095,"slug":15096,"type":16},"Frontend","frontend",{"name":10,"slug":9,"type":16},28175,"https:\u002F\u002Fgithub.com\u002FTanStack\u002Ftable","2026-07-30T05:25:59.429787",{"slug":15102,"name":15102,"fn":15103,"description":15104,"org":15105,"tags":15106,"stars":15098,"repoUrl":15099,"updatedAt":15112},"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},[15107,15110,15111],{"name":15108,"slug":15109,"type":16},"Debugging","debugging",{"name":15095,"slug":15096,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:26:05.418735",{"slug":15114,"name":15114,"fn":15115,"description":15116,"org":15117,"tags":15118,"stars":15098,"repoUrl":15099,"updatedAt":15124},"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},[15119,15120,15121],{"name":15092,"slug":15093,"type":16},{"name":10,"slug":9,"type":16},{"name":15122,"slug":15123,"type":16},"UI Components","ui-components","2026-07-30T05:25:38.403427",{"slug":15126,"name":15126,"fn":15127,"description":15128,"org":15129,"tags":15130,"stars":15098,"repoUrl":15099,"updatedAt":15139},"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},[15131,15134,15135,15138],{"name":15132,"slug":15133,"type":16},"Data Pipeline","data-pipeline",{"name":15095,"slug":15096,"type":16},{"name":15136,"slug":15137,"type":16},"Performance","performance",{"name":10,"slug":9,"type":16},"2026-07-30T05:25:45.400104",{"slug":15141,"name":15141,"fn":15142,"description":15143,"org":15144,"tags":15145,"stars":15098,"repoUrl":15099,"updatedAt":15151},"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},[15146,15149,15150],{"name":15147,"slug":15148,"type":16},"Data Visualization","data-visualization",{"name":15095,"slug":15096,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:25:41.397257",{"slug":15153,"name":15153,"fn":15154,"description":15155,"org":15156,"tags":15157,"stars":15098,"repoUrl":15099,"updatedAt":15161},"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},[15158,15159,15160],{"name":15092,"slug":15093,"type":16},{"name":15095,"slug":15096,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:25:53.391632",{"slug":15163,"name":15163,"fn":15164,"description":15165,"org":15166,"tags":15167,"stars":15098,"repoUrl":15099,"updatedAt":15171},"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},[15168,15169,15170],{"name":15095,"slug":15096,"type":16},{"name":10,"slug":9,"type":16},{"name":15122,"slug":15123,"type":16},"2026-07-30T05:26:03.37801",{"slug":15173,"name":15173,"fn":15174,"description":15175,"org":15176,"tags":15177,"stars":15098,"repoUrl":15099,"updatedAt":15184},"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},[15178,15181,15182,15183],{"name":15179,"slug":15180,"type":16},"CSS","css",{"name":15095,"slug":15096,"type":16},{"name":10,"slug":9,"type":16},{"name":15122,"slug":15123,"type":16},"2026-07-30T05:25:55.377366",{"slug":15186,"name":15186,"fn":15187,"description":15188,"org":15189,"tags":15190,"stars":15098,"repoUrl":15099,"updatedAt":15194},"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},[15191,15192,15193],{"name":15095,"slug":15096,"type":16},{"name":10,"slug":9,"type":16},{"name":15122,"slug":15123,"type":16},"2026-07-30T05:25:51.400011",{"slug":15196,"name":15196,"fn":15197,"description":15198,"org":15199,"tags":15200,"stars":15098,"repoUrl":15099,"updatedAt":15205},"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},[15201,15202,15203,15204],{"name":15179,"slug":15180,"type":16},{"name":15095,"slug":15096,"type":16},{"name":10,"slug":9,"type":16},{"name":15122,"slug":15123,"type":16},"2026-07-30T05:25:48.703799",{"slug":15207,"name":15207,"fn":15208,"description":15209,"org":15210,"tags":15211,"stars":15098,"repoUrl":15099,"updatedAt":15215},"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},[15212,15213,15214],{"name":15095,"slug":15096,"type":16},{"name":10,"slug":9,"type":16},{"name":15122,"slug":15123,"type":16},"2026-07-30T05:25:47.367943",{"slug":15217,"name":15217,"fn":15218,"description":15219,"org":15220,"tags":15221,"stars":15098,"repoUrl":15099,"updatedAt":15225},"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},[15222,15223,15224],{"name":15092,"slug":15093,"type":16},{"name":15095,"slug":15096,"type":16},{"name":15122,"slug":15123,"type":16},"2026-07-30T05:25:52.366295",125,{"items":15228,"total":1405},[15229,15246,15261,15276,15289,15301,15315],{"slug":15230,"name":15230,"fn":15231,"description":15232,"org":15233,"tags":15234,"stars":30,"repoUrl":31,"updatedAt":15245},"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},[15235,15236,15239,15242,15243],{"name":18,"slug":19,"type":16},{"name":15237,"slug":15238,"type":16},"Code Execution","code-execution",{"name":15240,"slug":15241,"type":16},"Sandboxing","sandboxing",{"name":10,"slug":9,"type":16},{"name":15244,"slug":51,"type":16},"TypeScript","2026-07-16T06:04:13.597905",{"slug":15247,"name":15247,"fn":15248,"description":15249,"org":15250,"tags":15251,"stars":30,"repoUrl":31,"updatedAt":15260},"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},[15252,15255,15257],{"name":15253,"slug":15254,"type":16},"Agents","agents",{"name":15256,"slug":36,"type":16},"AI",{"name":15258,"slug":15259,"type":16},"Middleware","middleware","2026-07-30T05:26:10.404565",{"slug":15262,"name":15263,"fn":15264,"description":15265,"org":15266,"tags":15267,"stars":30,"repoUrl":31,"updatedAt":15275},"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},[15268,15269,15272,15274],{"name":18,"slug":19,"type":16},{"name":15270,"slug":15271,"type":16},"Configuration","configuration",{"name":15273,"slug":43,"type":16},"LLM",{"name":10,"slug":9,"type":16},"2026-07-16T06:04:17.82075",{"slug":15277,"name":15278,"fn":15279,"description":15280,"org":15281,"tags":15282,"stars":30,"repoUrl":31,"updatedAt":15288},"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},[15283,15286,15287],{"name":15284,"slug":15285,"type":16},"API Development","api-development",{"name":15273,"slug":43,"type":16},{"name":10,"slug":9,"type":16},"2026-07-16T06:04:10.093367",{"slug":15290,"name":15291,"fn":15292,"description":15293,"org":15294,"tags":15295,"stars":30,"repoUrl":31,"updatedAt":15300},"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},[15296,15297,15298,15299],{"name":15284,"slug":15285,"type":16},{"name":15095,"slug":15096,"type":16},{"name":15273,"slug":43,"type":16},{"name":10,"slug":9,"type":16},"2026-07-30T05:26:11.505241",{"slug":15302,"name":15303,"fn":15304,"description":15305,"org":15306,"tags":15307,"stars":30,"repoUrl":31,"updatedAt":15314},"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},[15308,15309,15310,15313],{"name":15256,"slug":36,"type":16},{"name":15095,"slug":15096,"type":16},{"name":15311,"slug":15312,"type":16},"Persistence","persistence",{"name":10,"slug":9,"type":16},"2026-07-30T05:53:35.503176",{"slug":15316,"name":15317,"fn":15318,"description":15319,"org":15320,"tags":15321,"stars":30,"repoUrl":31,"updatedAt":15328},"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},[15322,15323,15324,15327],{"name":15256,"slug":36,"type":16},{"name":15284,"slug":15285,"type":16},{"name":15325,"slug":15326,"type":16},"Backend","backend",{"name":10,"slug":9,"type":16},"2026-07-17T06:06:39.855351"]