@tanstack/ai-gemini 0.15.1 → 0.16.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.
- package/dist/esm/adapters/summarize.d.ts +2 -2
- package/dist/esm/adapters/summarize.js.map +1 -1
- package/dist/esm/image/image-provider-options.d.ts +1 -1
- package/dist/esm/image/image-provider-options.js.map +1 -1
- package/dist/esm/model-meta.d.ts +16 -107
- package/dist/esm/model-meta.js +7 -27
- package/dist/esm/model-meta.js.map +1 -1
- package/package.json +3 -3
- package/src/adapters/summarize.ts +2 -2
- package/src/image/image-provider-options.ts +0 -1
- package/src/model-meta.ts +43 -298
|
@@ -16,7 +16,7 @@ export type GeminiSummarizeModel = (typeof GEMINI_MODELS)[number];
|
|
|
16
16
|
*
|
|
17
17
|
* @example
|
|
18
18
|
* ```typescript
|
|
19
|
-
* const adapter = createGeminiSummarize('AIza...', 'gemini-2.
|
|
19
|
+
* const adapter = createGeminiSummarize('AIza...', 'gemini-2.5-flash');
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
22
|
export declare function createGeminiSummarize<TModel extends GeminiSummarizeModel>(apiKey: string, model: TModel, config?: Omit<GeminiSummarizeConfig, 'apiKey'>): ChatStreamSummarizeAdapter<TModel, InferTextProviderOptions<GeminiTextAdapter<TModel>>>;
|
|
@@ -26,7 +26,7 @@ export declare function createGeminiSummarize<TModel extends GeminiSummarizeMode
|
|
|
26
26
|
*
|
|
27
27
|
* @example
|
|
28
28
|
* ```typescript
|
|
29
|
-
* const adapter = geminiSummarize('gemini-2.
|
|
29
|
+
* const adapter = geminiSummarize('gemini-2.5-flash');
|
|
30
30
|
* await summarize({ adapter, text: 'Long article text...' });
|
|
31
31
|
* ```
|
|
32
32
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"summarize.js","sources":["../../../src/adapters/summarize.ts"],"sourcesContent":["import { ChatStreamSummarizeAdapter } from '@tanstack/ai/adapters'\nimport { getGeminiApiKeyFromEnv } from '../utils'\nimport { GeminiTextAdapter } from './text'\nimport type { InferTextProviderOptions } from '@tanstack/ai/adapters'\nimport type { GEMINI_MODELS } from '../model-meta'\nimport type { GeminiClientConfig } from '../utils'\n\n/**\n * Configuration for Gemini summarize adapter\n */\nexport interface GeminiSummarizeConfig extends GeminiClientConfig {}\n\nexport type GeminiSummarizeModel = (typeof GEMINI_MODELS)[number]\n\n/**\n * Creates a Gemini summarize adapter with explicit API key and model.\n *\n * Note: keeps the historical (apiKey, model, config) argument order to\n * avoid breaking existing callers.\n *\n * @example\n * ```typescript\n * const adapter = createGeminiSummarize('AIza...', 'gemini-2.
|
|
1
|
+
{"version":3,"file":"summarize.js","sources":["../../../src/adapters/summarize.ts"],"sourcesContent":["import { ChatStreamSummarizeAdapter } from '@tanstack/ai/adapters'\nimport { getGeminiApiKeyFromEnv } from '../utils'\nimport { GeminiTextAdapter } from './text'\nimport type { InferTextProviderOptions } from '@tanstack/ai/adapters'\nimport type { GEMINI_MODELS } from '../model-meta'\nimport type { GeminiClientConfig } from '../utils'\n\n/**\n * Configuration for Gemini summarize adapter\n */\nexport interface GeminiSummarizeConfig extends GeminiClientConfig {}\n\nexport type GeminiSummarizeModel = (typeof GEMINI_MODELS)[number]\n\n/**\n * Creates a Gemini summarize adapter with explicit API key and model.\n *\n * Note: keeps the historical (apiKey, model, config) argument order to\n * avoid breaking existing callers.\n *\n * @example\n * ```typescript\n * const adapter = createGeminiSummarize('AIza...', 'gemini-2.5-flash');\n * ```\n */\nexport function createGeminiSummarize<TModel extends GeminiSummarizeModel>(\n apiKey: string,\n model: TModel,\n config?: Omit<GeminiSummarizeConfig, 'apiKey'>,\n): ChatStreamSummarizeAdapter<\n TModel,\n InferTextProviderOptions<GeminiTextAdapter<TModel>>\n> {\n return new ChatStreamSummarizeAdapter(\n new GeminiTextAdapter({ ...config, apiKey }, model),\n model,\n 'gemini',\n )\n}\n\n/**\n * Creates a Gemini summarize adapter with API key from `GOOGLE_API_KEY` /\n * `GEMINI_API_KEY` environment variables.\n *\n * @example\n * ```typescript\n * const adapter = geminiSummarize('gemini-2.5-flash');\n * await summarize({ adapter, text: 'Long article text...' });\n * ```\n */\nexport function geminiSummarize<TModel extends GeminiSummarizeModel>(\n model: TModel,\n config?: Omit<GeminiSummarizeConfig, 'apiKey'>,\n): ChatStreamSummarizeAdapter<\n TModel,\n InferTextProviderOptions<GeminiTextAdapter<TModel>>\n> {\n return createGeminiSummarize(getGeminiApiKeyFromEnv(), model, config)\n}\n"],"names":[],"mappings":";;;AAyBO,SAAS,sBACd,QACA,OACA,QAIA;AACA,SAAO,IAAI;AAAA,IACT,IAAI,kBAAkB,EAAE,GAAG,QAAQ,OAAA,GAAU,KAAK;AAAA,IAClD;AAAA,IACA;AAAA,EAAA;AAEJ;AAYO,SAAS,gBACd,OACA,QAIA;AACA,SAAO,sBAAsB,0BAA0B,OAAO,MAAM;AACtE;"}
|
|
@@ -120,7 +120,7 @@ export type GeminiNativeImageSize = `${GeminiNativeImageAspectRatio}_${GeminiNat
|
|
|
120
120
|
* Gemini native image models that use the generateContent API path.
|
|
121
121
|
* These models support template literal sizes (aspectRatio_resolution).
|
|
122
122
|
*/
|
|
123
|
-
export type GeminiNativeImageModels = 'gemini-3.1-flash-image-preview' | 'gemini-3-pro-image-preview' | 'gemini-2.5-flash-image'
|
|
123
|
+
export type GeminiNativeImageModels = 'gemini-3.1-flash-image-preview' | 'gemini-3-pro-image-preview' | 'gemini-2.5-flash-image';
|
|
124
124
|
/**
|
|
125
125
|
* Model-specific size options mapping.
|
|
126
126
|
* Gemini native image models use template literal sizes, Imagen models use pixel sizes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-provider-options.js","sources":["../../../src/image/image-provider-options.ts"],"sourcesContent":["import type { GeminiImageModels } from '../model-meta'\nimport type {\n ImagePromptLanguage,\n PersonGeneration,\n SafetyFilterLevel,\n} from '@google/genai'\n\n// Re-export SDK types so users can use them directly\nexport type { ImagePromptLanguage, PersonGeneration, SafetyFilterLevel }\n\n/**\n * Gemini Imagen aspect ratio options\n * Controls the aspect ratio of generated images\n */\nexport type GeminiAspectRatio =\n | '1:1'\n | '3:4'\n | '4:3'\n | '9:16'\n | '16:9'\n | '9:21'\n | '21:9'\n\n/**\n * Provider options for Gemini image generation\n * These options match the @google/genai GenerateImagesConfig interface\n * and can be spread directly into the API request.\n */\nexport interface GeminiImageProviderOptions {\n /**\n * The aspect ratio of generated images\n * @default '1:1'\n */\n aspectRatio?: GeminiAspectRatio\n\n /**\n * Controls whether people can appear in generated images\n * Use PersonGeneration enum values: DONT_ALLOW, ALLOW_ADULT, ALLOW_ALL\n * @default 'ALLOW_ADULT'\n */\n personGeneration?: PersonGeneration\n\n /**\n * Safety filter level for content filtering\n * Use SafetyFilterLevel enum values\n */\n safetyFilterLevel?: SafetyFilterLevel\n\n /**\n * Optional seed for reproducible image generation\n * When the same seed is used with the same prompt and settings,\n * you should get similar (though not identical) results\n */\n seed?: number\n\n /**\n * Whether to add a SynthID watermark to generated images\n * SynthID helps identify AI-generated content\n * @default true\n */\n addWatermark?: boolean\n\n /**\n * Language of the prompt\n * Use ImagePromptLanguage enum values\n */\n language?: ImagePromptLanguage\n\n /**\n * Negative prompt - what to avoid in the generated image\n * Not all models support negative prompts\n */\n negativePrompt?: string\n\n /**\n * Output MIME type for the generated image\n * @default 'image/png'\n */\n outputMimeType?: 'image/png' | 'image/jpeg' | 'image/webp'\n\n /**\n * Compression quality for JPEG outputs (0-100)\n * Higher values mean better quality but larger file sizes\n * @default 75\n */\n outputCompressionQuality?: number\n\n /**\n * Controls how much the model adheres to the text prompt\n * Large values increase output and prompt alignment,\n * but may compromise image quality\n */\n guidanceScale?: number\n\n /**\n * Whether to use the prompt rewriting logic\n */\n enhancePrompt?: boolean\n\n /**\n * Whether to report the safety scores of each generated image\n * and the positive prompt in the response\n */\n includeSafetyAttributes?: boolean\n\n /**\n * Whether to include the Responsible AI filter reason\n * if the image is filtered out of the response\n */\n includeRaiReason?: boolean\n\n /**\n * Cloud Storage URI used to store the generated images\n */\n outputGcsUri?: string\n\n /**\n * User specified labels to track billing usage\n */\n labels?: Record<string, string>\n}\n\n/**\n * Model-specific provider options mapping\n * Currently all Imagen models use the same options structure\n */\nexport type GeminiImageModelProviderOptionsByName = {\n [K in GeminiImageModels]: GeminiImageProviderOptions\n}\n\n/**\n * Supported size strings for Gemini Imagen models\n * These map to aspect ratios internally\n */\nexport type GeminiImageSize =\n | '1024x1024'\n | '512x512'\n | '1024x768'\n | '1536x1024'\n | '1792x1024'\n | '1920x1080'\n | '768x1024'\n | '1024x1536'\n | '1024x1792'\n | '1080x1920'\n\n/**\n * Aspect ratios supported by Gemini native image models (via generateContent API).\n * Matches the SDK's ImageConfig.aspectRatio values.\n */\nexport type GeminiNativeImageAspectRatio =\n | '1:1'\n | '2:3'\n | '3:2'\n | '3:4'\n | '4:3'\n | '9:16'\n | '16:9'\n | '21:9'\n\n/**\n * Resolution tiers for Gemini native image models.\n * Matches the SDK's ImageConfig.imageSize values.\n */\nexport type GeminiNativeImageResolution = '1K' | '2K' | '4K'\n\n/**\n * Template literal size type for Gemini native image models: \"16:9_4K\", \"1:1_2K\", etc.\n */\nexport type GeminiNativeImageSize =\n `${GeminiNativeImageAspectRatio}_${GeminiNativeImageResolution}`\n\n/**\n * Gemini native image models that use the generateContent API path.\n * These models support template literal sizes (aspectRatio_resolution).\n */\nexport type GeminiNativeImageModels =\n | 'gemini-3.1-flash-image-preview'\n | 'gemini-3-pro-image-preview'\n | 'gemini-2.5-flash-image'\n
|
|
1
|
+
{"version":3,"file":"image-provider-options.js","sources":["../../../src/image/image-provider-options.ts"],"sourcesContent":["import type { GeminiImageModels } from '../model-meta'\nimport type {\n ImagePromptLanguage,\n PersonGeneration,\n SafetyFilterLevel,\n} from '@google/genai'\n\n// Re-export SDK types so users can use them directly\nexport type { ImagePromptLanguage, PersonGeneration, SafetyFilterLevel }\n\n/**\n * Gemini Imagen aspect ratio options\n * Controls the aspect ratio of generated images\n */\nexport type GeminiAspectRatio =\n | '1:1'\n | '3:4'\n | '4:3'\n | '9:16'\n | '16:9'\n | '9:21'\n | '21:9'\n\n/**\n * Provider options for Gemini image generation\n * These options match the @google/genai GenerateImagesConfig interface\n * and can be spread directly into the API request.\n */\nexport interface GeminiImageProviderOptions {\n /**\n * The aspect ratio of generated images\n * @default '1:1'\n */\n aspectRatio?: GeminiAspectRatio\n\n /**\n * Controls whether people can appear in generated images\n * Use PersonGeneration enum values: DONT_ALLOW, ALLOW_ADULT, ALLOW_ALL\n * @default 'ALLOW_ADULT'\n */\n personGeneration?: PersonGeneration\n\n /**\n * Safety filter level for content filtering\n * Use SafetyFilterLevel enum values\n */\n safetyFilterLevel?: SafetyFilterLevel\n\n /**\n * Optional seed for reproducible image generation\n * When the same seed is used with the same prompt and settings,\n * you should get similar (though not identical) results\n */\n seed?: number\n\n /**\n * Whether to add a SynthID watermark to generated images\n * SynthID helps identify AI-generated content\n * @default true\n */\n addWatermark?: boolean\n\n /**\n * Language of the prompt\n * Use ImagePromptLanguage enum values\n */\n language?: ImagePromptLanguage\n\n /**\n * Negative prompt - what to avoid in the generated image\n * Not all models support negative prompts\n */\n negativePrompt?: string\n\n /**\n * Output MIME type for the generated image\n * @default 'image/png'\n */\n outputMimeType?: 'image/png' | 'image/jpeg' | 'image/webp'\n\n /**\n * Compression quality for JPEG outputs (0-100)\n * Higher values mean better quality but larger file sizes\n * @default 75\n */\n outputCompressionQuality?: number\n\n /**\n * Controls how much the model adheres to the text prompt\n * Large values increase output and prompt alignment,\n * but may compromise image quality\n */\n guidanceScale?: number\n\n /**\n * Whether to use the prompt rewriting logic\n */\n enhancePrompt?: boolean\n\n /**\n * Whether to report the safety scores of each generated image\n * and the positive prompt in the response\n */\n includeSafetyAttributes?: boolean\n\n /**\n * Whether to include the Responsible AI filter reason\n * if the image is filtered out of the response\n */\n includeRaiReason?: boolean\n\n /**\n * Cloud Storage URI used to store the generated images\n */\n outputGcsUri?: string\n\n /**\n * User specified labels to track billing usage\n */\n labels?: Record<string, string>\n}\n\n/**\n * Model-specific provider options mapping\n * Currently all Imagen models use the same options structure\n */\nexport type GeminiImageModelProviderOptionsByName = {\n [K in GeminiImageModels]: GeminiImageProviderOptions\n}\n\n/**\n * Supported size strings for Gemini Imagen models\n * These map to aspect ratios internally\n */\nexport type GeminiImageSize =\n | '1024x1024'\n | '512x512'\n | '1024x768'\n | '1536x1024'\n | '1792x1024'\n | '1920x1080'\n | '768x1024'\n | '1024x1536'\n | '1024x1792'\n | '1080x1920'\n\n/**\n * Aspect ratios supported by Gemini native image models (via generateContent API).\n * Matches the SDK's ImageConfig.aspectRatio values.\n */\nexport type GeminiNativeImageAspectRatio =\n | '1:1'\n | '2:3'\n | '3:2'\n | '3:4'\n | '4:3'\n | '9:16'\n | '16:9'\n | '21:9'\n\n/**\n * Resolution tiers for Gemini native image models.\n * Matches the SDK's ImageConfig.imageSize values.\n */\nexport type GeminiNativeImageResolution = '1K' | '2K' | '4K'\n\n/**\n * Template literal size type for Gemini native image models: \"16:9_4K\", \"1:1_2K\", etc.\n */\nexport type GeminiNativeImageSize =\n `${GeminiNativeImageAspectRatio}_${GeminiNativeImageResolution}`\n\n/**\n * Gemini native image models that use the generateContent API path.\n * These models support template literal sizes (aspectRatio_resolution).\n */\nexport type GeminiNativeImageModels =\n | 'gemini-3.1-flash-image-preview'\n | 'gemini-3-pro-image-preview'\n | 'gemini-2.5-flash-image'\n\n/**\n * Model-specific size options mapping.\n * Gemini native image models use template literal sizes, Imagen models use pixel sizes.\n */\nexport type GeminiImageModelSizeByName = {\n [K in GeminiNativeImageModels]: GeminiNativeImageSize\n} & {\n [K in Exclude<GeminiImageModels, GeminiNativeImageModels>]: GeminiImageSize\n}\n\n/**\n * Valid sizes for Gemini Imagen models\n * Gemini uses aspect ratios, but we map common WIDTHxHEIGHT formats to aspect ratios\n * These are approximate mappings based on common image dimensions\n */\nexport const GEMINI_SIZE_TO_ASPECT_RATIO: Record<string, GeminiAspectRatio> = {\n // Square\n '1024x1024': '1:1',\n '512x512': '1:1',\n // Landscape\n '1024x768': '4:3',\n '1536x1024': '4:3',\n '1792x1024': '16:9',\n '1920x1080': '16:9',\n // Portrait\n '768x1024': '3:4',\n '1024x1536': '3:4', // Inverted\n '1024x1792': '9:16',\n '1080x1920': '9:16',\n}\n\n/**\n * Maps a WIDTHxHEIGHT size string to a Gemini aspect ratio\n * Returns undefined if the size cannot be mapped\n */\nexport function sizeToAspectRatio(\n size: string | undefined,\n): GeminiAspectRatio | undefined {\n if (!size) return undefined\n return GEMINI_SIZE_TO_ASPECT_RATIO[size]\n}\n\n/**\n * Validates that the provided size can be mapped to an aspect ratio\n * Throws an error if the size is invalid\n */\nexport function validateImageSize(\n model: string,\n size: string | undefined,\n): void {\n if (!size) return\n\n const aspectRatio = sizeToAspectRatio(size)\n if (!aspectRatio) {\n const validSizes = Object.keys(GEMINI_SIZE_TO_ASPECT_RATIO)\n throw new Error(\n `Invalid size \"${size}\" for model \"${model}\". ` +\n `Gemini Imagen uses aspect ratios. Valid sizes that map to aspect ratios: ${validSizes.join(', ')}. ` +\n `Alternatively, use providerOptions.aspectRatio directly with values: 1:1, 3:4, 4:3, 9:16, 16:9, 9:21, 21:9`,\n )\n }\n}\n\n/**\n * Per-model caps on images per request.\n * Imagen 3 and the Imagen 4 family all support up to 4 images per request\n * via the Gemini API (the rumored 8-image tier is Vertex-only and isn't\n * reachable through @google/genai today). Unknown models fall through to\n * the shared cap defined below.\n *\n * @see https://ai.google.dev/gemini-api/docs/imagen\n */\nconst IMAGEN_MAX_IMAGES_BY_MODEL: Record<string, number> = {\n 'imagen-3.0-generate-002': 4,\n 'imagen-4.0-generate-001': 4,\n 'imagen-4.0-ultra-generate-001': 4,\n 'imagen-4.0-fast-generate-001': 4,\n}\n\nconst DEFAULT_IMAGEN_MAX_IMAGES = 4\n\n/**\n * Validates the number of images requested against the model's known cap.\n * Uses a per-model table where available and falls back to the shared\n * default otherwise — no more \"some support up to 8\" comments that don't\n * match the error message.\n */\nexport function validateNumberOfImages(\n model: string,\n numberOfImages: number | undefined,\n): void {\n if (numberOfImages === undefined) return\n\n const maxImages =\n IMAGEN_MAX_IMAGES_BY_MODEL[model] ?? DEFAULT_IMAGEN_MAX_IMAGES\n if (numberOfImages < 1 || numberOfImages > maxImages) {\n throw new Error(\n `Invalid numberOfImages \"${numberOfImages}\" for model \"${model}\". ` +\n `Must be between 1 and ${maxImages}.`,\n )\n }\n}\n\n/**\n * Validates the prompt is not empty\n */\nexport function validatePrompt(options: {\n prompt: string\n model: string\n}): void {\n const { prompt, model } = options\n if (!prompt || prompt.trim().length === 0) {\n throw new Error(`Prompt cannot be empty for model \"${model}\".`)\n }\n}\n\n/**\n * Parses a Gemini native image size string into its components.\n * Format: \"aspectRatio_resolution\" e.g. \"16:9_4K\" → { aspectRatio: \"16:9\", resolution: \"4K\" }\n */\nexport function parseNativeImageSize(\n size: string,\n): { aspectRatio: string; resolution: string } | undefined {\n const match = size.match(/^(\\d+:\\d+)_(.+)$/)\n const [, aspectRatio, resolution] = match ?? []\n if (aspectRatio === undefined || resolution === undefined) return undefined\n return { aspectRatio, resolution }\n}\n"],"names":[],"mappings":"AAoMO,MAAM,8BAAiE;AAAA;AAAA,EAE5E,aAAa;AAAA,EACb,WAAW;AAAA;AAAA,EAEX,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,aAAa;AAAA,EACb,aAAa;AAAA;AAAA,EAEb,YAAY;AAAA,EACZ,aAAa;AAAA;AAAA,EACb,aAAa;AAAA,EACb,aAAa;AACf;AAMO,SAAS,kBACd,MAC+B;AAC/B,MAAI,CAAC,KAAM,QAAO;AAClB,SAAO,4BAA4B,IAAI;AACzC;AAMO,SAAS,kBACd,OACA,MACM;AACN,MAAI,CAAC,KAAM;AAEX,QAAM,cAAc,kBAAkB,IAAI;AAC1C,MAAI,CAAC,aAAa;AAChB,UAAM,aAAa,OAAO,KAAK,2BAA2B;AAC1D,UAAM,IAAI;AAAA,MACR,iBAAiB,IAAI,gBAAgB,KAAK,+EACoC,WAAW,KAAK,IAAI,CAAC;AAAA,IAAA;AAAA,EAGvG;AACF;AAWA,MAAM,6BAAqD;AAAA,EACzD,2BAA2B;AAAA,EAC3B,2BAA2B;AAAA,EAC3B,iCAAiC;AAAA,EACjC,gCAAgC;AAClC;AAEA,MAAM,4BAA4B;AAQ3B,SAAS,uBACd,OACA,gBACM;AACN,MAAI,mBAAmB,OAAW;AAElC,QAAM,YACJ,2BAA2B,KAAK,KAAK;AACvC,MAAI,iBAAiB,KAAK,iBAAiB,WAAW;AACpD,UAAM,IAAI;AAAA,MACR,2BAA2B,cAAc,gBAAgB,KAAK,4BACnC,SAAS;AAAA,IAAA;AAAA,EAExC;AACF;AAKO,SAAS,eAAe,SAGtB;AACP,QAAM,EAAE,QAAQ,MAAA,IAAU;AAC1B,MAAI,CAAC,UAAU,OAAO,KAAA,EAAO,WAAW,GAAG;AACzC,UAAM,IAAI,MAAM,qCAAqC,KAAK,IAAI;AAAA,EAChE;AACF;AAMO,SAAS,qBACd,MACyD;AACzD,QAAM,QAAQ,KAAK,MAAM,kBAAkB;AAC3C,QAAM,GAAG,aAAa,UAAU,IAAI,SAAS,CAAA;AAC7C,MAAI,gBAAgB,UAAa,eAAe,OAAW,QAAO;AAClE,SAAO,EAAE,aAAa,WAAA;AACxB;"}
|
package/dist/esm/model-meta.d.ts
CHANGED
|
@@ -19,8 +19,8 @@ declare const GEMINI_3_1_PRO: {
|
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
-
declare const
|
|
23
|
-
readonly name: "gemini-3-
|
|
22
|
+
declare const GEMINI_3_FLASH: {
|
|
23
|
+
readonly name: "gemini-3-flash-preview";
|
|
24
24
|
readonly max_input_tokens: 1048576;
|
|
25
25
|
readonly max_output_tokens: 65536;
|
|
26
26
|
readonly knowledge_cutoff: "2025-01-01";
|
|
@@ -32,15 +32,15 @@ declare const GEMINI_3_PRO: {
|
|
|
32
32
|
};
|
|
33
33
|
readonly pricing: {
|
|
34
34
|
readonly input: {
|
|
35
|
-
readonly normal:
|
|
35
|
+
readonly normal: 0.5;
|
|
36
36
|
};
|
|
37
37
|
readonly output: {
|
|
38
|
-
readonly normal:
|
|
38
|
+
readonly normal: 3;
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
|
-
declare const
|
|
43
|
-
readonly name: "gemini-3-flash-
|
|
42
|
+
declare const GEMINI_3_1_FLASH_LITE: {
|
|
43
|
+
readonly name: "gemini-3.1-flash-lite";
|
|
44
44
|
readonly max_input_tokens: 1048576;
|
|
45
45
|
readonly max_output_tokens: 65536;
|
|
46
46
|
readonly knowledge_cutoff: "2025-01-01";
|
|
@@ -52,14 +52,14 @@ declare const GEMINI_3_FLASH: {
|
|
|
52
52
|
};
|
|
53
53
|
readonly pricing: {
|
|
54
54
|
readonly input: {
|
|
55
|
-
readonly normal: 0.
|
|
55
|
+
readonly normal: 0.25;
|
|
56
56
|
};
|
|
57
57
|
readonly output: {
|
|
58
|
-
readonly normal:
|
|
58
|
+
readonly normal: 1.5;
|
|
59
59
|
};
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
|
-
declare const
|
|
62
|
+
declare const GEMINI_3_1_FLASH_LITE_PREVIEW: {
|
|
63
63
|
readonly name: "gemini-3.1-flash-lite-preview";
|
|
64
64
|
readonly max_input_tokens: 1048576;
|
|
65
65
|
readonly max_output_tokens: 65536;
|
|
@@ -119,26 +119,6 @@ declare const GEMINI_2_5_FLASH: {
|
|
|
119
119
|
};
|
|
120
120
|
};
|
|
121
121
|
};
|
|
122
|
-
declare const GEMINI_2_5_FLASH_PREVIEW: {
|
|
123
|
-
readonly name: "gemini-2.5-flash-preview-09-2025";
|
|
124
|
-
readonly max_input_tokens: 1048576;
|
|
125
|
-
readonly max_output_tokens: 65536;
|
|
126
|
-
readonly knowledge_cutoff: "2025-01-01";
|
|
127
|
-
readonly supports: {
|
|
128
|
-
readonly input: ["text", "image", "audio", "video"];
|
|
129
|
-
readonly output: ["text"];
|
|
130
|
-
readonly capabilities: ["batch_api", "caching", "function_calling", "structured_output", "thinking"];
|
|
131
|
-
readonly tools: ["code_execution", "file_search", "google_search", "url_context"];
|
|
132
|
-
};
|
|
133
|
-
readonly pricing: {
|
|
134
|
-
readonly input: {
|
|
135
|
-
readonly normal: 1;
|
|
136
|
-
};
|
|
137
|
-
readonly output: {
|
|
138
|
-
readonly normal: 2.5;
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
122
|
declare const GEMINI_2_5_FLASH_LITE: {
|
|
143
123
|
readonly name: "gemini-2.5-flash-lite";
|
|
144
124
|
readonly max_input_tokens: 1048576;
|
|
@@ -159,66 +139,6 @@ declare const GEMINI_2_5_FLASH_LITE: {
|
|
|
159
139
|
};
|
|
160
140
|
};
|
|
161
141
|
};
|
|
162
|
-
declare const GEMINI_2_5_FLASH_LITE_PREVIEW: {
|
|
163
|
-
readonly name: "gemini-2.5-flash-lite-preview-09-2025";
|
|
164
|
-
readonly max_input_tokens: 1048576;
|
|
165
|
-
readonly max_output_tokens: 65536;
|
|
166
|
-
readonly knowledge_cutoff: "2025-01-01";
|
|
167
|
-
readonly supports: {
|
|
168
|
-
readonly input: ["text", "image", "audio", "video", "document"];
|
|
169
|
-
readonly output: ["text"];
|
|
170
|
-
readonly capabilities: ["batch_api", "caching", "function_calling", "structured_output", "thinking"];
|
|
171
|
-
readonly tools: ["code_execution", "google_search", "url_context"];
|
|
172
|
-
};
|
|
173
|
-
readonly pricing: {
|
|
174
|
-
readonly input: {
|
|
175
|
-
readonly normal: 0.1;
|
|
176
|
-
};
|
|
177
|
-
readonly output: {
|
|
178
|
-
readonly normal: 0.4;
|
|
179
|
-
};
|
|
180
|
-
};
|
|
181
|
-
};
|
|
182
|
-
declare const GEMINI_2_FLASH: {
|
|
183
|
-
readonly name: "gemini-2.0-flash";
|
|
184
|
-
readonly max_input_tokens: 1048576;
|
|
185
|
-
readonly max_output_tokens: 8192;
|
|
186
|
-
readonly knowledge_cutoff: "2024-08-01";
|
|
187
|
-
readonly supports: {
|
|
188
|
-
readonly input: ["text", "image", "audio", "video"];
|
|
189
|
-
readonly output: ["text"];
|
|
190
|
-
readonly capabilities: ["batch_api", "caching", "function_calling", "live_api", "structured_output"];
|
|
191
|
-
readonly tools: ["code_execution", "google_maps", "google_search"];
|
|
192
|
-
};
|
|
193
|
-
readonly pricing: {
|
|
194
|
-
readonly input: {
|
|
195
|
-
readonly normal: 0.1;
|
|
196
|
-
};
|
|
197
|
-
readonly output: {
|
|
198
|
-
readonly normal: 0.4;
|
|
199
|
-
};
|
|
200
|
-
};
|
|
201
|
-
};
|
|
202
|
-
declare const GEMINI_2_FLASH_LITE: {
|
|
203
|
-
readonly name: "gemini-2.0-flash-lite";
|
|
204
|
-
readonly max_input_tokens: 1048576;
|
|
205
|
-
readonly max_output_tokens: 8192;
|
|
206
|
-
readonly knowledge_cutoff: "2024-08-01";
|
|
207
|
-
readonly supports: {
|
|
208
|
-
readonly input: ["text", "audio", "video", "image"];
|
|
209
|
-
readonly output: ["text"];
|
|
210
|
-
readonly capabilities: ["batch_api", "caching", "function_calling", "structured_output"];
|
|
211
|
-
readonly tools: [];
|
|
212
|
-
};
|
|
213
|
-
readonly pricing: {
|
|
214
|
-
readonly input: {
|
|
215
|
-
readonly normal: 0.075;
|
|
216
|
-
};
|
|
217
|
-
readonly output: {
|
|
218
|
-
readonly normal: 0.3;
|
|
219
|
-
};
|
|
220
|
-
};
|
|
221
|
-
};
|
|
222
142
|
/**
|
|
223
143
|
const VEO_3_1_PREVIEW = {
|
|
224
144
|
name: 'veo-3.1-generate-preview',
|
|
@@ -353,7 +273,7 @@ declare const GEMINI_3_5_FLASH: {
|
|
|
353
273
|
};
|
|
354
274
|
};
|
|
355
275
|
};
|
|
356
|
-
export declare const GEMINI_MODELS: readonly ["gemini-3.
|
|
276
|
+
export declare const GEMINI_MODELS: readonly ["gemini-3.5-flash", "gemini-3.1-pro-preview", "gemini-3-flash-preview", "gemini-3.1-flash-lite", "gemini-3.1-flash-lite-preview", "gemini-2.5-pro", "gemini-2.5-flash", "gemini-2.5-flash-lite"];
|
|
357
277
|
/**
|
|
358
278
|
* Gemini models that support combining `tools` + `responseSchema` in a
|
|
359
279
|
* single streaming `generateContent` call (per issue #605). Per the
|
|
@@ -364,7 +284,7 @@ export declare const GEMINI_MODELS: readonly ["gemini-3.1-pro-preview", "gemini-
|
|
|
364
284
|
export declare const GEMINI_COMBINED_TOOLS_AND_SCHEMA_MODELS: Set<string>;
|
|
365
285
|
export type GeminiModels = (typeof GEMINI_MODELS)[number];
|
|
366
286
|
export type GeminiImageModels = (typeof GEMINI_IMAGE_MODELS)[number];
|
|
367
|
-
export declare const GEMINI_IMAGE_MODELS: readonly ["gemini-3.1-flash-image-preview", "gemini-3-pro-image-preview", "gemini-2.5-flash-image", "
|
|
287
|
+
export declare const GEMINI_IMAGE_MODELS: readonly ["gemini-3.1-flash-image-preview", "gemini-3-pro-image-preview", "gemini-2.5-flash-image", "imagen-3.0-generate-002", "imagen-4.0-generate-001", "imagen-4.0-fast-generate-001", "imagen-4.0-ultra-generate-001"];
|
|
368
288
|
/**
|
|
369
289
|
* Text-to-speech models
|
|
370
290
|
* @experimental Gemini TTS is an experimental feature and may change.
|
|
@@ -383,16 +303,12 @@ export declare const GEMINI_TTS_VOICES: readonly ["Zephyr", "Puck", "Charon", "K
|
|
|
383
303
|
export type GeminiTTSVoice = (typeof GEMINI_TTS_VOICES)[number];
|
|
384
304
|
export type GeminiChatModelProviderOptionsByName = {
|
|
385
305
|
[GEMINI_3_1_PRO.name]: GeminiToolConfigOptions & GeminiSafetyOptions & GeminiCommonConfigOptions & GeminiCachedContentOptions & GeminiStructuredOutputOptions & GeminiThinkingOptions;
|
|
386
|
-
[GEMINI_3_PRO.name]: GeminiToolConfigOptions & GeminiSafetyOptions & GeminiCommonConfigOptions & GeminiCachedContentOptions & GeminiStructuredOutputOptions & GeminiThinkingOptions;
|
|
387
306
|
[GEMINI_3_FLASH.name]: GeminiToolConfigOptions & GeminiSafetyOptions & GeminiCommonConfigOptions & GeminiCachedContentOptions & GeminiStructuredOutputOptions & GeminiThinkingOptions;
|
|
388
307
|
[GEMINI_3_1_FLASH_LITE.name]: GeminiToolConfigOptions & GeminiSafetyOptions & GeminiCommonConfigOptions & GeminiCachedContentOptions & GeminiStructuredOutputOptions & GeminiThinkingOptions;
|
|
308
|
+
[GEMINI_3_1_FLASH_LITE_PREVIEW.name]: GeminiToolConfigOptions & GeminiSafetyOptions & GeminiCommonConfigOptions & GeminiCachedContentOptions & GeminiStructuredOutputOptions & GeminiThinkingOptions;
|
|
389
309
|
[GEMINI_2_5_PRO.name]: GeminiToolConfigOptions & GeminiSafetyOptions & GeminiCommonConfigOptions & GeminiCachedContentOptions & GeminiStructuredOutputOptions & GeminiThinkingOptions;
|
|
390
310
|
[GEMINI_2_5_FLASH.name]: GeminiToolConfigOptions & GeminiSafetyOptions & GeminiCommonConfigOptions & GeminiCachedContentOptions & GeminiStructuredOutputOptions & GeminiThinkingOptions;
|
|
391
|
-
[GEMINI_2_5_FLASH_PREVIEW.name]: GeminiToolConfigOptions & GeminiSafetyOptions & GeminiCommonConfigOptions & GeminiCachedContentOptions & GeminiStructuredOutputOptions & GeminiThinkingOptions;
|
|
392
311
|
[GEMINI_2_5_FLASH_LITE.name]: GeminiToolConfigOptions & GeminiSafetyOptions & GeminiCommonConfigOptions & GeminiCachedContentOptions & GeminiStructuredOutputOptions & GeminiThinkingOptions;
|
|
393
|
-
[GEMINI_2_5_FLASH_LITE_PREVIEW.name]: GeminiToolConfigOptions & GeminiSafetyOptions & GeminiCommonConfigOptions & GeminiCachedContentOptions & GeminiStructuredOutputOptions & GeminiThinkingOptions;
|
|
394
|
-
[GEMINI_2_FLASH.name]: GeminiToolConfigOptions & GeminiSafetyOptions & GeminiCommonConfigOptions & GeminiCachedContentOptions & GeminiStructuredOutputOptions;
|
|
395
|
-
[GEMINI_2_FLASH_LITE.name]: GeminiToolConfigOptions & GeminiSafetyOptions & GeminiCommonConfigOptions & GeminiCachedContentOptions & GeminiStructuredOutputOptions;
|
|
396
312
|
[GEMINI_3_5_FLASH.name]: GeminiToolConfigOptions & GeminiSafetyOptions & GeminiCommonConfigOptions & GeminiCachedContentOptions & GeminiStructuredOutputOptions & GeminiThinkingOptions;
|
|
397
313
|
};
|
|
398
314
|
/**
|
|
@@ -401,16 +317,13 @@ export type GeminiChatModelProviderOptionsByName = {
|
|
|
401
317
|
*/
|
|
402
318
|
export type GeminiChatModelToolCapabilitiesByName = {
|
|
403
319
|
[GEMINI_3_1_PRO.name]: typeof GEMINI_3_1_PRO.supports.tools;
|
|
404
|
-
[GEMINI_3_PRO.name]: typeof GEMINI_3_PRO.supports.tools;
|
|
405
320
|
[GEMINI_3_FLASH.name]: typeof GEMINI_3_FLASH.supports.tools;
|
|
406
321
|
[GEMINI_3_1_FLASH_LITE.name]: typeof GEMINI_3_1_FLASH_LITE.supports.tools;
|
|
322
|
+
[GEMINI_3_1_FLASH_LITE_PREVIEW.name]: typeof GEMINI_3_1_FLASH_LITE_PREVIEW.supports.tools;
|
|
407
323
|
[GEMINI_2_5_PRO.name]: typeof GEMINI_2_5_PRO.supports.tools;
|
|
408
324
|
[GEMINI_2_5_FLASH.name]: typeof GEMINI_2_5_FLASH.supports.tools;
|
|
409
|
-
[GEMINI_2_5_FLASH_PREVIEW.name]: typeof GEMINI_2_5_FLASH_PREVIEW.supports.tools;
|
|
410
325
|
[GEMINI_2_5_FLASH_LITE.name]: typeof GEMINI_2_5_FLASH_LITE.supports.tools;
|
|
411
|
-
[
|
|
412
|
-
[GEMINI_2_FLASH.name]: typeof GEMINI_2_FLASH.supports.tools;
|
|
413
|
-
[GEMINI_2_FLASH_LITE.name]: typeof GEMINI_2_FLASH_LITE.supports.tools;
|
|
326
|
+
[GEMINI_3_5_FLASH.name]: typeof GEMINI_3_5_FLASH.supports.tools;
|
|
414
327
|
};
|
|
415
328
|
/**
|
|
416
329
|
* Type-only map from chat model name to its supported input modalities.
|
|
@@ -427,16 +340,12 @@ export type GeminiChatModelToolCapabilitiesByName = {
|
|
|
427
340
|
*/
|
|
428
341
|
export type GeminiModelInputModalitiesByName = {
|
|
429
342
|
[GEMINI_3_1_PRO.name]: typeof GEMINI_3_1_PRO.supports.input;
|
|
430
|
-
[GEMINI_3_PRO.name]: typeof GEMINI_3_PRO.supports.input;
|
|
431
343
|
[GEMINI_3_FLASH.name]: typeof GEMINI_3_FLASH.supports.input;
|
|
432
344
|
[GEMINI_3_1_FLASH_LITE.name]: typeof GEMINI_3_1_FLASH_LITE.supports.input;
|
|
345
|
+
[GEMINI_3_1_FLASH_LITE_PREVIEW.name]: typeof GEMINI_3_1_FLASH_LITE_PREVIEW.supports.input;
|
|
433
346
|
[GEMINI_2_5_PRO.name]: typeof GEMINI_2_5_PRO.supports.input;
|
|
434
347
|
[GEMINI_2_5_FLASH_LITE.name]: typeof GEMINI_2_5_FLASH_LITE.supports.input;
|
|
435
|
-
[GEMINI_2_5_FLASH_LITE_PREVIEW.name]: typeof GEMINI_2_5_FLASH_LITE_PREVIEW.supports.input;
|
|
436
|
-
[GEMINI_2_5_FLASH.name]: typeof GEMINI_2_5_FLASH.supports.input;
|
|
437
|
-
[GEMINI_2_5_FLASH_PREVIEW.name]: typeof GEMINI_2_5_FLASH_PREVIEW.supports.input;
|
|
438
|
-
[GEMINI_2_FLASH.name]: typeof GEMINI_2_FLASH.supports.input;
|
|
439
|
-
[GEMINI_2_FLASH_LITE.name]: typeof GEMINI_2_FLASH_LITE.supports.input;
|
|
440
348
|
[GEMINI_3_5_FLASH.name]: typeof GEMINI_3_5_FLASH.supports.input;
|
|
349
|
+
[GEMINI_2_5_FLASH.name]: typeof GEMINI_2_5_FLASH.supports.input;
|
|
441
350
|
};
|
|
442
351
|
export {};
|
package/dist/esm/model-meta.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
const GEMINI_3_1_PRO = {
|
|
2
2
|
name: "gemini-3.1-pro-preview"
|
|
3
3
|
};
|
|
4
|
-
const GEMINI_3_PRO = {
|
|
5
|
-
name: "gemini-3-pro-preview"
|
|
6
|
-
};
|
|
7
4
|
const GEMINI_3_FLASH = {
|
|
8
5
|
name: "gemini-3-flash-preview"
|
|
9
6
|
};
|
|
@@ -14,6 +11,9 @@ const GEMINI_3_1_FLASH_IMAGE = {
|
|
|
14
11
|
name: "gemini-3.1-flash-image-preview"
|
|
15
12
|
};
|
|
16
13
|
const GEMINI_3_1_FLASH_LITE = {
|
|
14
|
+
name: "gemini-3.1-flash-lite"
|
|
15
|
+
};
|
|
16
|
+
const GEMINI_3_1_FLASH_LITE_PREVIEW = {
|
|
17
17
|
name: "gemini-3.1-flash-lite-preview"
|
|
18
18
|
};
|
|
19
19
|
const GEMINI_2_5_PRO = {
|
|
@@ -25,9 +25,6 @@ const GEMINI_2_5_PRO_TTS = {
|
|
|
25
25
|
const GEMINI_2_5_FLASH = {
|
|
26
26
|
name: "gemini-2.5-flash"
|
|
27
27
|
};
|
|
28
|
-
const GEMINI_2_5_FLASH_PREVIEW = {
|
|
29
|
-
name: "gemini-2.5-flash-preview-09-2025"
|
|
30
|
-
};
|
|
31
28
|
const GEMINI_2_5_FLASH_IMAGE = {
|
|
32
29
|
name: "gemini-2.5-flash-image"
|
|
33
30
|
};
|
|
@@ -46,18 +43,6 @@ const LYRIA_3_CLIP = {
|
|
|
46
43
|
const GEMINI_2_5_FLASH_LITE = {
|
|
47
44
|
name: "gemini-2.5-flash-lite"
|
|
48
45
|
};
|
|
49
|
-
const GEMINI_2_5_FLASH_LITE_PREVIEW = {
|
|
50
|
-
name: "gemini-2.5-flash-lite-preview-09-2025"
|
|
51
|
-
};
|
|
52
|
-
const GEMINI_2_FLASH = {
|
|
53
|
-
name: "gemini-2.0-flash"
|
|
54
|
-
};
|
|
55
|
-
const GEMINI_2_FLASH_IMAGE = {
|
|
56
|
-
name: "gemini-2.0-flash-preview-image-generation"
|
|
57
|
-
};
|
|
58
|
-
const GEMINI_2_FLASH_LITE = {
|
|
59
|
-
name: "gemini-2.0-flash-lite"
|
|
60
|
-
};
|
|
61
46
|
const IMAGEN_4_GENERATE = {
|
|
62
47
|
name: "imagen-4.0-generate-001"
|
|
63
48
|
};
|
|
@@ -74,31 +59,26 @@ const GEMINI_3_5_FLASH = {
|
|
|
74
59
|
name: "gemini-3.5-flash"
|
|
75
60
|
};
|
|
76
61
|
const GEMINI_MODELS = [
|
|
62
|
+
GEMINI_3_5_FLASH.name,
|
|
77
63
|
GEMINI_3_1_PRO.name,
|
|
78
|
-
GEMINI_3_PRO.name,
|
|
79
64
|
GEMINI_3_FLASH.name,
|
|
80
65
|
GEMINI_3_1_FLASH_LITE.name,
|
|
66
|
+
GEMINI_3_1_FLASH_LITE_PREVIEW.name,
|
|
81
67
|
GEMINI_2_5_PRO.name,
|
|
82
68
|
GEMINI_2_5_FLASH.name,
|
|
83
|
-
|
|
84
|
-
GEMINI_2_5_FLASH_LITE.name,
|
|
85
|
-
GEMINI_2_5_FLASH_LITE_PREVIEW.name,
|
|
86
|
-
GEMINI_2_FLASH.name,
|
|
87
|
-
GEMINI_2_FLASH_LITE.name,
|
|
88
|
-
GEMINI_3_5_FLASH.name
|
|
69
|
+
GEMINI_2_5_FLASH_LITE.name
|
|
89
70
|
];
|
|
90
71
|
const GEMINI_COMBINED_TOOLS_AND_SCHEMA_MODELS = /* @__PURE__ */ new Set([
|
|
91
72
|
GEMINI_3_1_PRO.name,
|
|
92
|
-
GEMINI_3_PRO.name,
|
|
93
73
|
GEMINI_3_FLASH.name,
|
|
94
74
|
GEMINI_3_1_FLASH_LITE.name,
|
|
75
|
+
GEMINI_3_1_FLASH_LITE_PREVIEW.name,
|
|
95
76
|
GEMINI_3_5_FLASH.name
|
|
96
77
|
]);
|
|
97
78
|
const GEMINI_IMAGE_MODELS = [
|
|
98
79
|
GEMINI_3_1_FLASH_IMAGE.name,
|
|
99
80
|
GEMINI_3_PRO_IMAGE.name,
|
|
100
81
|
GEMINI_2_5_FLASH_IMAGE.name,
|
|
101
|
-
GEMINI_2_FLASH_IMAGE.name,
|
|
102
82
|
IMAGEN_3.name,
|
|
103
83
|
IMAGEN_4_GENERATE.name,
|
|
104
84
|
IMAGEN_4_GENERATE_FAST.name,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-meta.js","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'\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_PRO = {\n name: 'gemini-3-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\nconst GEMINI_3_PRO_IMAGE = {\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\nconst GEMINI_3_1_FLASH_IMAGE = {\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\nconst GEMINI_3_1_FLASH_LITE = {\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\nconst GEMINI_2_5_FLASH_PREVIEW = {\n name: 'gemini-2.5-flash-preview-09-2025',\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: ['code_execution', 'file_search', 'google_search', 'url_context'],\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\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 GEMINI_2_5_FLASH_LITE_PREVIEW = {\n name: 'gemini-2.5-flash-lite-preview-09-2025',\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_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 GEMINI_2_FLASH = {\n name: 'gemini-2.0-flash',\n max_input_tokens: 1_048_576,\n max_output_tokens: 8_192,\n knowledge_cutoff: '2024-08-01',\n supports: {\n input: ['text', 'image', 'audio', 'video'],\n output: ['text'],\n capabilities: [\n 'batch_api',\n 'caching',\n 'function_calling',\n 'live_api',\n 'structured_output',\n ],\n tools: ['code_execution', 'google_maps', 'google_search'],\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>\n\nconst GEMINI_2_FLASH_IMAGE = {\n name: 'gemini-2.0-flash-preview-image-generation',\n max_input_tokens: 32_768,\n max_output_tokens: 8_192,\n knowledge_cutoff: '2024-08-01',\n supports: {\n input: ['text', 'image', 'audio', 'video'],\n output: ['text', 'image'],\n capabilities: ['batch_api', 'caching', 'structured_output'],\n tools: [],\n },\n pricing: {\n input: {\n normal: 0.1,\n },\n output: {\n normal: 0.039,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions\n>\n/* \nconst GEMINI_2_FLASH_LIVE = {\n name: 'gemini-2.0-flash-live-001',\n max_input_tokens: 1_048_576,\n max_output_tokens: 8_192,\n knowledge_cutoff: '2024-08-01',\n supports: {\n input: ['text', 'audio', 'video'],\n output: ['text', 'audio'],\n capabilities: [\n 'audio_generation',\n 'code_execution',\n 'function_calling',\n 'live_api',\n 'search_grounding',\n 'structured_output',\n 'url_context',\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> */\n\nconst GEMINI_2_FLASH_LITE = {\n name: 'gemini-2.0-flash-lite',\n max_input_tokens: 1_048_576,\n max_output_tokens: 8_192,\n knowledge_cutoff: '2024-08-01',\n supports: {\n input: ['text', 'audio', 'video', 'image'],\n output: ['text'],\n capabilities: [\n 'batch_api',\n 'caching',\n 'function_calling',\n 'structured_output',\n ],\n tools: [],\n },\n pricing: {\n input: {\n normal: 0.075,\n },\n output: {\n normal: 0.3,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions\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\nconst IMAGEN_3 = {\n name: 'imagen-3.0-generate-002',\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.03,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions\n>\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 GeminiGenerationConfigOptions &\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 GeminiGenerationConfigOptions &\n GeminiCachedContentOptions\n>\n\nconst VEO_3 = {\n name: 'veo-3.0-generate-001',\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 GeminiGenerationConfigOptions &\n GeminiCachedContentOptions\n>\n\nconst VEO_3_FAST = {\n name: 'veo-3.0-fast-generate-001',\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 GeminiGenerationConfigOptions &\n GeminiCachedContentOptions\n>\n\nconst VEO_2 = {\n name: 'veo-2.0-generate-001',\n max_output_tokens: 2,\n supports: {\n input: ['text', 'image'],\n output: ['video'],\n },\n pricing: {\n input: {\n normal: 0,\n },\n output: {\n normal: 0.35,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiGenerationConfigOptions &\n GeminiCachedContentOptions\n> */\n\n/* const GEMINI_MODEL_META = {\n [GEMINI_3_PRO.name]: GEMINI_3_PRO,\n [GEMINI_2_5_PRO.name]: GEMINI_2_5_PRO,\n [GEMINI_2_5_PRO_TTS.name]: GEMINI_2_5_PRO_TTS,\n [GEMINI_2_5_FLASH.name]: GEMINI_2_5_FLASH,\n [GEMINI_2_5_FLASH_PREVIEW.name]: GEMINI_2_5_FLASH_PREVIEW,\n [GEMINI_2_5_FLASH_IMAGE.name]: GEMINI_2_5_FLASH_IMAGE,\n [GEMINI_2_5_FLASH_LIVE.name]: GEMINI_2_5_FLASH_LIVE,\n [GEMINI_2_5_FLASH_TTS.name]: GEMINI_2_5_FLASH_TTS,\n [GEMINI_2_5_FLASH_LITE.name]: GEMINI_2_5_FLASH_LITE,\n [GEMINI_2_5_FLASH_LITE_PREVIEW.name]: GEMINI_2_5_FLASH_LITE_PREVIEW,\n [GEMINI_2_FLASH.name]: GEMINI_2_FLASH,\n [GEMINI_2_FLASH_IMAGE.name]: GEMINI_2_FLASH_IMAGE,\n [GEMINI_2_FLASH_LIVE.name]: GEMINI_2_FLASH_LIVE,\n [GEMINI_2_FLASH_LITE.name]: GEMINI_2_FLASH_LITE,\n [IMAGEN_4_GENERATE.name]: IMAGEN_4_GENERATE,\n [IMAGEN_4_GENERATE_ULTRA.name]: IMAGEN_4_GENERATE_ULTRA,\n [IMAGEN_4_GENERATE_FAST.name]: IMAGEN_4_GENERATE_FAST,\n [IMAGEN_3.name]: IMAGEN_3,\n [VEO_3_1_PREVIEW.name]: VEO_3_1_PREVIEW,\n [VEO_3_1_FAST_PREVIEW.name]: VEO_3_1_FAST_PREVIEW,\n [VEO_3.name]: VEO_3,\n [VEO_3_FAST.name]: VEO_3_FAST,\n [VEO_2.name]: VEO_2,\n} as const */\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: ['code_execution', 'file_search', 'google_search', 'url_context'],\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\nexport const GEMINI_MODELS = [\n GEMINI_3_1_PRO.name,\n GEMINI_3_PRO.name,\n GEMINI_3_FLASH.name,\n GEMINI_3_1_FLASH_LITE.name,\n GEMINI_2_5_PRO.name,\n GEMINI_2_5_FLASH.name,\n GEMINI_2_5_FLASH_PREVIEW.name,\n GEMINI_2_5_FLASH_LITE.name,\n GEMINI_2_5_FLASH_LITE_PREVIEW.name,\n GEMINI_2_FLASH.name,\n GEMINI_2_FLASH_LITE.name,\n\n GEMINI_3_5_FLASH.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_1_PRO.name,\n GEMINI_3_PRO.name,\n GEMINI_3_FLASH.name,\n GEMINI_3_1_FLASH_LITE.name,\n GEMINI_3_5_FLASH.name,\n])\n\nexport type GeminiModels = (typeof GEMINI_MODELS)[number]\n\nexport type GeminiImageModels = (typeof GEMINI_IMAGE_MODELS)[number]\n\nexport const GEMINI_IMAGE_MODELS = [\n GEMINI_3_1_FLASH_IMAGE.name,\n GEMINI_3_PRO_IMAGE.name,\n GEMINI_2_5_FLASH_IMAGE.name,\n GEMINI_2_FLASH_IMAGE.name,\n IMAGEN_3.name,\n IMAGEN_4_GENERATE.name,\n IMAGEN_4_GENERATE_FAST.name,\n IMAGEN_4_GENERATE_ULTRA.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/* const GEMINI_AUDIO_MODELS = [\n GEMINI_2_5_PRO_TTS.name,\n GEMINI_2_5_FLASH_TTS.name,\n GEMINI_2_5_FLASH_LIVE.name,\n GEMINI_2_FLASH_LIVE.name,\n] as const\n\n const GEMINI_VIDEO_MODELS = [\n VEO_3_1_PREVIEW.name,\n VEO_3_1_FAST_PREVIEW.name,\n VEO_3.name,\n VEO_3_FAST.name,\n VEO_2.name,\n] as const */\n\n// Manual type map for per-model provider options\nexport type GeminiChatModelProviderOptionsByName = {\n // Models with thinking and structured output support\n [GEMINI_3_1_PRO.name]: GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n [GEMINI_3_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_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_PREVIEW.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 [GEMINI_2_5_FLASH_LITE_PREVIEW.name]: GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions &\n GeminiThinkingOptions\n // Models with structured output but no thinking support\n [GEMINI_2_FLASH.name]: GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions\n [GEMINI_2_FLASH_LITE.name]: GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions &\n GeminiStructuredOutputOptions\n [GEMINI_3_5_FLASH.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_1_PRO.name]: typeof GEMINI_3_1_PRO.supports.tools\n [GEMINI_3_PRO.name]: typeof GEMINI_3_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_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_PREVIEW.name]: typeof GEMINI_2_5_FLASH_PREVIEW.supports.tools\n [GEMINI_2_5_FLASH_LITE.name]: typeof GEMINI_2_5_FLASH_LITE.supports.tools\n [GEMINI_2_5_FLASH_LITE_PREVIEW.name]: typeof GEMINI_2_5_FLASH_LITE_PREVIEW.supports.tools\n [GEMINI_2_FLASH.name]: typeof GEMINI_2_FLASH.supports.tools\n [GEMINI_2_FLASH_LITE.name]: typeof GEMINI_2_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_1_PRO.name]: typeof GEMINI_3_1_PRO.supports.input\n [GEMINI_3_PRO.name]: typeof GEMINI_3_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_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 [GEMINI_2_5_FLASH_LITE_PREVIEW.name]: typeof GEMINI_2_5_FLASH_LITE_PREVIEW.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 [GEMINI_2_5_FLASH_PREVIEW.name]: typeof GEMINI_2_5_FLASH_PREVIEW.supports.input\n [GEMINI_2_FLASH.name]: typeof GEMINI_2_FLASH.supports.input\n [GEMINI_2_FLASH_LITE.name]: typeof GEMINI_2_FLASH_LITE.supports.input\n [GEMINI_3_5_FLASH.name]: typeof GEMINI_3_5_FLASH.supports.input\n}\n"],"names":[],"mappings":"AAmDA,MAAM,iBAAiB;AAAA,EACrB,MAAM;AAwBR;AASA,MAAM,eAAe;AAAA,EACnB,MAAM;AAwBR;AASA,MAAM,iBAAiB;AAAA,EACrB,MAAM;AAwBR;AASA,MAAM,qBAAqB;AAAA,EACzB,MAAM;AAkBR;AASA,MAAM,yBAAyB;AAAA,EAC7B,MAAM;AAkBR;AASA,MAAM,wBAAwB;AAAA,EAC5B,MAAM;AAwBR;AASA,MAAM,iBAAiB;AAAA,EACrB,MAAM;AA8BR;AASA,MAAM,qBAAqB;AAAA,EACzB,MAAM;AAiBR;AAOA,MAAM,mBAAmB;AAAA,EACvB,MAAM;AA8BR;AASA,MAAM,2BAA2B;AAAA,EAC/B,MAAM;AAwBR;AASA,MAAM,yBAAyB;AAAA,EAC7B,MAAM;AAkBR;AAyCA,MAAM,uBAAuB;AAAA,EAC3B,MAAM;AAiBR;AAYA,MAAM,uBAAuB;AAAA,EAC3B,MAAM;AAiBR;AAaA,MAAM,cAAc;AAAA,EAClB,MAAM;AAeR;AAMA,MAAM,eAAe;AAAA,EACnB,MAAM;AAeR;AAEA,MAAM,wBAAwB;AAAA,EAC5B,MAAM;AAwBR;AASA,MAAM,gCAAgC;AAAA,EACpC,MAAM;AAwBR;AASA,MAAM,iBAAiB;AAAA,EACrB,MAAM;AAwBR;AAQA,MAAM,uBAAuB;AAAA,EAC3B,MAAM;AAkBR;AAyCA,MAAM,sBAAsB;AAAA,EAC1B,MAAM;AAuBR;AAQA,MAAM,oBAAoB;AAAA,EACxB,MAAM;AAeR;AAOA,MAAM,0BAA0B;AAAA,EAC9B,MAAM;AAeR;AAOA,MAAM,yBAAyB;AAAA,EAC7B,MAAM;AAeR;AAOA,MAAM,WAAW;AAAA,EACf,MAAM;AAcR;AAmJA,MAAM,mBAAmB;AAAA,EACvB,MAAM;AAwBR;AASO,MAAM,gBAAgB;AAAA,EAC3B,eAAe;AAAA,EACf,aAAa;AAAA,EACb,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,yBAAyB;AAAA,EACzB,sBAAsB;AAAA,EACtB,8BAA8B;AAAA,EAC9B,eAAe;AAAA,EACf,oBAAoB;AAAA,EAEpB,iBAAiB;AACnB;AASO,MAAM,8DAA8C,IAAY;AAAA,EACrE,eAAe;AAAA,EACf,aAAa;AAAA,EACb,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,iBAAiB;AACnB,CAAC;AAMM,MAAM,sBAAsB;AAAA,EACjC,uBAAuB;AAAA,EACvB,mBAAmB;AAAA,EACnB,uBAAuB;AAAA,EACvB,qBAAqB;AAAA,EACrB,SAAS;AAAA,EACT,kBAAkB;AAAA,EAClB,uBAAuB;AAAA,EACvB,wBAAwB;AAC1B;AAMO,MAAM,oBAAoB;AAAA,EAC/B,qBAAqB;AAAA,EACrB,qBAAqB;AAAA,EACrB,mBAAmB;AACrB;AAMO,MAAM,sBAAsB;AAAA,EACjC,YAAY;AAAA,EACZ,aAAa;AACf;AAMO,MAAM,oBAAoB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;"}
|
|
1
|
+
{"version":3,"file":"model-meta.js","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'\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\nconst GEMINI_3_PRO_IMAGE = {\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\nconst GEMINI_3_1_FLASH_IMAGE = {\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\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\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\nconst IMAGEN_3 = {\n name: 'imagen-3.0-generate-002',\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.03,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiCommonConfigOptions &\n GeminiCachedContentOptions\n>\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 GeminiGenerationConfigOptions &\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 GeminiGenerationConfigOptions &\n GeminiCachedContentOptions\n>\n\nconst VEO_3 = {\n name: 'veo-3.0-generate-001',\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 GeminiGenerationConfigOptions &\n GeminiCachedContentOptions\n>\n\nconst VEO_3_FAST = {\n name: 'veo-3.0-fast-generate-001',\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 GeminiGenerationConfigOptions &\n GeminiCachedContentOptions\n>\n\nconst VEO_2 = {\n name: 'veo-2.0-generate-001',\n max_output_tokens: 2,\n supports: {\n input: ['text', 'image'],\n output: ['video'],\n },\n pricing: {\n input: {\n normal: 0,\n },\n output: {\n normal: 0.35,\n },\n },\n} as const satisfies ModelMeta<\n GeminiToolConfigOptions &\n GeminiSafetyOptions &\n GeminiGenerationConfigOptions &\n GeminiCachedContentOptions\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: ['code_execution', 'file_search', 'google_search', 'url_context'],\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\nexport const GEMINI_MODELS = [\n GEMINI_3_5_FLASH.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_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_3_5_FLASH.name,\n])\n\nexport type GeminiModels = (typeof GEMINI_MODELS)[number]\n\nexport type GeminiImageModels = (typeof GEMINI_IMAGE_MODELS)[number]\n\nexport const GEMINI_IMAGE_MODELS = [\n GEMINI_3_1_FLASH_IMAGE.name,\n GEMINI_3_PRO_IMAGE.name,\n GEMINI_2_5_FLASH_IMAGE.name,\n IMAGEN_3.name,\n IMAGEN_4_GENERATE.name,\n IMAGEN_4_GENERATE_FAST.name,\n IMAGEN_4_GENERATE_ULTRA.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/* const GEMINI_AUDIO_MODELS = [\n GEMINI_2_5_PRO_TTS.name,\n GEMINI_2_5_FLASH_TTS.name,\n GEMINI_2_5_FLASH_LIVE.name,\n GEMINI_2_FLASH_LIVE.name,\n] as const\n\n const GEMINI_VIDEO_MODELS = [\n VEO_3_1_PREVIEW.name,\n VEO_3_1_FAST_PREVIEW.name,\n VEO_3.name,\n VEO_3_FAST.name,\n VEO_2.name,\n] as const */\n\n// Manual type map for per-model provider options\nexport type GeminiChatModelProviderOptionsByName = {\n // Models with thinking and structured output support\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 [GEMINI_3_5_FLASH.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_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 [GEMINI_3_5_FLASH.name]: typeof GEMINI_3_5_FLASH.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_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 [GEMINI_3_5_FLASH.name]: typeof GEMINI_3_5_FLASH.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"],"names":[],"mappings":"AAmDA,MAAM,iBAAiB;AAAA,EACrB,MAAM;AAwBR;AASA,MAAM,iBAAiB;AAAA,EACrB,MAAM;AAwBR;AASA,MAAM,qBAAqB;AAAA,EACzB,MAAM;AAkBR;AASA,MAAM,yBAAyB;AAAA,EAC7B,MAAM;AAkBR;AASA,MAAM,wBAAwB;AAAA,EAC5B,MAAM;AAwBR;AASA,MAAM,gCAAgC;AAAA,EACpC,MAAM;AAwBR;AASA,MAAM,iBAAiB;AAAA,EACrB,MAAM;AA8BR;AASA,MAAM,qBAAqB;AAAA,EACzB,MAAM;AAiBR;AAOA,MAAM,mBAAmB;AAAA,EACvB,MAAM;AA8BR;AASA,MAAM,yBAAyB;AAAA,EAC7B,MAAM;AAkBR;AAyCA,MAAM,uBAAuB;AAAA,EAC3B,MAAM;AAiBR;AAYA,MAAM,uBAAuB;AAAA,EAC3B,MAAM;AAiBR;AAaA,MAAM,cAAc;AAAA,EAClB,MAAM;AAeR;AAMA,MAAM,eAAe;AAAA,EACnB,MAAM;AAeR;AAEA,MAAM,wBAAwB;AAAA,EAC5B,MAAM;AAwBR;AASA,MAAM,oBAAoB;AAAA,EACxB,MAAM;AAeR;AAOA,MAAM,0BAA0B;AAAA,EAC9B,MAAM;AAeR;AAOA,MAAM,yBAAyB;AAAA,EAC7B,MAAM;AAeR;AAOA,MAAM,WAAW;AAAA,EACf,MAAM;AAcR;AAyHA,MAAM,mBAAmB;AAAA,EACvB,MAAM;AAwBR;AASO,MAAM,gBAAgB;AAAA,EAC3B,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,8BAA8B;AAAA,EAC9B,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,sBAAsB;AACxB;AASO,MAAM,8DAA8C,IAAY;AAAA,EACrE,eAAe;AAAA,EACf,eAAe;AAAA,EACf,sBAAsB;AAAA,EACtB,8BAA8B;AAAA,EAC9B,iBAAiB;AACnB,CAAC;AAMM,MAAM,sBAAsB;AAAA,EACjC,uBAAuB;AAAA,EACvB,mBAAmB;AAAA,EACnB,uBAAuB;AAAA,EACvB,SAAS;AAAA,EACT,kBAAkB;AAAA,EAClB,uBAAuB;AAAA,EACvB,wBAAwB;AAC1B;AAMO,MAAM,oBAAoB;AAAA,EAC/B,qBAAqB;AAAA,EACrB,qBAAqB;AAAA,EACrB,mBAAmB;AACrB;AAMO,MAAM,sBAAsB;AAAA,EACjC,YAAY;AAAA,EACZ,aAAa;AACf;AAMO,MAAM,oBAAoB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/ai-gemini",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Google Gemini adapter for TanStack AI chat, images, speech, audio generation, and structured outputs.",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -50,13 +50,13 @@
|
|
|
50
50
|
"@tanstack/ai-utils": "0.2.1"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"@tanstack/ai": "^0.
|
|
53
|
+
"@tanstack/ai": "^0.29.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@vitest/coverage-v8": "4.0.14",
|
|
57
57
|
"vite": "^7.3.3",
|
|
58
58
|
"zod": "^4.2.0",
|
|
59
|
-
"@tanstack/ai": "0.
|
|
59
|
+
"@tanstack/ai": "0.29.0"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"build": "vite build",
|
|
@@ -20,7 +20,7 @@ export type GeminiSummarizeModel = (typeof GEMINI_MODELS)[number]
|
|
|
20
20
|
*
|
|
21
21
|
* @example
|
|
22
22
|
* ```typescript
|
|
23
|
-
* const adapter = createGeminiSummarize('AIza...', 'gemini-2.
|
|
23
|
+
* const adapter = createGeminiSummarize('AIza...', 'gemini-2.5-flash');
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
26
|
export function createGeminiSummarize<TModel extends GeminiSummarizeModel>(
|
|
@@ -44,7 +44,7 @@ export function createGeminiSummarize<TModel extends GeminiSummarizeModel>(
|
|
|
44
44
|
*
|
|
45
45
|
* @example
|
|
46
46
|
* ```typescript
|
|
47
|
-
* const adapter = geminiSummarize('gemini-2.
|
|
47
|
+
* const adapter = geminiSummarize('gemini-2.5-flash');
|
|
48
48
|
* await summarize({ adapter, text: 'Long article text...' });
|
|
49
49
|
* ```
|
|
50
50
|
*/
|
package/src/model-meta.ts
CHANGED
|
@@ -83,8 +83,8 @@ const GEMINI_3_1_PRO = {
|
|
|
83
83
|
GeminiThinkingOptions
|
|
84
84
|
>
|
|
85
85
|
|
|
86
|
-
const
|
|
87
|
-
name: 'gemini-3-
|
|
86
|
+
const GEMINI_3_FLASH = {
|
|
87
|
+
name: 'gemini-3-flash-preview',
|
|
88
88
|
max_input_tokens: 1_048_576,
|
|
89
89
|
max_output_tokens: 65_536,
|
|
90
90
|
knowledge_cutoff: '2025-01-01',
|
|
@@ -102,10 +102,10 @@ const GEMINI_3_PRO = {
|
|
|
102
102
|
},
|
|
103
103
|
pricing: {
|
|
104
104
|
input: {
|
|
105
|
-
normal:
|
|
105
|
+
normal: 0.5,
|
|
106
106
|
},
|
|
107
107
|
output: {
|
|
108
|
-
normal:
|
|
108
|
+
normal: 3,
|
|
109
109
|
},
|
|
110
110
|
},
|
|
111
111
|
} as const satisfies ModelMeta<
|
|
@@ -117,29 +117,23 @@ const GEMINI_3_PRO = {
|
|
|
117
117
|
GeminiThinkingOptions
|
|
118
118
|
>
|
|
119
119
|
|
|
120
|
-
const
|
|
121
|
-
name: 'gemini-3-
|
|
122
|
-
max_input_tokens:
|
|
123
|
-
max_output_tokens:
|
|
120
|
+
const GEMINI_3_PRO_IMAGE = {
|
|
121
|
+
name: 'gemini-3-pro-image-preview',
|
|
122
|
+
max_input_tokens: 65_536,
|
|
123
|
+
max_output_tokens: 32_768,
|
|
124
124
|
knowledge_cutoff: '2025-01-01',
|
|
125
125
|
supports: {
|
|
126
|
-
input: ['text', 'image'
|
|
127
|
-
output: ['text'],
|
|
128
|
-
capabilities: [
|
|
129
|
-
|
|
130
|
-
'caching',
|
|
131
|
-
'function_calling',
|
|
132
|
-
'structured_output',
|
|
133
|
-
'thinking',
|
|
134
|
-
],
|
|
135
|
-
tools: ['code_execution', 'file_search', 'google_search', 'url_context'],
|
|
126
|
+
input: ['text', 'image'],
|
|
127
|
+
output: ['text', 'image'],
|
|
128
|
+
capabilities: ['batch_api', 'structured_output', 'thinking'],
|
|
129
|
+
tools: ['google_search'],
|
|
136
130
|
},
|
|
137
131
|
pricing: {
|
|
138
132
|
input: {
|
|
139
|
-
normal:
|
|
133
|
+
normal: 2,
|
|
140
134
|
},
|
|
141
135
|
output: {
|
|
142
|
-
normal:
|
|
136
|
+
normal: 0.134,
|
|
143
137
|
},
|
|
144
138
|
},
|
|
145
139
|
} as const satisfies ModelMeta<
|
|
@@ -151,10 +145,10 @@ const GEMINI_3_FLASH = {
|
|
|
151
145
|
GeminiThinkingOptions
|
|
152
146
|
>
|
|
153
147
|
|
|
154
|
-
const
|
|
155
|
-
name: 'gemini-3-
|
|
148
|
+
const GEMINI_3_1_FLASH_IMAGE = {
|
|
149
|
+
name: 'gemini-3.1-flash-image-preview',
|
|
156
150
|
max_input_tokens: 65_536,
|
|
157
|
-
max_output_tokens:
|
|
151
|
+
max_output_tokens: 65_536,
|
|
158
152
|
knowledge_cutoff: '2025-01-01',
|
|
159
153
|
supports: {
|
|
160
154
|
input: ['text', 'image'],
|
|
@@ -164,10 +158,10 @@ const GEMINI_3_PRO_IMAGE = {
|
|
|
164
158
|
},
|
|
165
159
|
pricing: {
|
|
166
160
|
input: {
|
|
167
|
-
normal:
|
|
161
|
+
normal: 0.25,
|
|
168
162
|
},
|
|
169
163
|
output: {
|
|
170
|
-
normal:
|
|
164
|
+
normal: 1.5,
|
|
171
165
|
},
|
|
172
166
|
},
|
|
173
167
|
} as const satisfies ModelMeta<
|
|
@@ -179,16 +173,22 @@ const GEMINI_3_PRO_IMAGE = {
|
|
|
179
173
|
GeminiThinkingOptions
|
|
180
174
|
>
|
|
181
175
|
|
|
182
|
-
const
|
|
183
|
-
name: 'gemini-3.1-flash-
|
|
184
|
-
max_input_tokens:
|
|
176
|
+
const GEMINI_3_1_FLASH_LITE = {
|
|
177
|
+
name: 'gemini-3.1-flash-lite',
|
|
178
|
+
max_input_tokens: 1_048_576,
|
|
185
179
|
max_output_tokens: 65_536,
|
|
186
180
|
knowledge_cutoff: '2025-01-01',
|
|
187
181
|
supports: {
|
|
188
|
-
input: ['text', 'image'],
|
|
189
|
-
output: ['text'
|
|
190
|
-
capabilities: [
|
|
191
|
-
|
|
182
|
+
input: ['text', 'image', 'audio', 'video', 'document'],
|
|
183
|
+
output: ['text'],
|
|
184
|
+
capabilities: [
|
|
185
|
+
'batch_api',
|
|
186
|
+
'caching',
|
|
187
|
+
'function_calling',
|
|
188
|
+
'structured_output',
|
|
189
|
+
'thinking',
|
|
190
|
+
],
|
|
191
|
+
tools: ['code_execution', 'file_search', 'google_search', 'url_context'],
|
|
192
192
|
},
|
|
193
193
|
pricing: {
|
|
194
194
|
input: {
|
|
@@ -207,7 +207,7 @@ const GEMINI_3_1_FLASH_IMAGE = {
|
|
|
207
207
|
GeminiThinkingOptions
|
|
208
208
|
>
|
|
209
209
|
|
|
210
|
-
const
|
|
210
|
+
const GEMINI_3_1_FLASH_LITE_PREVIEW = {
|
|
211
211
|
name: 'gemini-3.1-flash-lite-preview',
|
|
212
212
|
max_input_tokens: 1_048_576,
|
|
213
213
|
max_output_tokens: 65_536,
|
|
@@ -346,40 +346,6 @@ const GEMINI_2_5_FLASH = {
|
|
|
346
346
|
GeminiThinkingOptions
|
|
347
347
|
>
|
|
348
348
|
|
|
349
|
-
const GEMINI_2_5_FLASH_PREVIEW = {
|
|
350
|
-
name: 'gemini-2.5-flash-preview-09-2025',
|
|
351
|
-
max_input_tokens: 1_048_576,
|
|
352
|
-
max_output_tokens: 65_536,
|
|
353
|
-
knowledge_cutoff: '2025-01-01',
|
|
354
|
-
supports: {
|
|
355
|
-
input: ['text', 'image', 'audio', 'video'],
|
|
356
|
-
output: ['text'],
|
|
357
|
-
capabilities: [
|
|
358
|
-
'batch_api',
|
|
359
|
-
'caching',
|
|
360
|
-
'function_calling',
|
|
361
|
-
'structured_output',
|
|
362
|
-
'thinking',
|
|
363
|
-
],
|
|
364
|
-
tools: ['code_execution', 'file_search', 'google_search', 'url_context'],
|
|
365
|
-
},
|
|
366
|
-
pricing: {
|
|
367
|
-
input: {
|
|
368
|
-
normal: 1,
|
|
369
|
-
},
|
|
370
|
-
output: {
|
|
371
|
-
normal: 2.5,
|
|
372
|
-
},
|
|
373
|
-
},
|
|
374
|
-
} as const satisfies ModelMeta<
|
|
375
|
-
GeminiToolConfigOptions &
|
|
376
|
-
GeminiSafetyOptions &
|
|
377
|
-
GeminiCommonConfigOptions &
|
|
378
|
-
GeminiCachedContentOptions &
|
|
379
|
-
GeminiStructuredOutputOptions &
|
|
380
|
-
GeminiThinkingOptions
|
|
381
|
-
>
|
|
382
|
-
|
|
383
349
|
const GEMINI_2_5_FLASH_IMAGE = {
|
|
384
350
|
name: 'gemini-2.5-flash-image',
|
|
385
351
|
max_input_tokens: 1_048_576,
|
|
@@ -575,165 +541,6 @@ const GEMINI_2_5_FLASH_LITE = {
|
|
|
575
541
|
GeminiThinkingOptions
|
|
576
542
|
>
|
|
577
543
|
|
|
578
|
-
const GEMINI_2_5_FLASH_LITE_PREVIEW = {
|
|
579
|
-
name: 'gemini-2.5-flash-lite-preview-09-2025',
|
|
580
|
-
max_input_tokens: 1_048_576,
|
|
581
|
-
max_output_tokens: 65_536,
|
|
582
|
-
knowledge_cutoff: '2025-01-01',
|
|
583
|
-
supports: {
|
|
584
|
-
input: ['text', 'image', 'audio', 'video', 'document'],
|
|
585
|
-
output: ['text'],
|
|
586
|
-
capabilities: [
|
|
587
|
-
'batch_api',
|
|
588
|
-
'caching',
|
|
589
|
-
'function_calling',
|
|
590
|
-
'structured_output',
|
|
591
|
-
'thinking',
|
|
592
|
-
],
|
|
593
|
-
tools: ['code_execution', 'google_search', 'url_context'],
|
|
594
|
-
},
|
|
595
|
-
pricing: {
|
|
596
|
-
input: {
|
|
597
|
-
normal: 0.1,
|
|
598
|
-
},
|
|
599
|
-
output: {
|
|
600
|
-
normal: 0.4,
|
|
601
|
-
},
|
|
602
|
-
},
|
|
603
|
-
} as const satisfies ModelMeta<
|
|
604
|
-
GeminiToolConfigOptions &
|
|
605
|
-
GeminiSafetyOptions &
|
|
606
|
-
GeminiCommonConfigOptions &
|
|
607
|
-
GeminiCachedContentOptions &
|
|
608
|
-
GeminiStructuredOutputOptions &
|
|
609
|
-
GeminiThinkingOptions
|
|
610
|
-
>
|
|
611
|
-
|
|
612
|
-
const GEMINI_2_FLASH = {
|
|
613
|
-
name: 'gemini-2.0-flash',
|
|
614
|
-
max_input_tokens: 1_048_576,
|
|
615
|
-
max_output_tokens: 8_192,
|
|
616
|
-
knowledge_cutoff: '2024-08-01',
|
|
617
|
-
supports: {
|
|
618
|
-
input: ['text', 'image', 'audio', 'video'],
|
|
619
|
-
output: ['text'],
|
|
620
|
-
capabilities: [
|
|
621
|
-
'batch_api',
|
|
622
|
-
'caching',
|
|
623
|
-
'function_calling',
|
|
624
|
-
'live_api',
|
|
625
|
-
'structured_output',
|
|
626
|
-
],
|
|
627
|
-
tools: ['code_execution', 'google_maps', 'google_search'],
|
|
628
|
-
},
|
|
629
|
-
pricing: {
|
|
630
|
-
input: {
|
|
631
|
-
normal: 0.1,
|
|
632
|
-
},
|
|
633
|
-
output: {
|
|
634
|
-
normal: 0.4,
|
|
635
|
-
},
|
|
636
|
-
},
|
|
637
|
-
} as const satisfies ModelMeta<
|
|
638
|
-
GeminiToolConfigOptions &
|
|
639
|
-
GeminiSafetyOptions &
|
|
640
|
-
GeminiCommonConfigOptions &
|
|
641
|
-
GeminiCachedContentOptions &
|
|
642
|
-
GeminiStructuredOutputOptions
|
|
643
|
-
>
|
|
644
|
-
|
|
645
|
-
const GEMINI_2_FLASH_IMAGE = {
|
|
646
|
-
name: 'gemini-2.0-flash-preview-image-generation',
|
|
647
|
-
max_input_tokens: 32_768,
|
|
648
|
-
max_output_tokens: 8_192,
|
|
649
|
-
knowledge_cutoff: '2024-08-01',
|
|
650
|
-
supports: {
|
|
651
|
-
input: ['text', 'image', 'audio', 'video'],
|
|
652
|
-
output: ['text', 'image'],
|
|
653
|
-
capabilities: ['batch_api', 'caching', 'structured_output'],
|
|
654
|
-
tools: [],
|
|
655
|
-
},
|
|
656
|
-
pricing: {
|
|
657
|
-
input: {
|
|
658
|
-
normal: 0.1,
|
|
659
|
-
},
|
|
660
|
-
output: {
|
|
661
|
-
normal: 0.039,
|
|
662
|
-
},
|
|
663
|
-
},
|
|
664
|
-
} as const satisfies ModelMeta<
|
|
665
|
-
GeminiToolConfigOptions &
|
|
666
|
-
GeminiSafetyOptions &
|
|
667
|
-
GeminiCommonConfigOptions &
|
|
668
|
-
GeminiCachedContentOptions
|
|
669
|
-
>
|
|
670
|
-
/*
|
|
671
|
-
const GEMINI_2_FLASH_LIVE = {
|
|
672
|
-
name: 'gemini-2.0-flash-live-001',
|
|
673
|
-
max_input_tokens: 1_048_576,
|
|
674
|
-
max_output_tokens: 8_192,
|
|
675
|
-
knowledge_cutoff: '2024-08-01',
|
|
676
|
-
supports: {
|
|
677
|
-
input: ['text', 'audio', 'video'],
|
|
678
|
-
output: ['text', 'audio'],
|
|
679
|
-
capabilities: [
|
|
680
|
-
'audio_generation',
|
|
681
|
-
'code_execution',
|
|
682
|
-
'function_calling',
|
|
683
|
-
'live_api',
|
|
684
|
-
'search_grounding',
|
|
685
|
-
'structured_output',
|
|
686
|
-
'url_context',
|
|
687
|
-
],
|
|
688
|
-
},
|
|
689
|
-
pricing: {
|
|
690
|
-
// todo find this info
|
|
691
|
-
input: {
|
|
692
|
-
normal: 0,
|
|
693
|
-
},
|
|
694
|
-
output: {
|
|
695
|
-
normal: 0,
|
|
696
|
-
},
|
|
697
|
-
},
|
|
698
|
-
} as const satisfies ModelMeta<
|
|
699
|
-
GeminiToolConfigOptions &
|
|
700
|
-
GeminiSafetyOptions &
|
|
701
|
-
GeminiGenerationConfigOptions &
|
|
702
|
-
GeminiCachedContentOptions
|
|
703
|
-
> */
|
|
704
|
-
|
|
705
|
-
const GEMINI_2_FLASH_LITE = {
|
|
706
|
-
name: 'gemini-2.0-flash-lite',
|
|
707
|
-
max_input_tokens: 1_048_576,
|
|
708
|
-
max_output_tokens: 8_192,
|
|
709
|
-
knowledge_cutoff: '2024-08-01',
|
|
710
|
-
supports: {
|
|
711
|
-
input: ['text', 'audio', 'video', 'image'],
|
|
712
|
-
output: ['text'],
|
|
713
|
-
capabilities: [
|
|
714
|
-
'batch_api',
|
|
715
|
-
'caching',
|
|
716
|
-
'function_calling',
|
|
717
|
-
'structured_output',
|
|
718
|
-
],
|
|
719
|
-
tools: [],
|
|
720
|
-
},
|
|
721
|
-
pricing: {
|
|
722
|
-
input: {
|
|
723
|
-
normal: 0.075,
|
|
724
|
-
},
|
|
725
|
-
output: {
|
|
726
|
-
normal: 0.3,
|
|
727
|
-
},
|
|
728
|
-
},
|
|
729
|
-
} as const satisfies ModelMeta<
|
|
730
|
-
GeminiToolConfigOptions &
|
|
731
|
-
GeminiSafetyOptions &
|
|
732
|
-
GeminiCommonConfigOptions &
|
|
733
|
-
GeminiCachedContentOptions &
|
|
734
|
-
GeminiStructuredOutputOptions
|
|
735
|
-
>
|
|
736
|
-
|
|
737
544
|
const IMAGEN_4_GENERATE = {
|
|
738
545
|
name: 'imagen-4.0-generate-001',
|
|
739
546
|
max_input_tokens: 480,
|
|
@@ -939,32 +746,6 @@ const VEO_2 = {
|
|
|
939
746
|
GeminiCachedContentOptions
|
|
940
747
|
> */
|
|
941
748
|
|
|
942
|
-
/* const GEMINI_MODEL_META = {
|
|
943
|
-
[GEMINI_3_PRO.name]: GEMINI_3_PRO,
|
|
944
|
-
[GEMINI_2_5_PRO.name]: GEMINI_2_5_PRO,
|
|
945
|
-
[GEMINI_2_5_PRO_TTS.name]: GEMINI_2_5_PRO_TTS,
|
|
946
|
-
[GEMINI_2_5_FLASH.name]: GEMINI_2_5_FLASH,
|
|
947
|
-
[GEMINI_2_5_FLASH_PREVIEW.name]: GEMINI_2_5_FLASH_PREVIEW,
|
|
948
|
-
[GEMINI_2_5_FLASH_IMAGE.name]: GEMINI_2_5_FLASH_IMAGE,
|
|
949
|
-
[GEMINI_2_5_FLASH_LIVE.name]: GEMINI_2_5_FLASH_LIVE,
|
|
950
|
-
[GEMINI_2_5_FLASH_TTS.name]: GEMINI_2_5_FLASH_TTS,
|
|
951
|
-
[GEMINI_2_5_FLASH_LITE.name]: GEMINI_2_5_FLASH_LITE,
|
|
952
|
-
[GEMINI_2_5_FLASH_LITE_PREVIEW.name]: GEMINI_2_5_FLASH_LITE_PREVIEW,
|
|
953
|
-
[GEMINI_2_FLASH.name]: GEMINI_2_FLASH,
|
|
954
|
-
[GEMINI_2_FLASH_IMAGE.name]: GEMINI_2_FLASH_IMAGE,
|
|
955
|
-
[GEMINI_2_FLASH_LIVE.name]: GEMINI_2_FLASH_LIVE,
|
|
956
|
-
[GEMINI_2_FLASH_LITE.name]: GEMINI_2_FLASH_LITE,
|
|
957
|
-
[IMAGEN_4_GENERATE.name]: IMAGEN_4_GENERATE,
|
|
958
|
-
[IMAGEN_4_GENERATE_ULTRA.name]: IMAGEN_4_GENERATE_ULTRA,
|
|
959
|
-
[IMAGEN_4_GENERATE_FAST.name]: IMAGEN_4_GENERATE_FAST,
|
|
960
|
-
[IMAGEN_3.name]: IMAGEN_3,
|
|
961
|
-
[VEO_3_1_PREVIEW.name]: VEO_3_1_PREVIEW,
|
|
962
|
-
[VEO_3_1_FAST_PREVIEW.name]: VEO_3_1_FAST_PREVIEW,
|
|
963
|
-
[VEO_3.name]: VEO_3,
|
|
964
|
-
[VEO_3_FAST.name]: VEO_3_FAST,
|
|
965
|
-
[VEO_2.name]: VEO_2,
|
|
966
|
-
} as const */
|
|
967
|
-
|
|
968
749
|
const GEMINI_3_5_FLASH = {
|
|
969
750
|
name: 'gemini-3.5-flash',
|
|
970
751
|
max_input_tokens: 1_048_576,
|
|
@@ -1000,19 +781,14 @@ const GEMINI_3_5_FLASH = {
|
|
|
1000
781
|
>
|
|
1001
782
|
|
|
1002
783
|
export const GEMINI_MODELS = [
|
|
784
|
+
GEMINI_3_5_FLASH.name,
|
|
1003
785
|
GEMINI_3_1_PRO.name,
|
|
1004
|
-
GEMINI_3_PRO.name,
|
|
1005
786
|
GEMINI_3_FLASH.name,
|
|
1006
787
|
GEMINI_3_1_FLASH_LITE.name,
|
|
788
|
+
GEMINI_3_1_FLASH_LITE_PREVIEW.name,
|
|
1007
789
|
GEMINI_2_5_PRO.name,
|
|
1008
790
|
GEMINI_2_5_FLASH.name,
|
|
1009
|
-
GEMINI_2_5_FLASH_PREVIEW.name,
|
|
1010
791
|
GEMINI_2_5_FLASH_LITE.name,
|
|
1011
|
-
GEMINI_2_5_FLASH_LITE_PREVIEW.name,
|
|
1012
|
-
GEMINI_2_FLASH.name,
|
|
1013
|
-
GEMINI_2_FLASH_LITE.name,
|
|
1014
|
-
|
|
1015
|
-
GEMINI_3_5_FLASH.name,
|
|
1016
792
|
] as const
|
|
1017
793
|
|
|
1018
794
|
/**
|
|
@@ -1024,9 +800,9 @@ export const GEMINI_MODELS = [
|
|
|
1024
800
|
*/
|
|
1025
801
|
export const GEMINI_COMBINED_TOOLS_AND_SCHEMA_MODELS = new Set<string>([
|
|
1026
802
|
GEMINI_3_1_PRO.name,
|
|
1027
|
-
GEMINI_3_PRO.name,
|
|
1028
803
|
GEMINI_3_FLASH.name,
|
|
1029
804
|
GEMINI_3_1_FLASH_LITE.name,
|
|
805
|
+
GEMINI_3_1_FLASH_LITE_PREVIEW.name,
|
|
1030
806
|
GEMINI_3_5_FLASH.name,
|
|
1031
807
|
])
|
|
1032
808
|
|
|
@@ -1038,7 +814,6 @@ export const GEMINI_IMAGE_MODELS = [
|
|
|
1038
814
|
GEMINI_3_1_FLASH_IMAGE.name,
|
|
1039
815
|
GEMINI_3_PRO_IMAGE.name,
|
|
1040
816
|
GEMINI_2_5_FLASH_IMAGE.name,
|
|
1041
|
-
GEMINI_2_FLASH_IMAGE.name,
|
|
1042
817
|
IMAGEN_3.name,
|
|
1043
818
|
IMAGEN_4_GENERATE.name,
|
|
1044
819
|
IMAGEN_4_GENERATE_FAST.name,
|
|
@@ -1127,12 +902,6 @@ export type GeminiChatModelProviderOptionsByName = {
|
|
|
1127
902
|
GeminiCachedContentOptions &
|
|
1128
903
|
GeminiStructuredOutputOptions &
|
|
1129
904
|
GeminiThinkingOptions
|
|
1130
|
-
[GEMINI_3_PRO.name]: GeminiToolConfigOptions &
|
|
1131
|
-
GeminiSafetyOptions &
|
|
1132
|
-
GeminiCommonConfigOptions &
|
|
1133
|
-
GeminiCachedContentOptions &
|
|
1134
|
-
GeminiStructuredOutputOptions &
|
|
1135
|
-
GeminiThinkingOptions
|
|
1136
905
|
[GEMINI_3_FLASH.name]: GeminiToolConfigOptions &
|
|
1137
906
|
GeminiSafetyOptions &
|
|
1138
907
|
GeminiCommonConfigOptions &
|
|
@@ -1145,19 +914,19 @@ export type GeminiChatModelProviderOptionsByName = {
|
|
|
1145
914
|
GeminiCachedContentOptions &
|
|
1146
915
|
GeminiStructuredOutputOptions &
|
|
1147
916
|
GeminiThinkingOptions
|
|
1148
|
-
[
|
|
917
|
+
[GEMINI_3_1_FLASH_LITE_PREVIEW.name]: GeminiToolConfigOptions &
|
|
1149
918
|
GeminiSafetyOptions &
|
|
1150
919
|
GeminiCommonConfigOptions &
|
|
1151
920
|
GeminiCachedContentOptions &
|
|
1152
921
|
GeminiStructuredOutputOptions &
|
|
1153
922
|
GeminiThinkingOptions
|
|
1154
|
-
[
|
|
923
|
+
[GEMINI_2_5_PRO.name]: GeminiToolConfigOptions &
|
|
1155
924
|
GeminiSafetyOptions &
|
|
1156
925
|
GeminiCommonConfigOptions &
|
|
1157
926
|
GeminiCachedContentOptions &
|
|
1158
927
|
GeminiStructuredOutputOptions &
|
|
1159
928
|
GeminiThinkingOptions
|
|
1160
|
-
[
|
|
929
|
+
[GEMINI_2_5_FLASH.name]: GeminiToolConfigOptions &
|
|
1161
930
|
GeminiSafetyOptions &
|
|
1162
931
|
GeminiCommonConfigOptions &
|
|
1163
932
|
GeminiCachedContentOptions &
|
|
@@ -1169,23 +938,6 @@ export type GeminiChatModelProviderOptionsByName = {
|
|
|
1169
938
|
GeminiCachedContentOptions &
|
|
1170
939
|
GeminiStructuredOutputOptions &
|
|
1171
940
|
GeminiThinkingOptions
|
|
1172
|
-
[GEMINI_2_5_FLASH_LITE_PREVIEW.name]: GeminiToolConfigOptions &
|
|
1173
|
-
GeminiSafetyOptions &
|
|
1174
|
-
GeminiCommonConfigOptions &
|
|
1175
|
-
GeminiCachedContentOptions &
|
|
1176
|
-
GeminiStructuredOutputOptions &
|
|
1177
|
-
GeminiThinkingOptions
|
|
1178
|
-
// Models with structured output but no thinking support
|
|
1179
|
-
[GEMINI_2_FLASH.name]: GeminiToolConfigOptions &
|
|
1180
|
-
GeminiSafetyOptions &
|
|
1181
|
-
GeminiCommonConfigOptions &
|
|
1182
|
-
GeminiCachedContentOptions &
|
|
1183
|
-
GeminiStructuredOutputOptions
|
|
1184
|
-
[GEMINI_2_FLASH_LITE.name]: GeminiToolConfigOptions &
|
|
1185
|
-
GeminiSafetyOptions &
|
|
1186
|
-
GeminiCommonConfigOptions &
|
|
1187
|
-
GeminiCachedContentOptions &
|
|
1188
|
-
GeminiStructuredOutputOptions
|
|
1189
941
|
[GEMINI_3_5_FLASH.name]: GeminiToolConfigOptions &
|
|
1190
942
|
GeminiSafetyOptions &
|
|
1191
943
|
GeminiCommonConfigOptions &
|
|
@@ -1200,16 +952,13 @@ export type GeminiChatModelProviderOptionsByName = {
|
|
|
1200
952
|
*/
|
|
1201
953
|
export type GeminiChatModelToolCapabilitiesByName = {
|
|
1202
954
|
[GEMINI_3_1_PRO.name]: typeof GEMINI_3_1_PRO.supports.tools
|
|
1203
|
-
[GEMINI_3_PRO.name]: typeof GEMINI_3_PRO.supports.tools
|
|
1204
955
|
[GEMINI_3_FLASH.name]: typeof GEMINI_3_FLASH.supports.tools
|
|
1205
956
|
[GEMINI_3_1_FLASH_LITE.name]: typeof GEMINI_3_1_FLASH_LITE.supports.tools
|
|
957
|
+
[GEMINI_3_1_FLASH_LITE_PREVIEW.name]: typeof GEMINI_3_1_FLASH_LITE_PREVIEW.supports.tools
|
|
1206
958
|
[GEMINI_2_5_PRO.name]: typeof GEMINI_2_5_PRO.supports.tools
|
|
1207
959
|
[GEMINI_2_5_FLASH.name]: typeof GEMINI_2_5_FLASH.supports.tools
|
|
1208
|
-
[GEMINI_2_5_FLASH_PREVIEW.name]: typeof GEMINI_2_5_FLASH_PREVIEW.supports.tools
|
|
1209
960
|
[GEMINI_2_5_FLASH_LITE.name]: typeof GEMINI_2_5_FLASH_LITE.supports.tools
|
|
1210
|
-
[
|
|
1211
|
-
[GEMINI_2_FLASH.name]: typeof GEMINI_2_FLASH.supports.tools
|
|
1212
|
-
[GEMINI_2_FLASH_LITE.name]: typeof GEMINI_2_FLASH_LITE.supports.tools
|
|
961
|
+
[GEMINI_3_5_FLASH.name]: typeof GEMINI_3_5_FLASH.supports.tools
|
|
1213
962
|
}
|
|
1214
963
|
|
|
1215
964
|
/**
|
|
@@ -1228,17 +977,13 @@ export type GeminiChatModelToolCapabilitiesByName = {
|
|
|
1228
977
|
export type GeminiModelInputModalitiesByName = {
|
|
1229
978
|
// Models with full multimodal support (text, image, audio, video, document)
|
|
1230
979
|
[GEMINI_3_1_PRO.name]: typeof GEMINI_3_1_PRO.supports.input
|
|
1231
|
-
[GEMINI_3_PRO.name]: typeof GEMINI_3_PRO.supports.input
|
|
1232
980
|
[GEMINI_3_FLASH.name]: typeof GEMINI_3_FLASH.supports.input
|
|
1233
981
|
[GEMINI_3_1_FLASH_LITE.name]: typeof GEMINI_3_1_FLASH_LITE.supports.input
|
|
982
|
+
[GEMINI_3_1_FLASH_LITE_PREVIEW.name]: typeof GEMINI_3_1_FLASH_LITE_PREVIEW.supports.input
|
|
1234
983
|
[GEMINI_2_5_PRO.name]: typeof GEMINI_2_5_PRO.supports.input
|
|
1235
984
|
[GEMINI_2_5_FLASH_LITE.name]: typeof GEMINI_2_5_FLASH_LITE.supports.input
|
|
1236
|
-
[
|
|
985
|
+
[GEMINI_3_5_FLASH.name]: typeof GEMINI_3_5_FLASH.supports.input
|
|
1237
986
|
|
|
1238
987
|
// Models with text, image, audio, video (no document)
|
|
1239
988
|
[GEMINI_2_5_FLASH.name]: typeof GEMINI_2_5_FLASH.supports.input
|
|
1240
|
-
[GEMINI_2_5_FLASH_PREVIEW.name]: typeof GEMINI_2_5_FLASH_PREVIEW.supports.input
|
|
1241
|
-
[GEMINI_2_FLASH.name]: typeof GEMINI_2_FLASH.supports.input
|
|
1242
|
-
[GEMINI_2_FLASH_LITE.name]: typeof GEMINI_2_FLASH_LITE.supports.input
|
|
1243
|
-
[GEMINI_3_5_FLASH.name]: typeof GEMINI_3_5_FLASH.supports.input
|
|
1244
989
|
}
|