@tanstack/ai-gemini 0.26.4 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"model-meta.js","names":[],"sources":["../../src/model-meta.ts"],"sourcesContent":["import type {\n GeminiCachedContentOptions,\n GeminiCommonConfigOptions,\n GeminiSafetyOptions,\n GeminiStructuredOutputOptions,\n GeminiThinkingOptions,\n GeminiToolConfigOptions,\n} from './text/text-provider-options'\nimport type { GeminiEmbeddingProviderOptions } from './embedding/embedding-provider-options'\n\ninterface ModelMeta<TProviderOptions = unknown> {\n name: string\n supports: {\n input: Array<'text' | 'image' | 'audio' | 'video' | 'document'>\n output: Array<'text' | 'image' | 'audio' | 'video'>\n capabilities?: Array<\n | 'audio_generation'\n | 'batch_api'\n | 'caching'\n | 'function_calling'\n | 'live_api'\n | 'structured_output'\n | 'thinking'\n >\n tools?: Array<\n | 'code_execution'\n | 'file_search'\n | 'google_search'\n | 'google_search_retrieval'\n | 'google_maps'\n | 'url_context'\n | 'computer_use'\n >\n }\n max_input_tokens?: number\n max_output_tokens?: number\n knowledge_cutoff?: string\n pricing?: {\n input: {\n normal: number\n cached?: number\n }\n output: {\n normal: number\n }\n }\n /**\n * Type-level description of which provider options this model supports.\n */\n providerOptions?: TProviderOptions\n}\n\nconst GEMINI_3_1_PRO = {\n name: 'gemini-3.1-pro-preview',\n max_input_tokens: 1_048_576,\n max_output_tokens: 65_536,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'image', 'audio', 'video', 'document'],\n output: ['text'],\n capabilities: [\n 'batch_api',\n 'caching',\n 'function_calling',\n 'structured_output',\n 'thinking',\n ],\n tools: ['code_execution', 'file_search', 'google_search', 'url_context'],\n },\n pricing: {\n input: {\n normal: 2.5,\n },\n output: {\n normal: 15,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\nconst GEMINI_3_FLASH = {\n name: 'gemini-3-flash-preview',\n max_input_tokens: 1_048_576,\n max_output_tokens: 65_536,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'image', 'audio', 'video', 'document'],\n output: ['text'],\n capabilities: [\n 'batch_api',\n 'caching',\n 'function_calling',\n 'structured_output',\n 'thinking',\n ],\n tools: ['code_execution', 'file_search', 'google_search', 'url_context'],\n },\n pricing: {\n input: {\n normal: 0.5,\n },\n output: {\n normal: 3,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\n/**\n * Gemini 3 Pro Image (\"Nano Banana Pro\") — GA. Accepts the ten standard\n * aspect ratios at 1K / 2K / 4K.\n * @see https://ai.google.dev/gemini-api/docs/models/gemini-3-pro-image\n */\nconst GEMINI_3_PRO_IMAGE = {\n name: 'gemini-3-pro-image',\n max_input_tokens: 65_536,\n max_output_tokens: 32_768,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'image'],\n output: ['text', 'image'],\n capabilities: ['batch_api', 'structured_output', 'thinking'],\n tools: ['google_search'],\n },\n pricing: {\n input: {\n normal: 2,\n },\n output: {\n normal: 0.134,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\n/**\n * @deprecated `gemini-3-pro-image-preview` was shut down on 2026-06-25. Use\n * the GA id `gemini-3-pro-image` instead — the preview id now 404s.\n * Kept in the model union so existing code still compiles.\n * @see https://ai.google.dev/gemini-api/docs/deprecations\n */\nconst GEMINI_3_PRO_IMAGE_PREVIEW = {\n name: 'gemini-3-pro-image-preview',\n max_input_tokens: 65_536,\n max_output_tokens: 32_768,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'image'],\n output: ['text', 'image'],\n capabilities: ['batch_api', 'structured_output', 'thinking'],\n tools: ['google_search'],\n },\n pricing: {\n input: {\n normal: 2,\n },\n output: {\n normal: 0.134,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\n/**\n * Gemini 3.1 Flash Image (\"Nano Banana 2\") — GA. The only native image model\n * that accepts the four extreme banner ratios (1:4, 4:1, 1:8, 8:1) and the\n * 512 (0.5K) resolution tier.\n * @see https://ai.google.dev/gemini-api/docs/models/gemini-3.1-flash-image\n */\nconst GEMINI_3_1_FLASH_IMAGE = {\n name: 'gemini-3.1-flash-image',\n max_input_tokens: 131_072,\n max_output_tokens: 32_768,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'image'],\n output: ['text', 'image'],\n capabilities: ['batch_api', 'thinking'],\n tools: ['google_search'],\n },\n pricing: {\n input: {\n normal: 0.5,\n },\n output: {\n normal: 3,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiThinkingOptions\n>\n\n/**\n * @deprecated `gemini-3.1-flash-image-preview` was shut down on 2026-06-25.\n * Use the GA id `gemini-3.1-flash-image` instead — the preview id now 404s.\n * Kept in the model union so existing code still compiles.\n * @see https://ai.google.dev/gemini-api/docs/deprecations\n */\nconst GEMINI_3_1_FLASH_IMAGE_PREVIEW = {\n name: 'gemini-3.1-flash-image-preview',\n max_input_tokens: 65_536,\n max_output_tokens: 65_536,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'image'],\n output: ['text', 'image'],\n capabilities: ['batch_api', 'structured_output', 'thinking'],\n tools: ['google_search'],\n },\n pricing: {\n input: {\n normal: 0.25,\n },\n output: {\n normal: 1.5,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\n/**\n * Gemini 3.1 Flash Lite Image (\"Nano Banana 2 Lite\") — GA. 1K output only.\n * @see https://ai.google.dev/gemini-api/docs/models/gemini-3.1-flash-lite-image\n */\nconst GEMINI_3_1_FLASH_LITE_IMAGE = {\n name: 'gemini-3.1-flash-lite-image',\n max_input_tokens: 65_536,\n max_output_tokens: 65_536,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'image'],\n output: ['text', 'image'],\n capabilities: ['batch_api', 'structured_output', 'thinking'],\n tools: ['google_search'],\n },\n pricing: {\n input: {\n normal: 0.25,\n },\n output: {\n normal: 1.5,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\nconst GEMINI_3_1_FLASH_LITE = {\n name: 'gemini-3.1-flash-lite',\n max_input_tokens: 1_048_576,\n max_output_tokens: 65_536,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'image', 'audio', 'video', 'document'],\n output: ['text'],\n capabilities: [\n 'batch_api',\n 'caching',\n 'function_calling',\n 'structured_output',\n 'thinking',\n ],\n tools: ['code_execution', 'file_search', 'google_search', 'url_context'],\n },\n pricing: {\n input: {\n normal: 0.25,\n },\n output: {\n normal: 1.5,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\nconst GEMINI_3_1_FLASH_LITE_PREVIEW = {\n name: 'gemini-3.1-flash-lite-preview',\n max_input_tokens: 1_048_576,\n max_output_tokens: 65_536,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'image', 'audio', 'video', 'document'],\n output: ['text'],\n capabilities: [\n 'batch_api',\n 'caching',\n 'function_calling',\n 'structured_output',\n 'thinking',\n ],\n tools: ['code_execution', 'file_search', 'google_search', 'url_context'],\n },\n pricing: {\n input: {\n normal: 0.25,\n },\n output: {\n normal: 1.5,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\nconst GEMINI_2_5_PRO = {\n name: 'gemini-2.5-pro',\n max_input_tokens: 1_048_576,\n max_output_tokens: 65_536,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'image', 'audio', 'video', 'document'],\n output: ['text'],\n capabilities: [\n 'batch_api',\n 'caching',\n 'function_calling',\n 'structured_output',\n 'thinking',\n ],\n tools: [\n 'code_execution',\n 'file_search',\n 'google_maps',\n 'google_search',\n 'url_context',\n ],\n },\n pricing: {\n input: {\n normal: 2.5,\n },\n output: {\n normal: 15,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\nconst GEMINI_2_5_PRO_TTS = {\n name: 'gemini-2.5-pro-preview-tts',\n max_input_tokens: 8_192,\n max_output_tokens: 16_384,\n knowledge_cutoff: '2025-05-01',\n supports: {\n input: ['text'],\n output: ['audio'],\n capabilities: ['audio_generation'],\n },\n pricing: {\n input: {\n normal: 2.5,\n },\n output: {\n normal: 15,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions\n>\n\nconst GEMINI_2_5_FLASH = {\n name: 'gemini-2.5-flash',\n max_input_tokens: 1_048_576,\n max_output_tokens: 65_536,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'image', 'audio', 'video'],\n output: ['text'],\n capabilities: [\n 'batch_api',\n 'caching',\n 'function_calling',\n 'structured_output',\n 'thinking',\n ],\n tools: [\n 'code_execution',\n 'file_search',\n 'google_maps',\n 'google_search',\n 'url_context',\n ],\n },\n pricing: {\n input: {\n normal: 1,\n },\n output: {\n normal: 2.5,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\n/**\n * Gemini 2.5 Flash Image (\"Nano Banana\") — still GA, but documented as the\n * legacy member of the family. Google publishes no `image_size` value for it,\n * so its size type is a bare aspect ratio and the adapter sends no\n * `imageConfig.imageSize`.\n * @deprecated `gemini-2.5-flash-image` shuts down on 2026-10-02. Migrate to\n * `gemini-3.1-flash-lite-image` (cheapest successor) or\n * `gemini-3.1-flash-image`. Google's deprecations table still names the\n * already-dead `gemini-3.1-flash-image-preview` as the replacement.\n * @see https://ai.google.dev/gemini-api/docs/deprecations\n */\nconst GEMINI_2_5_FLASH_IMAGE = {\n name: 'gemini-2.5-flash-image',\n max_input_tokens: 1_048_576,\n max_output_tokens: 65_536,\n knowledge_cutoff: '2025-06-01',\n supports: {\n input: ['text', 'image'],\n output: ['text', 'image'],\n capabilities: ['batch_api', 'caching', 'structured_output'],\n tools: ['file_search'],\n },\n pricing: {\n input: {\n normal: 0.3,\n },\n output: {\n normal: 0.4,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions\n>\n/**\nconst GEMINI_2_5_FLASH_LIVE = {\n name: 'gemini-2.5-flash-native-audio-preview-09-2025',\n max_input_tokens: 141_072,\n max_output_tokens: 8_192,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'audio', 'video'],\n output: ['text', 'audio'],\n capabilities: [\n 'audio_generation',\n 'file_search',\n 'function_calling',\n 'live_api',\n 'search_grounding',\n 'thinking',\n ],\n },\n pricing: {\n // todo find this info\n input: {\n normal: 0,\n },\n output: {\n normal: 0,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiGenerationConfigOptions &\n GeminiCachedContentOptions &\n GeminiThinkingOptions\n>\n*/\nconst GEMINI_2_5_FLASH_TTS = {\n name: 'gemini-2.5-flash-preview-tts',\n max_input_tokens: 8_192,\n max_output_tokens: 16_384,\n knowledge_cutoff: '2025-05-01',\n supports: {\n input: ['text'],\n output: ['audio'],\n capabilities: ['audio_generation', 'batch_api'],\n },\n pricing: {\n input: {\n normal: 1,\n },\n output: {\n normal: 2.5,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions\n>\n\n/**\n * Gemini 3.1 Flash TTS Preview - latest expressive TTS model with\n * 200+ audio tags, 70+ languages, and multi-speaker dialogue support.\n * @see https://ai.google.dev/gemini-api/docs/models/gemini-3.1-flash-tts-preview\n */\nconst GEMINI_3_1_FLASH_TTS = {\n name: 'gemini-3.1-flash-tts-preview',\n max_input_tokens: 32_768,\n max_output_tokens: 16_384,\n knowledge_cutoff: '2025-05-01',\n supports: {\n input: ['text'],\n output: ['audio'],\n capabilities: ['audio_generation', 'batch_api'],\n },\n pricing: {\n input: {\n normal: 0.5,\n },\n output: {\n normal: 10,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions\n>\n\n/**\n * Lyria 3 Pro Preview — Google's flagship music generation model.\n * Generates full-length songs with multiple verses, choruses, and bridges.\n * Outputs MP3 or WAV at 48 kHz stereo.\n * @see https://ai.google.dev/gemini-api/docs/models/lyria-3-pro-preview\n */\nconst LYRIA_3_PRO = {\n name: 'lyria-3-pro-preview',\n max_input_tokens: 131_072,\n supports: {\n input: ['text', 'image'],\n output: ['audio'],\n capabilities: ['audio_generation'],\n },\n pricing: {\n input: {\n normal: 0,\n },\n output: {\n normal: 0,\n },\n },\n} as const satisfies ModelMeta\n\n/**\n * Lyria 3 Clip Preview — 30-second music clips in MP3 format.\n * @see https://ai.google.dev/gemini-api/docs/music-generation\n */\nconst LYRIA_3_CLIP = {\n name: 'lyria-3-clip-preview',\n max_input_tokens: 131_072,\n supports: {\n input: ['text', 'image'],\n output: ['audio'],\n capabilities: ['audio_generation'],\n },\n pricing: {\n input: {\n normal: 0,\n },\n output: {\n normal: 0,\n },\n },\n} as const satisfies ModelMeta\n\nconst GEMINI_2_5_FLASH_LITE = {\n name: 'gemini-2.5-flash-lite',\n max_input_tokens: 1_048_576,\n max_output_tokens: 65_536,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'image', 'audio', 'video', 'document'],\n output: ['text'],\n capabilities: [\n 'batch_api',\n 'caching',\n 'function_calling',\n 'structured_output',\n 'thinking',\n ],\n tools: ['code_execution', 'google_maps', 'google_search', 'url_context'],\n },\n pricing: {\n input: {\n normal: 0.1,\n },\n output: {\n normal: 0.4,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\nconst IMAGEN_4_GENERATE = {\n name: 'imagen-4.0-generate-001',\n max_input_tokens: 480,\n max_output_tokens: 4,\n supports: {\n input: ['text'],\n output: ['image'],\n },\n pricing: {\n input: {\n normal: 0,\n },\n output: {\n normal: 0.4,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions\n>\n\nconst IMAGEN_4_GENERATE_ULTRA = {\n name: 'imagen-4.0-ultra-generate-001',\n max_input_tokens: 480,\n max_output_tokens: 4,\n supports: {\n input: ['text'],\n output: ['image'],\n },\n pricing: {\n input: {\n normal: 0,\n },\n output: {\n normal: 0.6,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions\n>\n\nconst IMAGEN_4_GENERATE_FAST = {\n name: 'imagen-4.0-fast-generate-001',\n max_input_tokens: 480,\n max_output_tokens: 4,\n supports: {\n input: ['text'],\n output: ['image'],\n },\n pricing: {\n input: {\n normal: 0,\n },\n output: {\n normal: 0.2,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions\n>\n\n/**\n * Veo video generation models. Pricing is per second of generated video\n * (audio+video rate where the model supports audio).\n * @experimental Veo video generation is an experimental feature and may change.\n */\nconst VEO_3_1_PREVIEW = {\n name: 'veo-3.1-generate-preview',\n max_input_tokens: 1024,\n max_output_tokens: 1,\n supports: {\n input: ['text', 'image'],\n output: ['video', 'audio'],\n },\n pricing: {\n input: {\n normal: 0,\n },\n output: {\n normal: 0.4,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions\n>\n\nconst VEO_3_1_FAST_PREVIEW = {\n name: 'veo-3.1-fast-generate-preview',\n max_input_tokens: 1024,\n max_output_tokens: 1,\n supports: {\n input: ['text', 'image'],\n output: ['video', 'audio'],\n },\n pricing: {\n input: {\n normal: 0,\n },\n output: {\n normal: 0.15,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions\n>\n\nconst VEO_3_1_LITE_PREVIEW = {\n name: 'veo-3.1-lite-generate-preview',\n max_input_tokens: 1024,\n max_output_tokens: 1,\n supports: {\n input: ['text', 'image'],\n output: ['video', 'audio'],\n },\n pricing: {\n input: {\n normal: 0,\n },\n output: {\n normal: 0.05,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions\n>\n\n/**\n * Gemini Omni Flash — multimodal video generation with conversational\n * editing. Serves only the Interactions API (`generateContent` rejects it),\n * so it routes through the interactions-based path of the video adapter,\n * not Veo's `:predictLongRunning` flow. Pricing is per second of generated\n * video ($0.10/sec). 720p / 24 FPS, 3–10 second clips (default 10s).\n * @experimental Omni video generation is an experimental feature and may change.\n */\nconst GEMINI_OMNI_FLASH_PREVIEW = {\n name: 'gemini-omni-flash-preview',\n max_input_tokens: 1_048_576,\n max_output_tokens: 1,\n supports: {\n input: ['text', 'image', 'video'],\n output: ['video', 'audio'],\n },\n pricing: {\n input: {\n normal: 0,\n },\n output: {\n normal: 0.1,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions\n>\n\nconst GEMINI_3_7_FLASH = {\n name: 'gemini-3.7-flash',\n max_input_tokens: 1_048_576,\n max_output_tokens: 65_536,\n knowledge_cutoff: '2026-03-01',\n supports: {\n input: ['text', 'image', 'video', 'audio', 'document'],\n output: ['text'],\n capabilities: [\n 'batch_api',\n 'caching',\n 'function_calling',\n 'structured_output',\n 'thinking',\n ],\n tools: [\n 'code_execution',\n 'file_search',\n 'google_search',\n 'google_maps',\n 'url_context',\n 'computer_use',\n ],\n },\n // Currently 50% off through the end of 2026.\n // https://ai.google.dev/gemini-api/docs/pricing#gemini-3.7-flash\n pricing: {\n input: {\n normal: 0.75,\n cached: 0.075,\n },\n output: {\n normal: 3.75,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\nconst GEMINI_3_6_FLASH = {\n name: 'gemini-3.6-flash',\n max_input_tokens: 1_048_576,\n max_output_tokens: 65_536,\n knowledge_cutoff: '2026-03-01',\n supports: {\n input: ['text', 'image', 'video', 'audio', 'document'],\n output: ['text'],\n capabilities: [\n 'batch_api',\n 'caching',\n 'function_calling',\n 'structured_output',\n 'thinking',\n ],\n tools: [\n 'code_execution',\n 'file_search',\n 'google_search',\n 'google_maps',\n 'url_context',\n 'computer_use',\n ],\n },\n pricing: {\n input: {\n normal: 1.5,\n cached: 0.15,\n },\n output: {\n normal: 7.5,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\nconst GEMINI_3_5_FLASH = {\n name: 'gemini-3.5-flash',\n max_input_tokens: 1_048_576,\n max_output_tokens: 65_536,\n supports: {\n input: ['text', 'image', 'video', 'document', 'audio'],\n output: ['text'],\n capabilities: [\n 'batch_api',\n 'caching',\n 'function_calling',\n 'structured_output',\n 'thinking',\n ],\n tools: [\n 'code_execution',\n 'file_search',\n 'google_search',\n 'google_maps',\n 'url_context',\n 'computer_use',\n ],\n },\n pricing: {\n input: {\n normal: 1.5,\n cached: 0.15,\n },\n output: {\n normal: 9,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\nconst GEMINI_3_5_FLASH_LITE = {\n name: 'gemini-3.5-flash-lite',\n max_input_tokens: 1_048_576,\n max_output_tokens: 65_536,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'image', 'video', 'audio', 'document'],\n output: ['text'],\n capabilities: [\n 'batch_api',\n 'caching',\n 'function_calling',\n 'structured_output',\n 'thinking',\n ],\n tools: [\n 'code_execution',\n 'file_search',\n 'google_search',\n 'google_maps',\n 'url_context',\n ],\n },\n pricing: {\n input: {\n normal: 0.3,\n cached: 0.03,\n },\n output: {\n normal: 2.5,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\nexport const GEMINI_MODELS = [\n GEMINI_3_7_FLASH.name,\n GEMINI_3_6_FLASH.name,\n GEMINI_3_5_FLASH.name,\n GEMINI_3_5_FLASH_LITE.name,\n GEMINI_3_1_PRO.name,\n GEMINI_3_FLASH.name,\n GEMINI_3_1_FLASH_LITE.name,\n GEMINI_3_1_FLASH_LITE_PREVIEW.name,\n GEMINI_2_5_PRO.name,\n GEMINI_2_5_FLASH.name,\n GEMINI_2_5_FLASH_LITE.name,\n] as const\n\n/**\n * Gemini models that support combining `tools` + `responseSchema` in a\n * single streaming `generateContent` call (per issue #605). Per the\n * provider matrix, Gemini 3.x natively interleaves the schema-constrained\n * answer with function-calling on one pass; Gemini 2.x is unsupported /\n * brittle and keeps the engine's legacy finalization fallback.\n */\nexport const GEMINI_COMBINED_TOOLS_AND_SCHEMA_MODELS = new Set<string>([\n GEMINI_3_7_FLASH.name,\n GEMINI_3_6_FLASH.name,\n GEMINI_3_5_FLASH.name,\n GEMINI_3_5_FLASH_LITE.name,\n GEMINI_3_1_PRO.name,\n GEMINI_3_FLASH.name,\n GEMINI_3_1_FLASH_LITE.name,\n GEMINI_3_1_FLASH_LITE_PREVIEW.name,\n])\n\nexport type GeminiModels = (typeof GEMINI_MODELS)[number]\n\n/**\n * @deprecated Shut down 2026-06-25. Use `gemini-3.1-flash-image`.\n */\ntype Gemini31FlashImagePreviewModel = 'gemini-3.1-flash-image-preview'\n\n/**\n * @deprecated Shut down 2026-06-25. Use `gemini-3-pro-image`.\n */\ntype Gemini3ProImagePreviewModel = 'gemini-3-pro-image-preview'\n\nexport type GeminiImageModels =\n | Exclude<\n (typeof GEMINI_IMAGE_MODELS)[number],\n Gemini31FlashImagePreviewModel | Gemini3ProImagePreviewModel\n >\n | Gemini31FlashImagePreviewModel\n | Gemini3ProImagePreviewModel\n\n/**\n * Image generation models. GA ids come first; the trailing `-preview` ids are\n * shut-down aliases kept only so existing code keeps compiling — new code\n * should use the GA id above its alias.\n */\nexport const GEMINI_IMAGE_MODELS = [\n GEMINI_3_1_FLASH_IMAGE.name,\n GEMINI_3_1_FLASH_LITE_IMAGE.name,\n GEMINI_3_PRO_IMAGE.name,\n GEMINI_2_5_FLASH_IMAGE.name,\n IMAGEN_4_GENERATE.name,\n IMAGEN_4_GENERATE_FAST.name,\n IMAGEN_4_GENERATE_ULTRA.name,\n // Deprecated aliases — shut down 2026-06-25.\n GEMINI_3_1_FLASH_IMAGE_PREVIEW.name,\n GEMINI_3_PRO_IMAGE_PREVIEW.name,\n] as const\n\n/**\n * Text-to-speech models\n * @experimental Gemini TTS is an experimental feature and may change.\n */\nexport const GEMINI_TTS_MODELS = [\n GEMINI_3_1_FLASH_TTS.name,\n GEMINI_2_5_FLASH_TTS.name,\n GEMINI_2_5_PRO_TTS.name,\n] as const\n\n/**\n * Audio generation models (Lyria music generation).\n * @experimental Lyria music generation is an experimental feature and may change.\n */\nexport const GEMINI_AUDIO_MODELS = [\n LYRIA_3_PRO.name,\n LYRIA_3_CLIP.name,\n] as const\n\n/**\n * Available voice names for Gemini TTS\n * @see https://ai.google.dev/gemini-api/docs/speech-generation\n */\nexport const GEMINI_TTS_VOICES = [\n 'Zephyr',\n 'Puck',\n 'Charon',\n 'Kore',\n 'Fenrir',\n 'Leda',\n 'Orus',\n 'Aoede',\n 'Callirrhoe',\n 'Autonoe',\n 'Enceladus',\n 'Iapetus',\n 'Umbriel',\n 'Algieba',\n 'Despina',\n 'Erinome',\n 'Algenib',\n 'Rasalgethi',\n 'Laomedeia',\n 'Achernar',\n 'Alnilam',\n 'Schedar',\n 'Gacrux',\n 'Pulcherrima',\n 'Achird',\n 'Zubenelgenubi',\n 'Vindemiatrix',\n 'Sadachbia',\n 'Sadaltager',\n 'Sulafat',\n] as const\n\nexport type GeminiTTSVoice = (typeof GEMINI_TTS_VOICES)[number]\n\n/**\n * Video generation models. Veo models run on the long-running\n * `:predictLongRunning` flow; Gemini Omni Flash runs on the Interactions\n * API — the video adapter routes by model.\n * @experimental Video generation is an experimental feature and may change.\n */\nexport const GEMINI_VIDEO_MODELS = [\n VEO_3_1_PREVIEW.name,\n VEO_3_1_FAST_PREVIEW.name,\n VEO_3_1_LITE_PREVIEW.name,\n GEMINI_OMNI_FLASH_PREVIEW.name,\n] as const\n\n/**\n * Video models served by the Interactions API rather than Veo's\n * `:predictLongRunning` operations flow.\n * @experimental Omni video generation is an experimental feature and may change.\n */\nexport const GEMINI_INTERACTIONS_VIDEO_MODELS = [\n GEMINI_OMNI_FLASH_PREVIEW.name,\n] as const\n\n/**\n * Embedding models\n */\nexport const GEMINI_EMBEDDING_MODELS = ['gemini-embedding-001'] as const\n\nexport type GeminiEmbeddingModel = (typeof GEMINI_EMBEDDING_MODELS)[number]\n\n/**\n * Type-only map from embedding model name to its provider options type.\n */\nexport type GeminiEmbeddingModelProviderOptionsByName = {\n 'gemini-embedding-001': GeminiEmbeddingProviderOptions\n}\n\n/**\n * Per-model input modalities for embedding models. Gemini embedding models\n * are text-only, so image inputs fail at compile time.\n */\nexport type GeminiEmbeddingModelInputModalitiesByName = {\n 'gemini-embedding-001': readonly ['text']\n}\n\n// Manual type map for per-model provider options\nexport type GeminiChatModelProviderOptionsByName = {\n // Models with thinking and structured output support\n [GEMINI_3_7_FLASH.name]: GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n [GEMINI_3_6_FLASH.name]: GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n [GEMINI_3_5_FLASH.name]: GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n [GEMINI_3_5_FLASH_LITE.name]: GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n [GEMINI_3_1_PRO.name]: GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n [GEMINI_3_FLASH.name]: GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n [GEMINI_3_1_FLASH_LITE.name]: GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n [GEMINI_3_1_FLASH_LITE_PREVIEW.name]: GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n [GEMINI_2_5_PRO.name]: GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n [GEMINI_2_5_FLASH.name]: GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n [GEMINI_2_5_FLASH_LITE.name]: GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n}\n\n/**\n * Type-only map from chat model name to its supported tool capabilities.\n * Based on the 'supports.tools' arrays defined for each model.\n */\nexport type GeminiChatModelToolCapabilitiesByName = {\n [GEMINI_3_7_FLASH.name]: typeof GEMINI_3_7_FLASH.supports.tools\n [GEMINI_3_6_FLASH.name]: typeof GEMINI_3_6_FLASH.supports.tools\n [GEMINI_3_5_FLASH.name]: typeof GEMINI_3_5_FLASH.supports.tools\n [GEMINI_3_5_FLASH_LITE.name]: typeof GEMINI_3_5_FLASH_LITE.supports.tools\n [GEMINI_3_1_PRO.name]: typeof GEMINI_3_1_PRO.supports.tools\n [GEMINI_3_FLASH.name]: typeof GEMINI_3_FLASH.supports.tools\n [GEMINI_3_1_FLASH_LITE.name]: typeof GEMINI_3_1_FLASH_LITE.supports.tools\n [GEMINI_3_1_FLASH_LITE_PREVIEW.name]: typeof GEMINI_3_1_FLASH_LITE_PREVIEW.supports.tools\n [GEMINI_2_5_PRO.name]: typeof GEMINI_2_5_PRO.supports.tools\n [GEMINI_2_5_FLASH.name]: typeof GEMINI_2_5_FLASH.supports.tools\n [GEMINI_2_5_FLASH_LITE.name]: typeof GEMINI_2_5_FLASH_LITE.supports.tools\n}\n\n/**\n * Type-only map from chat model name to its supported input modalities.\n * Based on the 'supports.input' arrays defined for each model.\n * Note: 'document' in the model meta is mapped to 'document' modality.\n * Used by the core AI types to constrain ContentPart types based on the selected model.\n * Note: These must be inlined as readonly arrays (not typeof) because the model\n * constants are not exported and typeof references don't work in .d.ts files\n * when consumed by external packages.\n *\n * @see https://ai.google.dev/gemini-api/docs/vision\n * @see https://ai.google.dev/gemini-api/docs/audio\n * @see https://ai.google.dev/gemini-api/docs/document-processing\n */\nexport type GeminiModelInputModalitiesByName = {\n // Models with full multimodal support (text, image, audio, video, document)\n [GEMINI_3_7_FLASH.name]: typeof GEMINI_3_7_FLASH.supports.input\n [GEMINI_3_6_FLASH.name]: typeof GEMINI_3_6_FLASH.supports.input\n [GEMINI_3_5_FLASH.name]: typeof GEMINI_3_5_FLASH.supports.input\n [GEMINI_3_5_FLASH_LITE.name]: typeof GEMINI_3_5_FLASH_LITE.supports.input\n [GEMINI_3_1_PRO.name]: typeof GEMINI_3_1_PRO.supports.input\n [GEMINI_3_FLASH.name]: typeof GEMINI_3_FLASH.supports.input\n [GEMINI_3_1_FLASH_LITE.name]: typeof GEMINI_3_1_FLASH_LITE.supports.input\n [GEMINI_3_1_FLASH_LITE_PREVIEW.name]: typeof GEMINI_3_1_FLASH_LITE_PREVIEW.supports.input\n [GEMINI_2_5_PRO.name]: typeof GEMINI_2_5_PRO.supports.input\n [GEMINI_2_5_FLASH_LITE.name]: typeof GEMINI_2_5_FLASH_LITE.supports.input\n\n // Models with text, image, audio, video (no document)\n [GEMINI_2_5_FLASH.name]: typeof GEMINI_2_5_FLASH.supports.input\n}\n"],"mappings":";AAoDA,IAAM,iBAAiB;CACrB,MAAM;CACN,kBAAkB;CAClB,mBAAmB;CACnB,kBAAkB;CAClB,UAAU;EACR,OAAO;GAAC;GAAQ;GAAS;GAAS;GAAS;EAAU;EACrD,QAAQ,CAAC,MAAM;EACf,cAAc;GACZ;GACA;GACA;GACA;GACA;EACF;EACA,OAAO;GAAC;GAAkB;GAAe;GAAiB;EAAa;CACzE;CACA,SAAS;EACP,OAAO,EACL,QAAQ,IACV;EACA,QAAQ,EACN,QAAQ,GACV;CACF;AACF;AASA,IAAM,iBAAiB;CACrB,MAAM;CACN,kBAAkB;CAClB,mBAAmB;CACnB,kBAAkB;CAClB,UAAU;EACR,OAAO;GAAC;GAAQ;GAAS;GAAS;GAAS;EAAU;EACrD,QAAQ,CAAC,MAAM;EACf,cAAc;GACZ;GACA;GACA;GACA;GACA;EACF;EACA,OAAO;GAAC;GAAkB;GAAe;GAAiB;EAAa;CACzE;CACA,SAAS;EACP,OAAO,EACL,QAAQ,GACV;EACA,QAAQ,EACN,QAAQ,EACV;CACF;AACF;;;;;;AAcA,IAAM,qBAAqB;CACzB,MAAM;CACN,kBA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OAAO;GACL,QAAQ;GACR,QAAQ;EACV;EACA,QAAQ,EACN,QAAQ,IACV;CACF;AACF;AASA,IAAa,gBAAgB;CAC3B,iBAAiB;CACjB,iBAAiB;CACjB,iBAAiB;CACjB,sBAAsB;CACtB,eAAe;CACf,eAAe;CACf,sBAAsB;CACtB,8BAA8B;CAC9B,eAAe;CACf,iBAAiB;CACjB,sBAAsB;AACxB;;;;;;;;AASA,IAAa,0DAA0C,IAAI,IAAY;CACrE,iBAAiB;CACjB,iBAAiB;CACjB,iBAAiB;CACjB,sBAAsB;CACtB,eAAe;CACf,eAAe;CACf,sBAAsB;CACtB,8BAA8B;AAChC,CAAC;;;;;;AA2BD,IAAa,sBAAsB;CACjC,uBAAuB;CACvB,4BAA4B;CAC5B,mBAAmB;CACnB,uBAAuB;CACvB,kBAAkB;CAClB,uBAAuB;CACvB,wBAAwB;CAExB,+BAA+B;CAC/B,2BAA2B;AAC7B;;;;;AAMA,IAAa,oBAAoB;CAC/B,qBAAqB;CACrB,qBAAqB;CACrB,mBAAmB;AACrB;;;;;AAMA,IAAa,sBAAsB,CACjC,YAAY,MACZ,aAAa,IACf;;;;;AAMA,IAAa,oBAAoB;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;;;AAUA,IAAa,sBAAsB;CACjC,gBAAgB;CAChB,qBAAqB;CACrB,qBAAqB;CACrB,0BAA0B;AAC5B;;;;;;AAOA,IAAa,mCAAmC,CAC9C,0BAA0B,IAC5B;;;;AAKA,IAAa,0BAA0B,CAAC,sBAAsB"}
1
+ {"version":3,"file":"model-meta.js","names":[],"sources":["../../src/model-meta.ts"],"sourcesContent":["import type {\n GeminiCachedContentOptions,\n GeminiCommonConfigOptions,\n GeminiSafetyOptions,\n GeminiStructuredOutputOptions,\n GeminiThinkingOptions,\n GeminiToolConfigOptions,\n} from './text/text-provider-options'\nimport type { GeminiEmbeddingProviderOptions } from './embedding/embedding-provider-options'\n\ninterface ModelMeta<TProviderOptions = unknown> {\n name: string\n supports: {\n input: Array<'text' | 'image' | 'audio' | 'video' | 'document'>\n output: Array<'text' | 'image' | 'audio' | 'video'>\n capabilities?: Array<\n | 'agentic_video'\n | 'audio_generation'\n | 'batch_api'\n | 'caching'\n | 'function_calling'\n | 'live_api'\n | 'structured_output'\n | 'thinking'\n >\n tools?: Array<\n | 'code_execution'\n | 'file_search'\n | 'google_search'\n | 'google_search_retrieval'\n | 'google_maps'\n | 'url_context'\n | 'computer_use'\n >\n }\n max_input_tokens?: number\n max_output_tokens?: number\n knowledge_cutoff?: string\n pricing?: {\n input: {\n normal: number\n cached?: number\n }\n output: {\n normal: number\n }\n }\n /**\n * Type-level description of which provider options this model supports.\n */\n providerOptions?: TProviderOptions\n}\n\nconst GEMINI_3_1_PRO = {\n name: 'gemini-3.1-pro-preview',\n max_input_tokens: 1_048_576,\n max_output_tokens: 65_536,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'image', 'audio', 'video', 'document'],\n output: ['text'],\n capabilities: [\n 'batch_api',\n 'caching',\n 'function_calling',\n 'structured_output',\n 'thinking',\n ],\n tools: ['code_execution', 'file_search', 'google_search', 'url_context'],\n },\n pricing: {\n input: {\n normal: 2.5,\n },\n output: {\n normal: 15,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\nconst GEMINI_3_FLASH = {\n name: 'gemini-3-flash-preview',\n max_input_tokens: 1_048_576,\n max_output_tokens: 65_536,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'image', 'audio', 'video', 'document'],\n output: ['text'],\n capabilities: [\n 'batch_api',\n 'caching',\n 'function_calling',\n 'structured_output',\n 'thinking',\n ],\n tools: ['code_execution', 'file_search', 'google_search', 'url_context'],\n },\n pricing: {\n input: {\n normal: 0.5,\n },\n output: {\n normal: 3,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\n/**\n * Gemini 3 Pro Image (\"Nano Banana Pro\") — GA. Accepts the ten standard\n * aspect ratios at 1K / 2K / 4K.\n * @see https://ai.google.dev/gemini-api/docs/models/gemini-3-pro-image\n */\nconst GEMINI_3_PRO_IMAGE = {\n name: 'gemini-3-pro-image',\n max_input_tokens: 65_536,\n max_output_tokens: 32_768,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'image'],\n output: ['text', 'image'],\n capabilities: ['batch_api', 'structured_output', 'thinking'],\n tools: ['google_search'],\n },\n pricing: {\n input: {\n normal: 2,\n },\n output: {\n normal: 0.134,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\n/**\n * @deprecated `gemini-3-pro-image-preview` was shut down on 2026-06-25. Use\n * the GA id `gemini-3-pro-image` instead — the preview id now 404s.\n * Kept in the model union so existing code still compiles.\n * @see https://ai.google.dev/gemini-api/docs/deprecations\n */\nconst GEMINI_3_PRO_IMAGE_PREVIEW = {\n name: 'gemini-3-pro-image-preview',\n max_input_tokens: 65_536,\n max_output_tokens: 32_768,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'image'],\n output: ['text', 'image'],\n capabilities: ['batch_api', 'structured_output', 'thinking'],\n tools: ['google_search'],\n },\n pricing: {\n input: {\n normal: 2,\n },\n output: {\n normal: 0.134,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\n/**\n * Gemini 3.1 Flash Image (\"Nano Banana 2\") — GA. The only native image model\n * that accepts the four extreme banner ratios (1:4, 4:1, 1:8, 8:1) and the\n * 512 (0.5K) resolution tier.\n * @see https://ai.google.dev/gemini-api/docs/models/gemini-3.1-flash-image\n */\nconst GEMINI_3_1_FLASH_IMAGE = {\n name: 'gemini-3.1-flash-image',\n max_input_tokens: 131_072,\n max_output_tokens: 32_768,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'image'],\n output: ['text', 'image'],\n capabilities: ['batch_api', 'thinking'],\n tools: ['google_search'],\n },\n pricing: {\n input: {\n normal: 0.5,\n },\n output: {\n normal: 3,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiThinkingOptions\n>\n\n/**\n * @deprecated `gemini-3.1-flash-image-preview` was shut down on 2026-06-25.\n * Use the GA id `gemini-3.1-flash-image` instead — the preview id now 404s.\n * Kept in the model union so existing code still compiles.\n * @see https://ai.google.dev/gemini-api/docs/deprecations\n */\nconst GEMINI_3_1_FLASH_IMAGE_PREVIEW = {\n name: 'gemini-3.1-flash-image-preview',\n max_input_tokens: 65_536,\n max_output_tokens: 65_536,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'image'],\n output: ['text', 'image'],\n capabilities: ['batch_api', 'structured_output', 'thinking'],\n tools: ['google_search'],\n },\n pricing: {\n input: {\n normal: 0.25,\n },\n output: {\n normal: 1.5,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\n/**\n * Gemini 3.1 Flash Lite Image (\"Nano Banana 2 Lite\") — GA. 1K output only.\n * @see https://ai.google.dev/gemini-api/docs/models/gemini-3.1-flash-lite-image\n */\nconst GEMINI_3_1_FLASH_LITE_IMAGE = {\n name: 'gemini-3.1-flash-lite-image',\n max_input_tokens: 65_536,\n max_output_tokens: 65_536,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'image'],\n output: ['text', 'image'],\n capabilities: ['batch_api', 'structured_output', 'thinking'],\n tools: ['google_search'],\n },\n pricing: {\n input: {\n normal: 0.25,\n },\n output: {\n normal: 1.5,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\nconst GEMINI_3_1_FLASH_LITE = {\n name: 'gemini-3.1-flash-lite',\n max_input_tokens: 1_048_576,\n max_output_tokens: 65_536,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'image', 'audio', 'video', 'document'],\n output: ['text'],\n capabilities: [\n 'batch_api',\n 'caching',\n 'function_calling',\n 'structured_output',\n 'thinking',\n ],\n tools: ['code_execution', 'file_search', 'google_search', 'url_context'],\n },\n pricing: {\n input: {\n normal: 0.25,\n },\n output: {\n normal: 1.5,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\nconst GEMINI_3_1_FLASH_LITE_PREVIEW = {\n name: 'gemini-3.1-flash-lite-preview',\n max_input_tokens: 1_048_576,\n max_output_tokens: 65_536,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'image', 'audio', 'video', 'document'],\n output: ['text'],\n capabilities: [\n 'batch_api',\n 'caching',\n 'function_calling',\n 'structured_output',\n 'thinking',\n ],\n tools: ['code_execution', 'file_search', 'google_search', 'url_context'],\n },\n pricing: {\n input: {\n normal: 0.25,\n },\n output: {\n normal: 1.5,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\nconst GEMINI_2_5_PRO = {\n name: 'gemini-2.5-pro',\n max_input_tokens: 1_048_576,\n max_output_tokens: 65_536,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'image', 'audio', 'video', 'document'],\n output: ['text'],\n capabilities: [\n 'batch_api',\n 'caching',\n 'function_calling',\n 'structured_output',\n 'thinking',\n ],\n tools: [\n 'code_execution',\n 'file_search',\n 'google_maps',\n 'google_search',\n 'url_context',\n ],\n },\n pricing: {\n input: {\n normal: 2.5,\n },\n output: {\n normal: 15,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\nconst GEMINI_2_5_PRO_TTS = {\n name: 'gemini-2.5-pro-preview-tts',\n max_input_tokens: 8_192,\n max_output_tokens: 16_384,\n knowledge_cutoff: '2025-05-01',\n supports: {\n input: ['text'],\n output: ['audio'],\n capabilities: ['audio_generation'],\n },\n pricing: {\n input: {\n normal: 2.5,\n },\n output: {\n normal: 15,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions\n>\n\nconst GEMINI_2_5_FLASH = {\n name: 'gemini-2.5-flash',\n max_input_tokens: 1_048_576,\n max_output_tokens: 65_536,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'image', 'audio', 'video'],\n output: ['text'],\n capabilities: [\n 'batch_api',\n 'caching',\n 'function_calling',\n 'structured_output',\n 'thinking',\n ],\n tools: [\n 'code_execution',\n 'file_search',\n 'google_maps',\n 'google_search',\n 'url_context',\n ],\n },\n pricing: {\n input: {\n normal: 1,\n },\n output: {\n normal: 2.5,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\n/**\n * Gemini 2.5 Flash Image (\"Nano Banana\") — still GA, but documented as the\n * legacy member of the family. Google publishes no `image_size` value for it,\n * so its size type is a bare aspect ratio and the adapter sends no\n * `imageConfig.imageSize`.\n * @deprecated `gemini-2.5-flash-image` shuts down on 2026-10-02. Migrate to\n * `gemini-3.1-flash-lite-image` (cheapest successor) or\n * `gemini-3.1-flash-image`. Google's deprecations table still names the\n * already-dead `gemini-3.1-flash-image-preview` as the replacement.\n * @see https://ai.google.dev/gemini-api/docs/deprecations\n */\nconst GEMINI_2_5_FLASH_IMAGE = {\n name: 'gemini-2.5-flash-image',\n max_input_tokens: 1_048_576,\n max_output_tokens: 65_536,\n knowledge_cutoff: '2025-06-01',\n supports: {\n input: ['text', 'image'],\n output: ['text', 'image'],\n capabilities: ['batch_api', 'caching', 'structured_output'],\n tools: ['file_search'],\n },\n pricing: {\n input: {\n normal: 0.3,\n },\n output: {\n normal: 0.4,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions\n>\n/**\nconst GEMINI_2_5_FLASH_LIVE = {\n name: 'gemini-2.5-flash-native-audio-preview-09-2025',\n max_input_tokens: 141_072,\n max_output_tokens: 8_192,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'audio', 'video'],\n output: ['text', 'audio'],\n capabilities: [\n 'audio_generation',\n 'file_search',\n 'function_calling',\n 'live_api',\n 'search_grounding',\n 'thinking',\n ],\n },\n pricing: {\n // todo find this info\n input: {\n normal: 0,\n },\n output: {\n normal: 0,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiGenerationConfigOptions &\n GeminiCachedContentOptions &\n GeminiThinkingOptions\n>\n*/\nconst GEMINI_2_5_FLASH_TTS = {\n name: 'gemini-2.5-flash-preview-tts',\n max_input_tokens: 8_192,\n max_output_tokens: 16_384,\n knowledge_cutoff: '2025-05-01',\n supports: {\n input: ['text'],\n output: ['audio'],\n capabilities: ['audio_generation', 'batch_api'],\n },\n pricing: {\n input: {\n normal: 1,\n },\n output: {\n normal: 2.5,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions\n>\n\n/**\n * Gemini 3.1 Flash TTS Preview - latest expressive TTS model with\n * 200+ audio tags, 70+ languages, and multi-speaker dialogue support.\n * @see https://ai.google.dev/gemini-api/docs/models/gemini-3.1-flash-tts-preview\n */\nconst GEMINI_3_1_FLASH_TTS = {\n name: 'gemini-3.1-flash-tts-preview',\n max_input_tokens: 32_768,\n max_output_tokens: 16_384,\n knowledge_cutoff: '2025-05-01',\n supports: {\n input: ['text'],\n output: ['audio'],\n capabilities: ['audio_generation', 'batch_api'],\n },\n pricing: {\n input: {\n normal: 0.5,\n },\n output: {\n normal: 10,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions\n>\n\n/**\n * Lyria 3 Pro Preview — Google's flagship music generation model.\n * Generates full-length songs with multiple verses, choruses, and bridges.\n * Outputs MP3 or WAV at 48 kHz stereo.\n * @see https://ai.google.dev/gemini-api/docs/models/lyria-3-pro-preview\n */\nconst LYRIA_3_PRO = {\n name: 'lyria-3-pro-preview',\n max_input_tokens: 131_072,\n supports: {\n input: ['text', 'image'],\n output: ['audio'],\n capabilities: ['audio_generation'],\n },\n pricing: {\n input: {\n normal: 0,\n },\n output: {\n normal: 0,\n },\n },\n} as const satisfies ModelMeta\n\n/**\n * Lyria 3 Clip Preview — 30-second music clips in MP3 format.\n * @see https://ai.google.dev/gemini-api/docs/music-generation\n */\nconst LYRIA_3_CLIP = {\n name: 'lyria-3-clip-preview',\n max_input_tokens: 131_072,\n supports: {\n input: ['text', 'image'],\n output: ['audio'],\n capabilities: ['audio_generation'],\n },\n pricing: {\n input: {\n normal: 0,\n },\n output: {\n normal: 0,\n },\n },\n} as const satisfies ModelMeta\n\nconst GEMINI_2_5_FLASH_LITE = {\n name: 'gemini-2.5-flash-lite',\n max_input_tokens: 1_048_576,\n max_output_tokens: 65_536,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'image', 'audio', 'video', 'document'],\n output: ['text'],\n capabilities: [\n 'batch_api',\n 'caching',\n 'function_calling',\n 'structured_output',\n 'thinking',\n ],\n tools: ['code_execution', 'google_maps', 'google_search', 'url_context'],\n },\n pricing: {\n input: {\n normal: 0.1,\n },\n output: {\n normal: 0.4,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\nconst IMAGEN_4_GENERATE = {\n name: 'imagen-4.0-generate-001',\n max_input_tokens: 480,\n max_output_tokens: 4,\n supports: {\n input: ['text'],\n output: ['image'],\n },\n pricing: {\n input: {\n normal: 0,\n },\n output: {\n normal: 0.4,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions\n>\n\nconst IMAGEN_4_GENERATE_ULTRA = {\n name: 'imagen-4.0-ultra-generate-001',\n max_input_tokens: 480,\n max_output_tokens: 4,\n supports: {\n input: ['text'],\n output: ['image'],\n },\n pricing: {\n input: {\n normal: 0,\n },\n output: {\n normal: 0.6,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions\n>\n\nconst IMAGEN_4_GENERATE_FAST = {\n name: 'imagen-4.0-fast-generate-001',\n max_input_tokens: 480,\n max_output_tokens: 4,\n supports: {\n input: ['text'],\n output: ['image'],\n },\n pricing: {\n input: {\n normal: 0,\n },\n output: {\n normal: 0.2,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions\n>\n\n/**\n * Veo video generation models. Pricing is per second of generated video\n * (audio+video rate where the model supports audio).\n * @experimental Veo video generation is an experimental feature and may change.\n */\nconst VEO_3_1_PREVIEW = {\n name: 'veo-3.1-generate-preview',\n max_input_tokens: 1024,\n max_output_tokens: 1,\n supports: {\n input: ['text', 'image'],\n output: ['video', 'audio'],\n },\n pricing: {\n input: {\n normal: 0,\n },\n output: {\n normal: 0.4,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions\n>\n\nconst VEO_3_1_FAST_PREVIEW = {\n name: 'veo-3.1-fast-generate-preview',\n max_input_tokens: 1024,\n max_output_tokens: 1,\n supports: {\n input: ['text', 'image'],\n output: ['video', 'audio'],\n },\n pricing: {\n input: {\n normal: 0,\n },\n output: {\n normal: 0.15,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions\n>\n\nconst VEO_3_1_LITE_PREVIEW = {\n name: 'veo-3.1-lite-generate-preview',\n max_input_tokens: 1024,\n max_output_tokens: 1,\n supports: {\n input: ['text', 'image'],\n output: ['video', 'audio'],\n },\n pricing: {\n input: {\n normal: 0,\n },\n output: {\n normal: 0.05,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions\n>\n\n/**\n * Gemini Omni 1.1 Flash — GA. Multimodal video generation with\n * conversational editing. Serves only the Interactions API\n * (`generateContent` rejects it), so it routes through the\n * interactions-based path of the video adapter, not Veo's\n * `:predictLongRunning` flow. Pricing is per second of generated video\n * ($0.10/sec). 360p / 720p (default) / 1080p / 4k at 24 FPS, 3–10 second\n * clips (default 10s).\n * @see https://ai.google.dev/gemini-api/docs/models/gemini-omni-flash\n * @experimental Omni video generation is an experimental feature and may change.\n */\nconst GEMINI_OMNI_1_1_FLASH = {\n name: 'gemini-omni-1.1-flash',\n max_input_tokens: 1_048_576,\n max_output_tokens: 1,\n supports: {\n input: ['text', 'image', 'video'],\n output: ['video', 'audio'],\n },\n pricing: {\n input: {\n normal: 0,\n },\n output: {\n normal: 0.1,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions\n>\n\n/**\n * @deprecated `gemini-omni-flash-preview` shuts down on 2026-09-30. Use the\n * GA id `gemini-omni-1.1-flash` instead. Kept in the model union so existing\n * code still compiles until shutdown.\n * @see https://ai.google.dev/gemini-api/docs/models/gemini-omni-flash\n * @experimental Omni video generation is an experimental feature and may change.\n */\nconst GEMINI_OMNI_FLASH_PREVIEW = {\n name: 'gemini-omni-flash-preview',\n max_input_tokens: 1_048_576,\n max_output_tokens: 1,\n supports: {\n input: ['text', 'image', 'video'],\n output: ['video', 'audio'],\n },\n pricing: {\n input: {\n normal: 0,\n },\n output: {\n normal: 0.1,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions\n>\n\nconst GEMINI_3_7_FLASH = {\n name: 'gemini-3.7-flash',\n max_input_tokens: 1_048_576,\n max_output_tokens: 65_536,\n knowledge_cutoff: '2026-03-01',\n supports: {\n input: ['text', 'image', 'video', 'audio', 'document'],\n output: ['text'],\n capabilities: [\n 'agentic_video',\n 'batch_api',\n 'caching',\n 'function_calling',\n 'structured_output',\n 'thinking',\n ],\n tools: [\n 'code_execution',\n 'file_search',\n 'google_search',\n 'google_maps',\n 'url_context',\n 'computer_use',\n ],\n },\n // Currently 50% off through the end of 2026.\n // https://ai.google.dev/gemini-api/docs/pricing#gemini-3.7-flash\n pricing: {\n input: {\n normal: 0.75,\n cached: 0.075,\n },\n output: {\n normal: 3.75,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\nconst GEMINI_3_6_FLASH = {\n name: 'gemini-3.6-flash',\n max_input_tokens: 1_048_576,\n max_output_tokens: 65_536,\n knowledge_cutoff: '2026-03-01',\n supports: {\n input: ['text', 'image', 'video', 'audio', 'document'],\n output: ['text'],\n capabilities: [\n 'agentic_video',\n 'batch_api',\n 'caching',\n 'function_calling',\n 'structured_output',\n 'thinking',\n ],\n tools: [\n 'code_execution',\n 'file_search',\n 'google_search',\n 'google_maps',\n 'url_context',\n 'computer_use',\n ],\n },\n pricing: {\n input: {\n normal: 1.5,\n cached: 0.15,\n },\n output: {\n normal: 7.5,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\nconst GEMINI_3_5_FLASH = {\n name: 'gemini-3.5-flash',\n max_input_tokens: 1_048_576,\n max_output_tokens: 65_536,\n supports: {\n input: ['text', 'image', 'video', 'document', 'audio'],\n output: ['text'],\n capabilities: [\n 'batch_api',\n 'caching',\n 'function_calling',\n 'structured_output',\n 'thinking',\n ],\n tools: [\n 'code_execution',\n 'file_search',\n 'google_search',\n 'google_maps',\n 'url_context',\n 'computer_use',\n ],\n },\n pricing: {\n input: {\n normal: 1.5,\n cached: 0.15,\n },\n output: {\n normal: 9,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\nconst GEMINI_3_5_FLASH_LITE = {\n name: 'gemini-3.5-flash-lite',\n max_input_tokens: 1_048_576,\n max_output_tokens: 65_536,\n knowledge_cutoff: '2025-01-01',\n supports: {\n input: ['text', 'image', 'video', 'audio', 'document'],\n output: ['text'],\n capabilities: [\n 'agentic_video',\n 'batch_api',\n 'caching',\n 'function_calling',\n 'structured_output',\n 'thinking',\n ],\n tools: [\n 'code_execution',\n 'file_search',\n 'google_search',\n 'google_maps',\n 'url_context',\n ],\n },\n pricing: {\n input: {\n normal: 0.3,\n cached: 0.03,\n },\n output: {\n normal: 2.5,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n>\n\nexport const GEMINI_MODELS = [\n GEMINI_3_7_FLASH.name,\n GEMINI_3_6_FLASH.name,\n GEMINI_3_5_FLASH.name,\n GEMINI_3_5_FLASH_LITE.name,\n GEMINI_3_1_PRO.name,\n GEMINI_3_FLASH.name,\n GEMINI_3_1_FLASH_LITE.name,\n GEMINI_3_1_FLASH_LITE_PREVIEW.name,\n GEMINI_2_5_PRO.name,\n GEMINI_2_5_FLASH.name,\n GEMINI_2_5_FLASH_LITE.name,\n] as const\n\n/**\n * Gemini models that support combining `tools` + `responseSchema` in a\n * single streaming `generateContent` call (per issue #605). Per the\n * provider matrix, Gemini 3.x natively interleaves the schema-constrained\n * answer with function-calling on one pass; Gemini 2.x is unsupported /\n * brittle and keeps the engine's legacy finalization fallback.\n */\nexport const GEMINI_COMBINED_TOOLS_AND_SCHEMA_MODELS = new Set<string>([\n GEMINI_3_7_FLASH.name,\n GEMINI_3_6_FLASH.name,\n GEMINI_3_5_FLASH.name,\n GEMINI_3_5_FLASH_LITE.name,\n GEMINI_3_1_PRO.name,\n GEMINI_3_FLASH.name,\n GEMINI_3_1_FLASH_LITE.name,\n GEMINI_3_1_FLASH_LITE_PREVIEW.name,\n])\n\nexport type GeminiModels = (typeof GEMINI_MODELS)[number]\n\n/**\n * @deprecated Shut down 2026-06-25. Use `gemini-3.1-flash-image`.\n */\ntype Gemini31FlashImagePreviewModel = 'gemini-3.1-flash-image-preview'\n\n/**\n * @deprecated Shut down 2026-06-25. Use `gemini-3-pro-image`.\n */\ntype Gemini3ProImagePreviewModel = 'gemini-3-pro-image-preview'\n\nexport type GeminiImageModels =\n | Exclude<\n (typeof GEMINI_IMAGE_MODELS)[number],\n Gemini31FlashImagePreviewModel | Gemini3ProImagePreviewModel\n >\n | Gemini31FlashImagePreviewModel\n | Gemini3ProImagePreviewModel\n\n/**\n * Image generation models. GA ids come first; the trailing `-preview` ids are\n * shut-down aliases kept only so existing code keeps compiling — new code\n * should use the GA id above its alias.\n */\nexport const GEMINI_IMAGE_MODELS = [\n GEMINI_3_1_FLASH_IMAGE.name,\n GEMINI_3_1_FLASH_LITE_IMAGE.name,\n GEMINI_3_PRO_IMAGE.name,\n GEMINI_2_5_FLASH_IMAGE.name,\n IMAGEN_4_GENERATE.name,\n IMAGEN_4_GENERATE_FAST.name,\n IMAGEN_4_GENERATE_ULTRA.name,\n // Deprecated aliases — shut down 2026-06-25.\n GEMINI_3_1_FLASH_IMAGE_PREVIEW.name,\n GEMINI_3_PRO_IMAGE_PREVIEW.name,\n] as const\n\n/**\n * Text-to-speech models\n * @experimental Gemini TTS is an experimental feature and may change.\n */\nexport const GEMINI_TTS_MODELS = [\n GEMINI_3_1_FLASH_TTS.name,\n GEMINI_2_5_FLASH_TTS.name,\n GEMINI_2_5_PRO_TTS.name,\n] as const\n\n/**\n * Audio generation models (Lyria music generation).\n * @experimental Lyria music generation is an experimental feature and may change.\n */\nexport const GEMINI_AUDIO_MODELS = [\n LYRIA_3_PRO.name,\n LYRIA_3_CLIP.name,\n] as const\n\n/**\n * Available voice names for Gemini TTS\n * @see https://ai.google.dev/gemini-api/docs/speech-generation\n */\nexport const GEMINI_TTS_VOICES = [\n 'Zephyr',\n 'Puck',\n 'Charon',\n 'Kore',\n 'Fenrir',\n 'Leda',\n 'Orus',\n 'Aoede',\n 'Callirrhoe',\n 'Autonoe',\n 'Enceladus',\n 'Iapetus',\n 'Umbriel',\n 'Algieba',\n 'Despina',\n 'Erinome',\n 'Algenib',\n 'Rasalgethi',\n 'Laomedeia',\n 'Achernar',\n 'Alnilam',\n 'Schedar',\n 'Gacrux',\n 'Pulcherrima',\n 'Achird',\n 'Zubenelgenubi',\n 'Vindemiatrix',\n 'Sadachbia',\n 'Sadaltager',\n 'Sulafat',\n] as const\n\nexport type GeminiTTSVoice = (typeof GEMINI_TTS_VOICES)[number]\n\n/**\n * Video generation models. Veo models run on the long-running\n * `:predictLongRunning` flow; Gemini Omni Flash runs on the Interactions\n * API — the video adapter routes by model.\n * @experimental Video generation is an experimental feature and may change.\n */\nexport const GEMINI_VIDEO_MODELS = [\n VEO_3_1_PREVIEW.name,\n VEO_3_1_FAST_PREVIEW.name,\n VEO_3_1_LITE_PREVIEW.name,\n GEMINI_OMNI_1_1_FLASH.name,\n // Deprecated alias — shuts down 2026-09-30.\n GEMINI_OMNI_FLASH_PREVIEW.name,\n] as const\n\n/**\n * Video models served by the Interactions API rather than Veo's\n * `:predictLongRunning` operations flow. GA id first; the trailing\n * `-preview` id is a shutdown alias kept so existing code compiles.\n * @experimental Omni video generation is an experimental feature and may change.\n */\nexport const GEMINI_INTERACTIONS_VIDEO_MODELS = [\n GEMINI_OMNI_1_1_FLASH.name,\n GEMINI_OMNI_FLASH_PREVIEW.name,\n] as const\n\n/**\n * Embedding models\n */\nexport const GEMINI_EMBEDDING_MODELS = ['gemini-embedding-001'] as const\n\nexport type GeminiEmbeddingModel = (typeof GEMINI_EMBEDDING_MODELS)[number]\n\n/**\n * Type-only map from embedding model name to its provider options type.\n */\nexport type GeminiEmbeddingModelProviderOptionsByName = {\n 'gemini-embedding-001': GeminiEmbeddingProviderOptions\n}\n\n/**\n * Per-model input modalities for embedding models. Gemini embedding models\n * are text-only, so image inputs fail at compile time.\n */\nexport type GeminiEmbeddingModelInputModalitiesByName = {\n 'gemini-embedding-001': readonly ['text']\n}\n\n// Manual type map for per-model provider options\nexport type GeminiChatModelProviderOptionsByName = {\n // Models with thinking and structured output support\n [GEMINI_3_7_FLASH.name]: GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n [GEMINI_3_6_FLASH.name]: GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n [GEMINI_3_5_FLASH.name]: GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n [GEMINI_3_5_FLASH_LITE.name]: GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n [GEMINI_3_1_PRO.name]: GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n [GEMINI_3_FLASH.name]: GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n [GEMINI_3_1_FLASH_LITE.name]: GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n [GEMINI_3_1_FLASH_LITE_PREVIEW.name]: GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n [GEMINI_2_5_PRO.name]: GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n [GEMINI_2_5_FLASH.name]: GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n [GEMINI_2_5_FLASH_LITE.name]: GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n}\n\n/**\n * Type-only map from chat model name to its supported tool capabilities.\n * Based on the 'supports.tools' arrays defined for each model.\n */\nexport type GeminiChatModelToolCapabilitiesByName = {\n [GEMINI_3_7_FLASH.name]: typeof GEMINI_3_7_FLASH.supports.tools\n [GEMINI_3_6_FLASH.name]: typeof GEMINI_3_6_FLASH.supports.tools\n [GEMINI_3_5_FLASH.name]: typeof GEMINI_3_5_FLASH.supports.tools\n [GEMINI_3_5_FLASH_LITE.name]: typeof GEMINI_3_5_FLASH_LITE.supports.tools\n [GEMINI_3_1_PRO.name]: typeof GEMINI_3_1_PRO.supports.tools\n [GEMINI_3_FLASH.name]: typeof GEMINI_3_FLASH.supports.tools\n [GEMINI_3_1_FLASH_LITE.name]: typeof GEMINI_3_1_FLASH_LITE.supports.tools\n [GEMINI_3_1_FLASH_LITE_PREVIEW.name]: typeof GEMINI_3_1_FLASH_LITE_PREVIEW.supports.tools\n [GEMINI_2_5_PRO.name]: typeof GEMINI_2_5_PRO.supports.tools\n [GEMINI_2_5_FLASH.name]: typeof GEMINI_2_5_FLASH.supports.tools\n [GEMINI_2_5_FLASH_LITE.name]: typeof GEMINI_2_5_FLASH_LITE.supports.tools\n}\n\n/**\n * Type-only map from chat model name to its supported input modalities.\n * Based on the 'supports.input' arrays defined for each model.\n * Note: 'document' in the model meta is mapped to 'document' modality.\n * Used by the core AI types to constrain ContentPart types based on the selected model.\n * Note: These must be inlined as readonly arrays (not typeof) because the model\n * constants are not exported and typeof references don't work in .d.ts files\n * when consumed by external packages.\n *\n * @see https://ai.google.dev/gemini-api/docs/vision\n * @see https://ai.google.dev/gemini-api/docs/audio\n * @see https://ai.google.dev/gemini-api/docs/document-processing\n */\nexport type GeminiModelInputModalitiesByName = {\n // Models with full multimodal support (text, image, audio, video, document)\n [GEMINI_3_7_FLASH.name]: typeof GEMINI_3_7_FLASH.supports.input\n [GEMINI_3_6_FLASH.name]: typeof GEMINI_3_6_FLASH.supports.input\n [GEMINI_3_5_FLASH.name]: typeof GEMINI_3_5_FLASH.supports.input\n [GEMINI_3_5_FLASH_LITE.name]: typeof GEMINI_3_5_FLASH_LITE.supports.input\n [GEMINI_3_1_PRO.name]: typeof GEMINI_3_1_PRO.supports.input\n [GEMINI_3_FLASH.name]: typeof GEMINI_3_FLASH.supports.input\n [GEMINI_3_1_FLASH_LITE.name]: typeof GEMINI_3_1_FLASH_LITE.supports.input\n [GEMINI_3_1_FLASH_LITE_PREVIEW.name]: typeof GEMINI_3_1_FLASH_LITE_PREVIEW.supports.input\n [GEMINI_2_5_PRO.name]: typeof GEMINI_2_5_PRO.supports.input\n [GEMINI_2_5_FLASH_LITE.name]: typeof GEMINI_2_5_FLASH_LITE.supports.input\n\n // Models with text, image, audio, video (no document)\n [GEMINI_2_5_FLASH.name]: typeof GEMINI_2_5_FLASH.supports.input\n}\n"],"mappings":";AAqDA,IAAM,iBAAiB;CACrB,MAAM;CACN,kBAAkB;CAClB,mBAAmB;CACnB,kBAAkB;CAClB,UAAU;EACR,OAAO;GAAC;GAAQ;GAAS;GAAS;GAAS;EAAU;EACrD,QAAQ,CAAC,MAAM;EACf,cAAc;GACZ;GACA;GACA;GACA;GACA;EACF;EACA,OAAO;GAAC;GAAkB;GAAe;GAAiB;EAAa;CACzE;CACA,SAAS;EACP,O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BAA+B;CAC/B,2BAA2B;AAC7B;;;;;AAMA,IAAa,oBAAoB;CAC/B,qBAAqB;CACrB,qBAAqB;CACrB,mBAAmB;AACrB;;;;;AAMA,IAAa,sBAAsB,CACjC,YAAY,MACZ,aAAa,IACf;;;;;AAMA,IAAa,oBAAoB;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;;;;;;;AAUA,IAAa,sBAAsB;CACjC,gBAAgB;CAChB,qBAAqB;CACrB,qBAAqB;CACrB,sBAAsB;CAEtB,0BAA0B;AAC5B;;;;;;;AAQA,IAAa,mCAAmC,CAC9C,sBAAsB,MACtB,0BAA0B,IAC5B;;;;AAKA,IAAa,0BAA0B,CAAC,sBAAsB"}
@@ -59,7 +59,7 @@ function convertToolsToProviderFormat(tools) {
59
59
  functionDeclarations.push({
60
60
  name: tool.name,
61
61
  description: tool.description,
62
- parameters: tool.inputSchema ?? {
62
+ parametersJsonSchema: tool.inputSchema ?? {
63
63
  type: "object",
64
64
  properties: {},
65
65
  required: []
@@ -1 +1 @@
1
- {"version":3,"file":"tool-converter.js","names":[],"sources":["../../../src/tools/tool-converter.ts"],"sourcesContent":["import { assertUniqueToolNames } from '@tanstack/ai/adapter-internals'\nimport { convertCodeExecutionToolToAdapterFormat } from './code-execution-tool'\nimport { convertComputerUseToolToAdapterFormat } from './computer-use-tool'\nimport { convertFileSearchToolToAdapterFormat } from './file-search-tool'\nimport { getGeminiProviderToolKind } from './gemini-provider-tool'\nimport { convertGoogleMapsToolToAdapterFormat } from './google-maps-tool'\nimport { convertGoogleSearchRetrievalToolToAdapterFormat } from './google-search-retriveal-tool'\nimport { convertGoogleSearchToolToAdapterFormat } from './google-search-tool'\nimport { convertUrlContextToolToAdapterFormat } from './url-context-tool'\nimport type { Tool } from '@tanstack/ai'\nimport type { ToolUnion } from '@google/genai'\n\n/**\n * Converts standard Tool format to Gemini-specific tool format\n *\n * @param tools - Array of standard Tool objects\n * @returns Array of Gemini-specific tool definitions\n *\n * @example\n * ```typescript\n * const tools: Tool[] = [{\n * name: \"get_weather\",\n * description: \"Get weather for a location\",\n * inputSchema: z.object({\n * location: z.string()\n * })\n * }];\n *\n * const geminiTools = convertToolsToProviderFormat(tools);\n * ```\n */\nexport function convertToolsToProviderFormat<TTool extends Tool>(\n tools: Array<TTool> | undefined,\n): Array<ToolUnion> {\n if (!tools || tools.length === 0) {\n return []\n }\n assertUniqueToolNames(tools)\n const result: Array<ToolUnion> = []\n const functionDeclarations: Array<{\n name: string\n description?: string\n parameters?: any\n }> = []\n\n // Process each tool and group function declarations together\n for (const tool of tools) {\n switch (getGeminiProviderToolKind(tool)) {\n case 'code_execution':\n result.push(convertCodeExecutionToolToAdapterFormat(tool))\n break\n case 'computer_use':\n result.push(convertComputerUseToolToAdapterFormat(tool))\n break\n case 'file_search':\n result.push(convertFileSearchToolToAdapterFormat(tool))\n break\n case 'google_maps':\n result.push(convertGoogleMapsToolToAdapterFormat(tool))\n break\n case 'google_search_retrieval':\n result.push(convertGoogleSearchRetrievalToolToAdapterFormat(tool))\n break\n case 'google_search':\n result.push(convertGoogleSearchToolToAdapterFormat(tool))\n break\n case 'url_context':\n result.push(convertUrlContextToolToAdapterFormat(tool))\n break\n case undefined:\n // Collect function declarations to group together\n // Description is required for Gemini function declarations\n if (!tool.description) {\n throw new Error(\n `Tool ${tool.name} requires a description for Gemini adapter`,\n )\n }\n\n // Tool schemas are already converted to JSON Schema in the ai layer\n functionDeclarations.push({\n name: tool.name,\n description: tool.description,\n parameters: tool.inputSchema ?? {\n type: 'object',\n properties: {},\n required: [],\n },\n })\n break\n }\n }\n\n // If we have function declarations, add them as a single tool\n if (functionDeclarations.length > 0) {\n result.push({\n functionDeclarations: functionDeclarations,\n })\n }\n\n return result\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,SAAgB,6BACd,OACkB;CAClB,IAAI,CAAC,SAAS,MAAM,WAAW,GAC7B,OAAO,CAAC;CAEV,sBAAsB,KAAK;CAC3B,MAAM,SAA2B,CAAC;CAClC,MAAM,uBAID,CAAC;CAGN,KAAK,MAAM,QAAQ,OACjB,QAAQ,0BAA0B,IAAI,GAAtC;EACE,KAAK;GACH,OAAO,KAAK,wCAAwC,IAAI,CAAC;GACzD;EACF,KAAK;GACH,OAAO,KAAK,sCAAsC,IAAI,CAAC;GACvD;EACF,KAAK;GACH,OAAO,KAAK,qCAAqC,IAAI,CAAC;GACtD;EACF,KAAK;GACH,OAAO,KAAK,qCAAqC,IAAI,CAAC;GACtD;EACF,KAAK;GACH,OAAO,KAAK,gDAAgD,IAAI,CAAC;GACjE;EACF,KAAK;GACH,OAAO,KAAK,uCAAuC,IAAI,CAAC;GACxD;EACF,KAAK;GACH,OAAO,KAAK,qCAAqC,IAAI,CAAC;GACtD;EACF,KAAK,KAAA;GAGH,IAAI,CAAC,KAAK,aACR,MAAM,IAAI,MACR,QAAQ,KAAK,KAAK,2CACpB;GAIF,qBAAqB,KAAK;IACxB,MAAM,KAAK;IACX,aAAa,KAAK;IAClB,YAAY,KAAK,eAAe;KAC9B,MAAM;KACN,YAAY,CAAC;KACb,UAAU,CAAC;IACb;GACF,CAAC;CAEL;CAIF,IAAI,qBAAqB,SAAS,GAChC,OAAO,KAAK,EACY,qBACxB,CAAC;CAGH,OAAO;AACT"}
1
+ {"version":3,"file":"tool-converter.js","names":[],"sources":["../../../src/tools/tool-converter.ts"],"sourcesContent":["import { assertUniqueToolNames } from '@tanstack/ai/adapter-internals'\nimport { convertCodeExecutionToolToAdapterFormat } from './code-execution-tool'\nimport { convertComputerUseToolToAdapterFormat } from './computer-use-tool'\nimport { convertFileSearchToolToAdapterFormat } from './file-search-tool'\nimport { getGeminiProviderToolKind } from './gemini-provider-tool'\nimport { convertGoogleMapsToolToAdapterFormat } from './google-maps-tool'\nimport { convertGoogleSearchRetrievalToolToAdapterFormat } from './google-search-retriveal-tool'\nimport { convertGoogleSearchToolToAdapterFormat } from './google-search-tool'\nimport { convertUrlContextToolToAdapterFormat } from './url-context-tool'\nimport type { Tool } from '@tanstack/ai'\nimport type { FunctionDeclaration, ToolUnion } from '@google/genai'\n\n/**\n * Converts standard Tool format to Gemini-specific tool format\n *\n * @param tools - Array of standard Tool objects\n * @returns Array of Gemini-specific tool definitions\n *\n * @example\n * ```typescript\n * const tools: Tool[] = [{\n * name: \"get_weather\",\n * description: \"Get weather for a location\",\n * inputSchema: z.object({\n * location: z.string()\n * })\n * }];\n *\n * const geminiTools = convertToolsToProviderFormat(tools);\n * ```\n */\nexport function convertToolsToProviderFormat<TTool extends Tool>(\n tools: Array<TTool> | undefined,\n): Array<ToolUnion> {\n if (!tools || tools.length === 0) {\n return []\n }\n assertUniqueToolNames(tools)\n const result: Array<ToolUnion> = []\n const functionDeclarations: Array<FunctionDeclaration> = []\n\n // Process each tool and group function declarations together\n for (const tool of tools) {\n switch (getGeminiProviderToolKind(tool)) {\n case 'code_execution':\n result.push(convertCodeExecutionToolToAdapterFormat(tool))\n break\n case 'computer_use':\n result.push(convertComputerUseToolToAdapterFormat(tool))\n break\n case 'file_search':\n result.push(convertFileSearchToolToAdapterFormat(tool))\n break\n case 'google_maps':\n result.push(convertGoogleMapsToolToAdapterFormat(tool))\n break\n case 'google_search_retrieval':\n result.push(convertGoogleSearchRetrievalToolToAdapterFormat(tool))\n break\n case 'google_search':\n result.push(convertGoogleSearchToolToAdapterFormat(tool))\n break\n case 'url_context':\n result.push(convertUrlContextToolToAdapterFormat(tool))\n break\n case undefined:\n // Collect function declarations to group together\n // Description is required for Gemini function declarations\n if (!tool.description) {\n throw new Error(\n `Tool ${tool.name} requires a description for Gemini adapter`,\n )\n }\n\n // Tool schemas are already converted to JSON Schema in the ai layer\n functionDeclarations.push({\n name: tool.name,\n description: tool.description,\n parametersJsonSchema: tool.inputSchema ?? {\n type: 'object',\n properties: {},\n required: [],\n },\n })\n break\n }\n }\n\n // If we have function declarations, add them as a single tool\n if (functionDeclarations.length > 0) {\n result.push({\n functionDeclarations: functionDeclarations,\n })\n }\n\n return result\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,SAAgB,6BACd,OACkB;CAClB,IAAI,CAAC,SAAS,MAAM,WAAW,GAC7B,OAAO,CAAC;CAEV,sBAAsB,KAAK;CAC3B,MAAM,SAA2B,CAAC;CAClC,MAAM,uBAAmD,CAAC;CAG1D,KAAK,MAAM,QAAQ,OACjB,QAAQ,0BAA0B,IAAI,GAAtC;EACE,KAAK;GACH,OAAO,KAAK,wCAAwC,IAAI,CAAC;GACzD;EACF,KAAK;GACH,OAAO,KAAK,sCAAsC,IAAI,CAAC;GACvD;EACF,KAAK;GACH,OAAO,KAAK,qCAAqC,IAAI,CAAC;GACtD;EACF,KAAK;GACH,OAAO,KAAK,qCAAqC,IAAI,CAAC;GACtD;EACF,KAAK;GACH,OAAO,KAAK,gDAAgD,IAAI,CAAC;GACjE;EACF,KAAK;GACH,OAAO,KAAK,uCAAuC,IAAI,CAAC;GACxD;EACF,KAAK;GACH,OAAO,KAAK,qCAAqC,IAAI,CAAC;GACtD;EACF,KAAK,KAAA;GAGH,IAAI,CAAC,KAAK,aACR,MAAM,IAAI,MACR,QAAQ,KAAK,KAAK,2CACpB;GAIF,qBAAqB,KAAK;IACxB,MAAM,KAAK;IACX,aAAa,KAAK;IAClB,sBAAsB,KAAK,eAAe;KACxC,MAAM;KACN,YAAY,CAAC;KACb,UAAU,CAAC;IACb;GACF,CAAC;CAEL;CAIF,IAAI,qBAAqB,SAAS,GAChC,OAAO,KAAK,EACY,qBACxB,CAAC;CAGH,OAAO;AACT"}
@@ -18,14 +18,35 @@ export type GeminiInteractionsVideoModel = (typeof GEMINI_INTERACTIONS_VIDEO_MOD
18
18
  */
19
19
  export declare function isInteractionsVideoModel(model: GeminiVideoModel): model is GeminiInteractionsVideoModel;
20
20
  /**
21
- * Supported aspect ratios for Gemini video generation. This is the `size`
22
- * value for the Gemini video adapter — both Veo and Omni Flash express
23
- * output shape as an aspect ratio (plus an optional `resolution` in Veo's
24
- * `modelOptions`), not pixel dimensions.
21
+ * Aspect ratios for Gemini video generation. Veo `size` is this union.
22
+ * Omni `size` also accepts an `aspectRatio_resolution` suffix
23
+ * (`'16:9_1080p'`), same template as grok / byteplus video.
25
24
  *
26
25
  * @experimental Video generation is an experimental feature and may change.
27
26
  */
28
27
  export type GeminiVideoSize = '16:9' | '9:16';
28
+ /**
29
+ * Omni Flash output resolution. Used as the optional suffix on `size`
30
+ * (`'16:9_1080p'`). Default 720p when omitted.
31
+ *
32
+ * @experimental Omni video generation is an experimental feature and may change.
33
+ */
34
+ export type GeminiOmniVideoResolution = '360p' | '720p' | '1080p' | '4k';
35
+ /**
36
+ * Omni Flash `size`: bare aspect ratio or `aspectRatio_resolution`.
37
+ *
38
+ * @experimental Omni video generation is an experimental feature and may change.
39
+ */
40
+ export type GeminiOmniVideoSize = GeminiVideoSize | `${GeminiVideoSize}_${GeminiOmniVideoResolution}`;
41
+ /**
42
+ * Splits an Omni `size` into aspect ratio and optional resolution.
43
+ * `'16:9_1080p'` → `{ aspectRatio: '16:9', resolution: '1080p' }`.
44
+ * `'9:16'` → `{ aspectRatio: '9:16' }`.
45
+ */
46
+ export declare function parseGeminiOmniVideoSize(size: string): {
47
+ aspectRatio: string;
48
+ resolution?: string;
49
+ } | undefined;
29
50
  /**
30
51
  * Provider-specific options for Gemini Veo video generation.
31
52
  *
@@ -52,7 +73,9 @@ export type GeminiVideoProviderOptions = Omit<GenerateVideosConfig, 'durationSec
52
73
  * and polls it through the `generateVideo` jobs API
53
74
  * - `response_modalities` / `response_format` — the adapter requests video
54
75
  * output and maps the top-level `size` option onto
55
- * `response_format.aspect_ratio`
76
+ * `response_format.aspect_ratio` (and `response_format.resolution` when
77
+ * the size carries a suffix) and `duration` onto
78
+ * `response_format.duration`
56
79
  * - `tools` / `response_mime_type` — not applicable to video generation
57
80
  *
58
81
  * Notable passthroughs:
@@ -74,12 +97,13 @@ export type GeminiVideoModelProviderOptionsByName = {
74
97
  [TModel in GeminiVideoModel]: TModel extends GeminiInteractionsVideoModel ? GeminiOmniVideoProviderOptions : GeminiVideoProviderOptions;
75
98
  };
76
99
  /**
77
- * Model-specific size (aspect ratio) mapping.
100
+ * Model-specific size mapping. Veo is aspect ratio only. Omni accepts the
101
+ * `aspectRatio_resolution` template (`'16:9_1080p'`).
78
102
  *
79
103
  * @experimental Video generation is an experimental feature and may change.
80
104
  */
81
105
  export type GeminiVideoModelSizeByName = {
82
- [TModel in GeminiVideoModel]: GeminiVideoSize;
106
+ [TModel in GeminiVideoModel]: TModel extends GeminiInteractionsVideoModel ? GeminiOmniVideoSize : GeminiVideoSize;
83
107
  };
84
108
  /**
85
109
  * Per-model prompt input modalities. Every Veo model accepts image
@@ -105,6 +129,7 @@ export type GeminiVideoModelDurationByName = {
105
129
  'veo-3.1-generate-preview': 4 | 6 | 8;
106
130
  'veo-3.1-fast-generate-preview': 4 | 6 | 8;
107
131
  'veo-3.1-lite-generate-preview': 4 | 6 | 8;
132
+ 'gemini-omni-1.1-flash': number;
108
133
  'gemini-omni-flash-preview': number;
109
134
  };
110
135
  /**
@@ -19,6 +19,19 @@ function isInteractionsVideoModel(model) {
19
19
  return GEMINI_INTERACTIONS_VIDEO_MODELS.includes(model);
20
20
  }
21
21
  /**
22
+ * Splits an Omni `size` into aspect ratio and optional resolution.
23
+ * `'16:9_1080p'` → `{ aspectRatio: '16:9', resolution: '1080p' }`.
24
+ * `'9:16'` → `{ aspectRatio: '9:16' }`.
25
+ */
26
+ function parseGeminiOmniVideoSize(size) {
27
+ const [, aspectRatio, resolution] = /^(\d+:\d+)(?:_(.+))?$/.exec(size) ?? [];
28
+ if (aspectRatio === void 0) return void 0;
29
+ return {
30
+ aspectRatio,
31
+ ...resolution !== void 0 && { resolution }
32
+ };
33
+ }
34
+ /**
22
35
  * Runtime duration table backing `availableDurations()` / `snapDuration()`.
23
36
  *
24
37
  * Veo values are curated from the official docs
@@ -58,6 +71,12 @@ var GEMINI_VIDEO_DURATIONS = {
58
71
  8
59
72
  ]
60
73
  },
74
+ "gemini-omni-1.1-flash": {
75
+ kind: "range",
76
+ min: 3,
77
+ max: 10,
78
+ unit: "seconds"
79
+ },
61
80
  "gemini-omni-flash-preview": {
62
81
  kind: "range",
63
82
  min: 3,
@@ -74,6 +93,6 @@ function getGeminiVideoDurationOptions(model) {
74
93
  return GEMINI_VIDEO_DURATIONS[model];
75
94
  }
76
95
  //#endregion
77
- export { GEMINI_VIDEO_DURATIONS, getGeminiVideoDurationOptions, isInteractionsVideoModel };
96
+ export { GEMINI_VIDEO_DURATIONS, getGeminiVideoDurationOptions, isInteractionsVideoModel, parseGeminiOmniVideoSize };
78
97
 
79
98
  //# sourceMappingURL=video-provider-options.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"video-provider-options.js","names":[],"sources":["../../../src/video/video-provider-options.ts"],"sourcesContent":["/**\n * Gemini Video Generation Provider Options\n *\n * Covers two request paths behind the one video adapter:\n * - Veo models — long-running operations via `:predictLongRunning`\n * (https://ai.google.dev/gemini-api/docs/video)\n * - Gemini Omni Flash — background jobs via the Interactions API\n * (https://ai.google.dev/gemini-api/docs/omni)\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nimport { GEMINI_INTERACTIONS_VIDEO_MODELS } from '../model-meta'\nimport type { DurationOptions } from '@tanstack/ai/adapters'\nimport type { GenerateVideosConfig, Interactions } from '@google/genai'\nimport type { GEMINI_VIDEO_MODELS } from '../model-meta'\n\n/**\n * Model type for Gemini video generation (Veo + Omni Flash).\n * @experimental Video generation is an experimental feature and may change.\n */\nexport type GeminiVideoModel = (typeof GEMINI_VIDEO_MODELS)[number]\n\n/**\n * Video models served by the Interactions API (Gemini Omni Flash) rather\n * than Veo's `:predictLongRunning` operations flow.\n * @experimental Omni video generation is an experimental feature and may change.\n */\nexport type GeminiInteractionsVideoModel =\n (typeof GEMINI_INTERACTIONS_VIDEO_MODELS)[number]\n\n/**\n * Runtime guard for the Interactions-served video models.\n * @experimental Omni video generation is an experimental feature and may change.\n */\nexport function isInteractionsVideoModel(\n model: GeminiVideoModel,\n): model is GeminiInteractionsVideoModel {\n return (GEMINI_INTERACTIONS_VIDEO_MODELS as ReadonlyArray<string>).includes(\n model,\n )\n}\n\n/**\n * Supported aspect ratios for Gemini video generation. This is the `size`\n * value for the Gemini video adapter — both Veo and Omni Flash express\n * output shape as an aspect ratio (plus an optional `resolution` in Veo's\n * `modelOptions`), not pixel dimensions.\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport type GeminiVideoSize = '16:9' | '9:16'\n\n/**\n * Provider-specific options for Gemini Veo video generation.\n *\n * Derived from the SDK's `GenerateVideosConfig`, minus the fields the\n * adapter manages itself:\n * - `durationSeconds` — set via the typed top-level `duration` option\n * (use `adapter.snapDuration(seconds)` to coerce raw seconds)\n * - `aspectRatio` — set via the top-level `size` option\n * - `lastFrame` / `referenceImages` — set via image parts in the `prompt`\n * with `metadata.role: 'end_frame'` / `'reference'`\n * - `httpOptions` / `abortSignal` — client-level transport concerns\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport type GeminiVideoProviderOptions = Omit<\n GenerateVideosConfig,\n | 'durationSeconds'\n | 'aspectRatio'\n | 'lastFrame'\n | 'referenceImages'\n | 'httpOptions'\n | 'abortSignal'\n>\n\n/**\n * Provider-specific options for Gemini Omni Flash video generation on the\n * Interactions API.\n *\n * Derived from the SDK's `Interactions.CreateModelInteractionParamsNonStreaming`,\n * minus the fields the adapter manages itself:\n * - `model` / `input` — set from the adapter's model and the `prompt`\n * - `stream` / `background` — the adapter always creates a background job\n * and polls it through the `generateVideo` jobs API\n * - `response_modalities` / `response_format` — the adapter requests video\n * output and maps the top-level `size` option onto\n * `response_format.aspect_ratio`\n * - `tools` / `response_mime_type` — not applicable to video generation\n *\n * Notable passthroughs:\n * - `previous_interaction_id` — conversational video editing: chain a new\n * prompt onto a prior Omni interaction to refine its video\n * - `generation_config.video_config.task` — pin the task mode\n * (`'text_to_video' | 'image_to_video' | 'reference_to_video' | 'edit'`)\n * instead of letting the model infer it\n *\n * @experimental Omni video generation is an experimental feature and may change.\n */\nexport type GeminiOmniVideoProviderOptions = Omit<\n Interactions.CreateModelInteractionParamsNonStreaming,\n | 'model'\n | 'input'\n | 'stream'\n | 'background'\n | 'response_modalities'\n | 'response_format'\n | 'response_mime_type'\n | 'tools'\n>\n\n/**\n * Model-specific provider options mapping.\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport type GeminiVideoModelProviderOptionsByName = {\n [TModel in GeminiVideoModel]: TModel extends GeminiInteractionsVideoModel\n ? GeminiOmniVideoProviderOptions\n : GeminiVideoProviderOptions\n}\n\n/**\n * Model-specific size (aspect ratio) mapping.\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport type GeminiVideoModelSizeByName = {\n [TModel in GeminiVideoModel]: GeminiVideoSize\n}\n\n/**\n * Per-model prompt input modalities. Every Veo model accepts image\n * conditioning inputs (first frame, last frame, reference images) alongside\n * the text prompt. Omni Flash additionally accepts video inputs (short\n * reference clips / videos to edit).\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport type GeminiVideoModelInputModalitiesByName = {\n [TModel in GeminiVideoModel]: TModel extends GeminiInteractionsVideoModel\n ? readonly ['image', 'video']\n : readonly ['image']\n}\n\n/**\n * Per-model duration unions (seconds, as numbers — Veo's\n * `parameters.durationSeconds` field is numeric; Omni Flash accepts a\n * continuous 3–10 second range, fractional seconds included, so it stays\n * `number` — the adapter rejects out-of-range values at job creation,\n * against the range entry below).\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport type GeminiVideoModelDurationByName = {\n 'veo-3.1-generate-preview': 4 | 6 | 8\n 'veo-3.1-fast-generate-preview': 4 | 6 | 8\n 'veo-3.1-lite-generate-preview': 4 | 6 | 8\n 'gemini-omni-flash-preview': number\n}\n\n/**\n * Runtime duration table backing `availableDurations()` / `snapDuration()`.\n *\n * Veo values are curated from the official docs\n * (https://ai.google.dev/gemini-api/docs/video) — the Gemini OpenAPI spec\n * types the `:predictLongRunning` request's `parameters` as unconstrained,\n * so it carries no per-model duration information to derive these from.\n * Omni Flash's 3–10s range was verified against the live API\n * (2026-07-02): `response_format.duration` takes a `\"<seconds>s\"` string,\n * fractional values are accepted, out-of-range values are rejected with\n * \"minimum allowed 3s\" / \"maximum allowed 10s\", and omitting it defaults\n * to a 10-second clip.\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport const GEMINI_VIDEO_DURATIONS: {\n readonly [TModel in GeminiVideoModel]: DurationOptions<\n GeminiVideoModelDurationByName[TModel]\n >\n} = {\n 'veo-3.1-generate-preview': { kind: 'discrete', values: [4, 6, 8] },\n 'veo-3.1-fast-generate-preview': { kind: 'discrete', values: [4, 6, 8] },\n 'veo-3.1-lite-generate-preview': { kind: 'discrete', values: [4, 6, 8] },\n 'gemini-omni-flash-preview': {\n kind: 'range',\n min: 3,\n max: 10,\n unit: 'seconds',\n },\n}\n\n/**\n * Look up the duration options for a Gemini video model.\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport function getGeminiVideoDurationOptions<TModel extends GeminiVideoModel>(\n model: TModel,\n): DurationOptions<GeminiVideoModelDurationByName[TModel]> {\n return GEMINI_VIDEO_DURATIONS[model]\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkCA,SAAgB,yBACd,OACuC;CACvC,OAAQ,iCAA2D,SACjE,KACF;AACF;;;;;;;;;;;;;;;;AAwIA,IAAa,yBAIT;CACF,4BAA4B;EAAE,MAAM;EAAY,QAAQ;GAAC;GAAG;GAAG;EAAC;CAAE;CAClE,iCAAiC;EAAE,MAAM;EAAY,QAAQ;GAAC;GAAG;GAAG;EAAC;CAAE;CACvE,iCAAiC;EAAE,MAAM;EAAY,QAAQ;GAAC;GAAG;GAAG;EAAC;CAAE;CACvE,6BAA6B;EAC3B,MAAM;EACN,KAAK;EACL,KAAK;EACL,MAAM;CACR;AACF;;;;;;AAOA,SAAgB,8BACd,OACyD;CACzD,OAAO,uBAAuB;AAChC"}
1
+ {"version":3,"file":"video-provider-options.js","names":[],"sources":["../../../src/video/video-provider-options.ts"],"sourcesContent":["/**\n * Gemini Video Generation Provider Options\n *\n * Covers two request paths behind the one video adapter:\n * - Veo models — long-running operations via `:predictLongRunning`\n * (https://ai.google.dev/gemini-api/docs/video)\n * - Gemini Omni Flash — background jobs via the Interactions API\n * (https://ai.google.dev/gemini-api/docs/omni)\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nimport { GEMINI_INTERACTIONS_VIDEO_MODELS } from '../model-meta'\nimport type { DurationOptions } from '@tanstack/ai/adapters'\nimport type { GenerateVideosConfig, Interactions } from '@google/genai'\nimport type { GEMINI_VIDEO_MODELS } from '../model-meta'\n\n/**\n * Model type for Gemini video generation (Veo + Omni Flash).\n * @experimental Video generation is an experimental feature and may change.\n */\nexport type GeminiVideoModel = (typeof GEMINI_VIDEO_MODELS)[number]\n\n/**\n * Video models served by the Interactions API (Gemini Omni Flash) rather\n * than Veo's `:predictLongRunning` operations flow.\n * @experimental Omni video generation is an experimental feature and may change.\n */\nexport type GeminiInteractionsVideoModel =\n (typeof GEMINI_INTERACTIONS_VIDEO_MODELS)[number]\n\n/**\n * Runtime guard for the Interactions-served video models.\n * @experimental Omni video generation is an experimental feature and may change.\n */\nexport function isInteractionsVideoModel(\n model: GeminiVideoModel,\n): model is GeminiInteractionsVideoModel {\n return (GEMINI_INTERACTIONS_VIDEO_MODELS as ReadonlyArray<string>).includes(\n model,\n )\n}\n\n/**\n * Aspect ratios for Gemini video generation. Veo `size` is this union.\n * Omni `size` also accepts an `aspectRatio_resolution` suffix\n * (`'16:9_1080p'`), same template as grok / byteplus video.\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport type GeminiVideoSize = '16:9' | '9:16'\n\n/**\n * Omni Flash output resolution. Used as the optional suffix on `size`\n * (`'16:9_1080p'`). Default 720p when omitted.\n *\n * @experimental Omni video generation is an experimental feature and may change.\n */\nexport type GeminiOmniVideoResolution = '360p' | '720p' | '1080p' | '4k'\n\n/**\n * Omni Flash `size`: bare aspect ratio or `aspectRatio_resolution`.\n *\n * @experimental Omni video generation is an experimental feature and may change.\n */\nexport type GeminiOmniVideoSize =\n | GeminiVideoSize\n | `${GeminiVideoSize}_${GeminiOmniVideoResolution}`\n\n/**\n * Splits an Omni `size` into aspect ratio and optional resolution.\n * `'16:9_1080p'` → `{ aspectRatio: '16:9', resolution: '1080p' }`.\n * `'9:16'` → `{ aspectRatio: '9:16' }`.\n */\nexport function parseGeminiOmniVideoSize(\n size: string,\n): { aspectRatio: string; resolution?: string } | undefined {\n const match = /^(\\d+:\\d+)(?:_(.+))?$/.exec(size)\n const [, aspectRatio, resolution] = match ?? []\n if (aspectRatio === undefined) return undefined\n return {\n aspectRatio,\n ...(resolution !== undefined && { resolution }),\n }\n}\n\n/**\n * Provider-specific options for Gemini Veo video generation.\n *\n * Derived from the SDK's `GenerateVideosConfig`, minus the fields the\n * adapter manages itself:\n * - `durationSeconds` — set via the typed top-level `duration` option\n * (use `adapter.snapDuration(seconds)` to coerce raw seconds)\n * - `aspectRatio` — set via the top-level `size` option\n * - `lastFrame` / `referenceImages` — set via image parts in the `prompt`\n * with `metadata.role: 'end_frame'` / `'reference'`\n * - `httpOptions` / `abortSignal` — client-level transport concerns\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport type GeminiVideoProviderOptions = Omit<\n GenerateVideosConfig,\n | 'durationSeconds'\n | 'aspectRatio'\n | 'lastFrame'\n | 'referenceImages'\n | 'httpOptions'\n | 'abortSignal'\n>\n\n/**\n * Provider-specific options for Gemini Omni Flash video generation on the\n * Interactions API.\n *\n * Derived from the SDK's `Interactions.CreateModelInteractionParamsNonStreaming`,\n * minus the fields the adapter manages itself:\n * - `model` / `input` — set from the adapter's model and the `prompt`\n * - `stream` / `background` — the adapter always creates a background job\n * and polls it through the `generateVideo` jobs API\n * - `response_modalities` / `response_format` — the adapter requests video\n * output and maps the top-level `size` option onto\n * `response_format.aspect_ratio` (and `response_format.resolution` when\n * the size carries a suffix) and `duration` onto\n * `response_format.duration`\n * - `tools` / `response_mime_type` — not applicable to video generation\n *\n * Notable passthroughs:\n * - `previous_interaction_id` — conversational video editing: chain a new\n * prompt onto a prior Omni interaction to refine its video\n * - `generation_config.video_config.task` — pin the task mode\n * (`'text_to_video' | 'image_to_video' | 'reference_to_video' | 'edit'`)\n * instead of letting the model infer it\n *\n * @experimental Omni video generation is an experimental feature and may change.\n */\nexport type GeminiOmniVideoProviderOptions = Omit<\n Interactions.CreateModelInteractionParamsNonStreaming,\n | 'model'\n | 'input'\n | 'stream'\n | 'background'\n | 'response_modalities'\n | 'response_format'\n | 'response_mime_type'\n | 'tools'\n>\n\n/**\n * Model-specific provider options mapping.\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport type GeminiVideoModelProviderOptionsByName = {\n [TModel in GeminiVideoModel]: TModel extends GeminiInteractionsVideoModel\n ? GeminiOmniVideoProviderOptions\n : GeminiVideoProviderOptions\n}\n\n/**\n * Model-specific size mapping. Veo is aspect ratio only. Omni accepts the\n * `aspectRatio_resolution` template (`'16:9_1080p'`).\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport type GeminiVideoModelSizeByName = {\n [TModel in GeminiVideoModel]: TModel extends GeminiInteractionsVideoModel\n ? GeminiOmniVideoSize\n : GeminiVideoSize\n}\n\n/**\n * Per-model prompt input modalities. Every Veo model accepts image\n * conditioning inputs (first frame, last frame, reference images) alongside\n * the text prompt. Omni Flash additionally accepts video inputs (short\n * reference clips / videos to edit).\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport type GeminiVideoModelInputModalitiesByName = {\n [TModel in GeminiVideoModel]: TModel extends GeminiInteractionsVideoModel\n ? readonly ['image', 'video']\n : readonly ['image']\n}\n\n/**\n * Per-model duration unions (seconds, as numbers — Veo's\n * `parameters.durationSeconds` field is numeric; Omni Flash accepts a\n * continuous 3–10 second range, fractional seconds included, so it stays\n * `number` — the adapter rejects out-of-range values at job creation,\n * against the range entry below).\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport type GeminiVideoModelDurationByName = {\n 'veo-3.1-generate-preview': 4 | 6 | 8\n 'veo-3.1-fast-generate-preview': 4 | 6 | 8\n 'veo-3.1-lite-generate-preview': 4 | 6 | 8\n 'gemini-omni-1.1-flash': number\n 'gemini-omni-flash-preview': number\n}\n\n/**\n * Runtime duration table backing `availableDurations()` / `snapDuration()`.\n *\n * Veo values are curated from the official docs\n * (https://ai.google.dev/gemini-api/docs/video) — the Gemini OpenAPI spec\n * types the `:predictLongRunning` request's `parameters` as unconstrained,\n * so it carries no per-model duration information to derive these from.\n * Omni Flash's 3–10s range was verified against the live API\n * (2026-07-02): `response_format.duration` takes a `\"<seconds>s\"` string,\n * fractional values are accepted, out-of-range values are rejected with\n * \"minimum allowed 3s\" / \"maximum allowed 10s\", and omitting it defaults\n * to a 10-second clip.\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport const GEMINI_VIDEO_DURATIONS: {\n readonly [TModel in GeminiVideoModel]: DurationOptions<\n GeminiVideoModelDurationByName[TModel]\n >\n} = {\n 'veo-3.1-generate-preview': { kind: 'discrete', values: [4, 6, 8] },\n 'veo-3.1-fast-generate-preview': { kind: 'discrete', values: [4, 6, 8] },\n 'veo-3.1-lite-generate-preview': { kind: 'discrete', values: [4, 6, 8] },\n 'gemini-omni-1.1-flash': {\n kind: 'range',\n min: 3,\n max: 10,\n unit: 'seconds',\n },\n 'gemini-omni-flash-preview': {\n kind: 'range',\n min: 3,\n max: 10,\n unit: 'seconds',\n },\n}\n\n/**\n * Look up the duration options for a Gemini video model.\n *\n * @experimental Video generation is an experimental feature and may change.\n */\nexport function getGeminiVideoDurationOptions<TModel extends GeminiVideoModel>(\n model: TModel,\n): DurationOptions<GeminiVideoModelDurationByName[TModel]> {\n return GEMINI_VIDEO_DURATIONS[model]\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkCA,SAAgB,yBACd,OACuC;CACvC,OAAQ,iCAA2D,SACjE,KACF;AACF;;;;;;AAiCA,SAAgB,yBACd,MAC0D;CAE1D,MAAM,GAAG,aAAa,cADR,wBAAwB,KAAK,IACP,KAAS,CAAC;CAC9C,IAAI,gBAAgB,KAAA,GAAW,OAAO,KAAA;CACtC,OAAO;EACL;EACA,GAAI,eAAe,KAAA,KAAa,EAAE,WAAW;CAC/C;AACF;;;;;;;;;;;;;;;;AAoIA,IAAa,yBAIT;CACF,4BAA4B;EAAE,MAAM;EAAY,QAAQ;GAAC;GAAG;GAAG;EAAC;CAAE;CAClE,iCAAiC;EAAE,MAAM;EAAY,QAAQ;GAAC;GAAG;GAAG;EAAC;CAAE;CACvE,iCAAiC;EAAE,MAAM;EAAY,QAAQ;GAAC;GAAG;GAAG;EAAC;CAAE;CACvE,yBAAyB;EACvB,MAAM;EACN,KAAK;EACL,KAAK;EACL,MAAM;CACR;CACA,6BAA6B;EAC3B,MAAM;EACN,KAAK;EACL,KAAK;EACL,MAAM;CACR;AACF;;;;;;AAOA,SAAgB,8BACd,OACyD;CACzD,OAAO,uBAAuB;AAChC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/ai-gemini",
3
- "version": "0.26.4",
3
+ "version": "0.27.0",
4
4
  "description": "Google Gemini adapter for TanStack AI chat, images, speech, audio generation, and structured outputs.",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -63,13 +63,13 @@
63
63
  "@tanstack/ai-utils": "^0.4.0"
64
64
  },
65
65
  "peerDependencies": {
66
- "@tanstack/ai": "^0.52.0"
66
+ "@tanstack/ai": "^0.52.1"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@vitest/coverage-v8": "4.1.10",
70
70
  "vite": "^8.2.1",
71
71
  "zod": "^4.2.0",
72
- "@tanstack/ai": "0.52.0"
72
+ "@tanstack/ai": "0.52.1"
73
73
  },
74
74
  "scripts": {
75
75
  "build": "vite build",