@ai-sdk/google 4.0.0-beta.4 → 4.0.0-beta.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,10 @@
1
1
  import {
2
- EmbeddingModelV3,
3
- Experimental_VideoModelV3,
4
- ImageModelV3,
5
- LanguageModelV3,
6
- ProviderV3,
2
+ EmbeddingModelV4,
3
+ Experimental_VideoModelV4,
4
+ FilesV4,
5
+ ImageModelV4,
6
+ LanguageModelV4,
7
+ ProviderV4,
7
8
  } from '@ai-sdk/provider';
8
9
  import {
9
10
  FetchFunction,
@@ -24,15 +25,16 @@ import {
24
25
  GoogleGenerativeAIImageModelId,
25
26
  } from './google-generative-ai-image-settings';
26
27
  import { GoogleGenerativeAIImageModel } from './google-generative-ai-image-model';
28
+ import { GoogleGenerativeAIFiles } from './google-generative-ai-files';
27
29
  import { GoogleGenerativeAIVideoModel } from './google-generative-ai-video-model';
28
30
  import { GoogleGenerativeAIVideoModelId } from './google-generative-ai-video-settings';
29
31
 
30
- export interface GoogleGenerativeAIProvider extends ProviderV3 {
31
- (modelId: GoogleGenerativeAIModelId): LanguageModelV3;
32
+ export interface GoogleGenerativeAIProvider extends ProviderV4 {
33
+ (modelId: GoogleGenerativeAIModelId): LanguageModelV4;
32
34
 
33
- languageModel(modelId: GoogleGenerativeAIModelId): LanguageModelV3;
35
+ languageModel(modelId: GoogleGenerativeAIModelId): LanguageModelV4;
34
36
 
35
- chat(modelId: GoogleGenerativeAIModelId): LanguageModelV3;
37
+ chat(modelId: GoogleGenerativeAIModelId): LanguageModelV4;
36
38
 
37
39
  /**
38
40
  * Creates a model for image generation.
@@ -40,46 +42,48 @@ export interface GoogleGenerativeAIProvider extends ProviderV3 {
40
42
  image(
41
43
  modelId: GoogleGenerativeAIImageModelId,
42
44
  settings?: GoogleGenerativeAIImageSettings,
43
- ): ImageModelV3;
45
+ ): ImageModelV4;
44
46
 
45
47
  /**
46
48
  * @deprecated Use `chat()` instead.
47
49
  */
48
- generativeAI(modelId: GoogleGenerativeAIModelId): LanguageModelV3;
50
+ generativeAI(modelId: GoogleGenerativeAIModelId): LanguageModelV4;
49
51
 
50
52
  /**
51
53
  * Creates a model for text embeddings.
52
54
  */
53
- embedding(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV3;
55
+ embedding(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV4;
54
56
 
55
57
  /**
56
58
  * Creates a model for text embeddings.
57
59
  */
58
- embeddingModel(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV3;
60
+ embeddingModel(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV4;
59
61
 
60
62
  /**
61
63
  * @deprecated Use `embedding` instead.
62
64
  */
63
- textEmbedding(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV3;
65
+ textEmbedding(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV4;
64
66
 
65
67
  /**
66
68
  * @deprecated Use `embeddingModel` instead.
67
69
  */
68
70
  textEmbeddingModel(
69
71
  modelId: GoogleGenerativeAIEmbeddingModelId,
70
- ): EmbeddingModelV3;
72
+ ): EmbeddingModelV4;
71
73
 
72
74
  /**
73
75
  * Creates a model for video generation.
74
76
  */
75
- video(modelId: GoogleGenerativeAIVideoModelId): Experimental_VideoModelV3;
77
+ video(modelId: GoogleGenerativeAIVideoModelId): Experimental_VideoModelV4;
76
78
 
77
79
  /**
78
80
  * Creates a model for video generation.
79
81
  */
80
82
  videoModel(
81
83
  modelId: GoogleGenerativeAIVideoModelId,
82
- ): Experimental_VideoModelV3;
84
+ ): Experimental_VideoModelV4;
85
+
86
+ files(): FilesV4;
83
87
 
84
88
  tools: typeof googleTools;
85
89
  }
@@ -185,6 +189,14 @@ export function createGoogleGenerativeAI(
185
189
  fetch: options.fetch,
186
190
  });
187
191
 
192
+ const createFiles = () =>
193
+ new GoogleGenerativeAIFiles({
194
+ provider: providerName,
195
+ baseURL,
196
+ headers: getHeaders,
197
+ fetch: options.fetch,
198
+ });
199
+
188
200
  const createVideoModel = (modelId: GoogleGenerativeAIVideoModelId) =>
189
201
  new GoogleGenerativeAIVideoModel(modelId, {
190
202
  provider: providerName,
@@ -204,7 +216,7 @@ export function createGoogleGenerativeAI(
204
216
  return createChatModel(modelId);
205
217
  };
206
218
 
207
- provider.specificationVersion = 'v3' as const;
219
+ provider.specificationVersion = 'v4' as const;
208
220
  provider.languageModel = createChatModel;
209
221
  provider.chat = createChatModel;
210
222
  provider.generativeAI = createChatModel;
@@ -216,6 +228,7 @@ export function createGoogleGenerativeAI(
216
228
  provider.imageModel = createImageModel;
217
229
  provider.video = createVideoModel;
218
230
  provider.videoModel = createVideoModel;
231
+ provider.files = createFiles;
219
232
  provider.tools = googleTools;
220
233
 
221
234
  return provider as GoogleGenerativeAIProvider;
package/src/index.ts CHANGED
@@ -21,6 +21,7 @@ export type {
21
21
  GoogleVideoModelOptions as GoogleGenerativeAIVideoProviderOptions,
22
22
  } from './google-generative-ai-video-model';
23
23
  export type { GoogleGenerativeAIVideoModelId } from './google-generative-ai-video-settings';
24
+ export type { GoogleFilesUploadOptions } from './google-generative-ai-files';
24
25
  export { createGoogleGenerativeAI, google } from './google-provider';
25
26
  export type {
26
27
  GoogleGenerativeAIProvider,
@@ -1,4 +1,4 @@
1
- import { LanguageModelV3FinishReason } from '@ai-sdk/provider';
1
+ import { LanguageModelV4FinishReason } from '@ai-sdk/provider';
2
2
 
3
3
  export function mapGoogleGenerativeAIFinishReason({
4
4
  finishReason,
@@ -6,7 +6,7 @@ export function mapGoogleGenerativeAIFinishReason({
6
6
  }: {
7
7
  finishReason: string | null | undefined;
8
8
  hasToolCalls: boolean;
9
- }): LanguageModelV3FinishReason['unified'] {
9
+ }): LanguageModelV4FinishReason['unified'] {
10
10
  switch (finishReason) {
11
11
  case 'STOP':
12
12
  return hasToolCalls ? 'tool-calls' : 'stop';
package/dist/index.d.mts DELETED
@@ -1,368 +0,0 @@
1
- import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
2
- import { InferSchema, FetchFunction } from '@ai-sdk/provider-utils';
3
- import { ProviderV3, LanguageModelV3, ImageModelV3, EmbeddingModelV3, Experimental_VideoModelV3 } from '@ai-sdk/provider';
4
-
5
- declare const googleErrorDataSchema: _ai_sdk_provider_utils.LazySchema<{
6
- error: {
7
- code: number | null;
8
- message: string;
9
- status: string;
10
- };
11
- }>;
12
- type GoogleErrorData = InferSchema<typeof googleErrorDataSchema>;
13
-
14
- type GoogleGenerativeAIModelId = 'gemini-2.0-flash' | 'gemini-2.0-flash-001' | 'gemini-2.0-flash-lite' | 'gemini-2.0-flash-exp-image-generation' | 'gemini-2.0-flash-lite-001' | 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro-preview-tts' | 'gemini-2.5-flash-native-audio-latest' | 'gemini-2.5-flash-native-audio-preview-09-2025' | 'gemini-2.5-flash-native-audio-preview-12-2025' | 'gemini-2.5-computer-use-preview-10-2025' | 'gemini-3-pro-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-flash-preview' | 'gemini-3.1-pro-preview' | 'gemini-3.1-pro-preview-customtools' | 'gemini-3.1-flash-image-preview' | 'gemini-3.1-flash-lite-preview' | 'gemini-pro-latest' | 'gemini-flash-latest' | 'gemini-flash-lite-latest' | 'deep-research-pro-preview-12-2025' | 'nano-banana-pro-preview' | 'aqa' | 'gemini-robotics-er-1.5-preview' | 'gemma-3-1b-it' | 'gemma-3-4b-it' | 'gemma-3n-e4b-it' | 'gemma-3n-e2b-it' | 'gemma-3-12b-it' | 'gemma-3-27b-it' | (string & {});
15
- declare const googleLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
16
- responseModalities?: ("TEXT" | "IMAGE")[] | undefined;
17
- thinkingConfig?: {
18
- thinkingBudget?: number | undefined;
19
- includeThoughts?: boolean | undefined;
20
- thinkingLevel?: "minimal" | "low" | "medium" | "high" | undefined;
21
- } | undefined;
22
- cachedContent?: string | undefined;
23
- structuredOutputs?: boolean | undefined;
24
- safetySettings?: {
25
- category: "HARM_CATEGORY_UNSPECIFIED" | "HARM_CATEGORY_HATE_SPEECH" | "HARM_CATEGORY_DANGEROUS_CONTENT" | "HARM_CATEGORY_HARASSMENT" | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | "HARM_CATEGORY_CIVIC_INTEGRITY";
26
- threshold: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF";
27
- }[] | undefined;
28
- threshold?: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF" | undefined;
29
- audioTimestamp?: boolean | undefined;
30
- labels?: Record<string, string> | undefined;
31
- mediaResolution?: "MEDIA_RESOLUTION_UNSPECIFIED" | "MEDIA_RESOLUTION_LOW" | "MEDIA_RESOLUTION_MEDIUM" | "MEDIA_RESOLUTION_HIGH" | undefined;
32
- imageConfig?: {
33
- aspectRatio?: "1:1" | "2:3" | "3:2" | "3:4" | "4:3" | "4:5" | "5:4" | "9:16" | "16:9" | "21:9" | "1:8" | "8:1" | "1:4" | "4:1" | undefined;
34
- imageSize?: "1K" | "2K" | "4K" | "512" | undefined;
35
- } | undefined;
36
- retrievalConfig?: {
37
- latLng?: {
38
- latitude: number;
39
- longitude: number;
40
- } | undefined;
41
- } | undefined;
42
- }>;
43
- type GoogleLanguageModelOptions = InferSchema<typeof googleLanguageModelOptions>;
44
-
45
- declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
46
- candidates: {
47
- content?: Record<string, never> | {
48
- parts?: ({
49
- functionCall: {
50
- name: string;
51
- args: unknown;
52
- };
53
- thoughtSignature?: string | null | undefined;
54
- } | {
55
- inlineData: {
56
- mimeType: string;
57
- data: string;
58
- };
59
- thought?: boolean | null | undefined;
60
- thoughtSignature?: string | null | undefined;
61
- } | {
62
- executableCode?: {
63
- language: string;
64
- code: string;
65
- } | null | undefined;
66
- codeExecutionResult?: {
67
- outcome: string;
68
- output?: string | null | undefined;
69
- } | null | undefined;
70
- text?: string | null | undefined;
71
- thought?: boolean | null | undefined;
72
- thoughtSignature?: string | null | undefined;
73
- })[] | null | undefined;
74
- } | null | undefined;
75
- finishReason?: string | null | undefined;
76
- safetyRatings?: {
77
- category?: string | null | undefined;
78
- probability?: string | null | undefined;
79
- probabilityScore?: number | null | undefined;
80
- severity?: string | null | undefined;
81
- severityScore?: number | null | undefined;
82
- blocked?: boolean | null | undefined;
83
- }[] | null | undefined;
84
- groundingMetadata?: {
85
- webSearchQueries?: string[] | null | undefined;
86
- imageSearchQueries?: string[] | null | undefined;
87
- retrievalQueries?: string[] | null | undefined;
88
- searchEntryPoint?: {
89
- renderedContent: string;
90
- } | null | undefined;
91
- groundingChunks?: {
92
- web?: {
93
- uri: string;
94
- title?: string | null | undefined;
95
- } | null | undefined;
96
- image?: {
97
- sourceUri: string;
98
- imageUri: string;
99
- title?: string | null | undefined;
100
- domain?: string | null | undefined;
101
- } | null | undefined;
102
- retrievedContext?: {
103
- uri?: string | null | undefined;
104
- title?: string | null | undefined;
105
- text?: string | null | undefined;
106
- fileSearchStore?: string | null | undefined;
107
- } | null | undefined;
108
- maps?: {
109
- uri?: string | null | undefined;
110
- title?: string | null | undefined;
111
- text?: string | null | undefined;
112
- placeId?: string | null | undefined;
113
- } | null | undefined;
114
- }[] | null | undefined;
115
- groundingSupports?: {
116
- segment?: {
117
- startIndex?: number | null | undefined;
118
- endIndex?: number | null | undefined;
119
- text?: string | null | undefined;
120
- } | null | undefined;
121
- segment_text?: string | null | undefined;
122
- groundingChunkIndices?: number[] | null | undefined;
123
- supportChunkIndices?: number[] | null | undefined;
124
- confidenceScores?: number[] | null | undefined;
125
- confidenceScore?: number[] | null | undefined;
126
- }[] | null | undefined;
127
- retrievalMetadata?: Record<string, never> | {
128
- webDynamicRetrievalScore: number;
129
- } | null | undefined;
130
- } | null | undefined;
131
- urlContextMetadata?: {
132
- urlMetadata?: {
133
- retrievedUrl: string;
134
- urlRetrievalStatus: string;
135
- }[] | null | undefined;
136
- } | null | undefined;
137
- }[];
138
- usageMetadata?: {
139
- cachedContentTokenCount?: number | null | undefined;
140
- thoughtsTokenCount?: number | null | undefined;
141
- promptTokenCount?: number | null | undefined;
142
- candidatesTokenCount?: number | null | undefined;
143
- totalTokenCount?: number | null | undefined;
144
- trafficType?: string | null | undefined;
145
- } | null | undefined;
146
- promptFeedback?: {
147
- blockReason?: string | null | undefined;
148
- safetyRatings?: {
149
- category?: string | null | undefined;
150
- probability?: string | null | undefined;
151
- probabilityScore?: number | null | undefined;
152
- severity?: string | null | undefined;
153
- severityScore?: number | null | undefined;
154
- blocked?: boolean | null | undefined;
155
- }[] | null | undefined;
156
- } | null | undefined;
157
- }>;
158
- type GroundingMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['candidates'][number]['groundingMetadata']>;
159
- type UrlContextMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['candidates'][number]['urlContextMetadata']>;
160
- type SafetyRatingSchema = NonNullable<InferSchema<typeof responseSchema>['candidates'][number]['safetyRatings']>[number];
161
-
162
- type GoogleGenerativeAIGroundingMetadata = GroundingMetadataSchema;
163
- type GoogleGenerativeAIUrlContextMetadata = UrlContextMetadataSchema;
164
- type GoogleGenerativeAISafetyRating = SafetyRatingSchema;
165
- interface GoogleGenerativeAIProviderMetadata {
166
- groundingMetadata: GoogleGenerativeAIGroundingMetadata | null;
167
- urlContextMetadata: GoogleGenerativeAIUrlContextMetadata | null;
168
- safetyRatings: GoogleGenerativeAISafetyRating[] | null;
169
- }
170
-
171
- type GoogleGenerativeAIImageModelId = 'imagen-4.0-generate-001' | 'imagen-4.0-ultra-generate-001' | 'imagen-4.0-fast-generate-001' | 'gemini-2.5-flash-image' | 'gemini-3-pro-image-preview' | 'gemini-3.1-flash-image-preview' | (string & {});
172
- interface GoogleGenerativeAIImageSettings {
173
- /**
174
- * Override the maximum number of images per call (default 4)
175
- */
176
- maxImagesPerCall?: number;
177
- }
178
-
179
- declare const googleImageModelOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
180
- personGeneration?: "dont_allow" | "allow_adult" | "allow_all" | null | undefined;
181
- aspectRatio?: "1:1" | "3:4" | "4:3" | "9:16" | "16:9" | null | undefined;
182
- }>;
183
- type GoogleImageModelOptions = InferSchema<typeof googleImageModelOptionsSchema>;
184
-
185
- type GoogleGenerativeAIEmbeddingModelId = 'gemini-embedding-001' | (string & {});
186
- declare const googleEmbeddingModelOptions: _ai_sdk_provider_utils.LazySchema<{
187
- outputDimensionality?: number | undefined;
188
- taskType?: "SEMANTIC_SIMILARITY" | "CLASSIFICATION" | "CLUSTERING" | "RETRIEVAL_DOCUMENT" | "RETRIEVAL_QUERY" | "QUESTION_ANSWERING" | "FACT_VERIFICATION" | "CODE_RETRIEVAL_QUERY" | undefined;
189
- }>;
190
- type GoogleEmbeddingModelOptions = InferSchema<typeof googleEmbeddingModelOptions>;
191
-
192
- type GoogleGenerativeAIVideoModelId = 'veo-3.1-fast-generate-preview' | 'veo-3.1-generate-preview' | 'veo-3.1-generate' | 'veo-3.0-generate-001' | 'veo-3.0-fast-generate-001' | 'veo-2.0-generate-001' | (string & {});
193
-
194
- type GoogleVideoModelOptions = {
195
- pollIntervalMs?: number | null;
196
- pollTimeoutMs?: number | null;
197
- personGeneration?: 'dont_allow' | 'allow_adult' | 'allow_all' | null;
198
- negativePrompt?: string | null;
199
- referenceImages?: Array<{
200
- bytesBase64Encoded?: string;
201
- gcsUri?: string;
202
- }> | null;
203
- [key: string]: unknown;
204
- };
205
-
206
- declare const googleTools: {
207
- /**
208
- * Creates a Google search tool that gives Google direct access to real-time web content.
209
- * Must have name "google_search".
210
- */
211
- googleSearch: _ai_sdk_provider_utils.ProviderToolFactory<{}, {
212
- [x: string]: unknown;
213
- searchTypes?: {
214
- webSearch?: Record<string, never> | undefined;
215
- imageSearch?: Record<string, never> | undefined;
216
- } | undefined;
217
- timeRangeFilter?: {
218
- startTime: string;
219
- endTime: string;
220
- } | undefined;
221
- }>;
222
- /**
223
- * Creates an Enterprise Web Search tool for grounding responses using a compliance-focused web index.
224
- * Designed for highly-regulated industries (finance, healthcare, public sector).
225
- * Does not log customer data and supports VPC service controls.
226
- * Must have name "enterprise_web_search".
227
- *
228
- * @note Only available on Vertex AI. Requires Gemini 2.0 or newer.
229
- *
230
- * @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/web-grounding-enterprise
231
- */
232
- enterpriseWebSearch: _ai_sdk_provider_utils.ProviderToolFactory<{}, {}>;
233
- /**
234
- * Creates a Google Maps grounding tool that gives the model access to Google Maps data.
235
- * Must have name "google_maps".
236
- *
237
- * @see https://ai.google.dev/gemini-api/docs/maps-grounding
238
- * @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/grounding-with-google-maps
239
- */
240
- googleMaps: _ai_sdk_provider_utils.ProviderToolFactory<{}, {}>;
241
- /**
242
- * Creates a URL context tool that gives Google direct access to real-time web content.
243
- * Must have name "url_context".
244
- */
245
- urlContext: _ai_sdk_provider_utils.ProviderToolFactory<{}, {}>;
246
- /**
247
- * Enables Retrieval Augmented Generation (RAG) via the Gemini File Search tool.
248
- * Must have name "file_search".
249
- *
250
- * @param fileSearchStoreNames - Fully-qualified File Search store resource names.
251
- * @param metadataFilter - Optional filter expression to restrict the files that can be retrieved.
252
- * @param topK - Optional result limit for the number of chunks returned from File Search.
253
- *
254
- * @see https://ai.google.dev/gemini-api/docs/file-search
255
- */
256
- fileSearch: _ai_sdk_provider_utils.ProviderToolFactory<{}, {
257
- [x: string]: unknown;
258
- fileSearchStoreNames: string[];
259
- topK?: number | undefined;
260
- metadataFilter?: string | undefined;
261
- }>;
262
- /**
263
- * A tool that enables the model to generate and run Python code.
264
- * Must have name "code_execution".
265
- *
266
- * @note Ensure the selected model supports Code Execution.
267
- * Multi-tool usage with the code execution tool is typically compatible with Gemini >=2 models.
268
- *
269
- * @see https://ai.google.dev/gemini-api/docs/code-execution (Google AI)
270
- * @see https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/code-execution-api (Vertex AI)
271
- */
272
- codeExecution: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
273
- language: string;
274
- code: string;
275
- }, {
276
- outcome: string;
277
- output: string;
278
- }, {}>;
279
- /**
280
- * Creates a Vertex RAG Store tool that enables the model to perform RAG searches against a Vertex RAG Store.
281
- * Must have name "vertex_rag_store".
282
- */
283
- vertexRagStore: _ai_sdk_provider_utils.ProviderToolFactory<{}, {
284
- ragCorpus: string;
285
- topK?: number;
286
- }>;
287
- };
288
-
289
- interface GoogleGenerativeAIProvider extends ProviderV3 {
290
- (modelId: GoogleGenerativeAIModelId): LanguageModelV3;
291
- languageModel(modelId: GoogleGenerativeAIModelId): LanguageModelV3;
292
- chat(modelId: GoogleGenerativeAIModelId): LanguageModelV3;
293
- /**
294
- * Creates a model for image generation.
295
- */
296
- image(modelId: GoogleGenerativeAIImageModelId, settings?: GoogleGenerativeAIImageSettings): ImageModelV3;
297
- /**
298
- * @deprecated Use `chat()` instead.
299
- */
300
- generativeAI(modelId: GoogleGenerativeAIModelId): LanguageModelV3;
301
- /**
302
- * Creates a model for text embeddings.
303
- */
304
- embedding(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV3;
305
- /**
306
- * Creates a model for text embeddings.
307
- */
308
- embeddingModel(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV3;
309
- /**
310
- * @deprecated Use `embedding` instead.
311
- */
312
- textEmbedding(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV3;
313
- /**
314
- * @deprecated Use `embeddingModel` instead.
315
- */
316
- textEmbeddingModel(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV3;
317
- /**
318
- * Creates a model for video generation.
319
- */
320
- video(modelId: GoogleGenerativeAIVideoModelId): Experimental_VideoModelV3;
321
- /**
322
- * Creates a model for video generation.
323
- */
324
- videoModel(modelId: GoogleGenerativeAIVideoModelId): Experimental_VideoModelV3;
325
- tools: typeof googleTools;
326
- }
327
- interface GoogleGenerativeAIProviderSettings {
328
- /**
329
- * Use a different URL prefix for API calls, e.g. to use proxy servers.
330
- * The default prefix is `https://generativelanguage.googleapis.com/v1beta`.
331
- */
332
- baseURL?: string;
333
- /**
334
- * API key that is being send using the `x-goog-api-key` header.
335
- * It defaults to the `GOOGLE_GENERATIVE_AI_API_KEY` environment variable.
336
- */
337
- apiKey?: string;
338
- /**
339
- * Custom headers to include in the requests.
340
- */
341
- headers?: Record<string, string | undefined>;
342
- /**
343
- * Custom fetch implementation. You can use it as a middleware to intercept requests,
344
- * or to provide a custom fetch implementation for e.g. testing.
345
- */
346
- fetch?: FetchFunction;
347
- /**
348
- * Optional function to generate a unique ID for each request.
349
- */
350
- generateId?: () => string;
351
- /**
352
- * Custom provider name
353
- * Defaults to 'google.generative-ai'.
354
- */
355
- name?: string;
356
- }
357
- /**
358
- * Create a Google Generative AI provider instance.
359
- */
360
- declare function createGoogleGenerativeAI(options?: GoogleGenerativeAIProviderSettings): GoogleGenerativeAIProvider;
361
- /**
362
- * Default Google Generative AI provider instance.
363
- */
364
- declare const google: GoogleGenerativeAIProvider;
365
-
366
- declare const VERSION: string;
367
-
368
- export { type GoogleEmbeddingModelOptions, type GoogleErrorData, type GoogleEmbeddingModelOptions as GoogleGenerativeAIEmbeddingProviderOptions, type GoogleImageModelOptions as GoogleGenerativeAIImageProviderOptions, type GoogleGenerativeAIProvider, type GoogleGenerativeAIProviderMetadata, type GoogleLanguageModelOptions as GoogleGenerativeAIProviderOptions, type GoogleGenerativeAIProviderSettings, type GoogleGenerativeAIVideoModelId, type GoogleVideoModelOptions as GoogleGenerativeAIVideoProviderOptions, type GoogleImageModelOptions, type GoogleLanguageModelOptions, type GoogleVideoModelOptions, VERSION, createGoogleGenerativeAI, google };