@ai-sdk/google 4.0.0-beta.35 → 4.0.0-beta.37

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/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@ai-sdk/google",
3
- "version": "4.0.0-beta.35",
3
+ "version": "4.0.0-beta.37",
4
+ "type": "module",
4
5
  "license": "Apache-2.0",
5
6
  "sideEffects": false,
6
7
  "main": "./dist/index.js",
7
- "module": "./dist/index.mjs",
8
8
  "types": "./dist/index.d.ts",
9
9
  "files": [
10
10
  "dist/**/*",
@@ -25,26 +25,25 @@
25
25
  "./package.json": "./package.json",
26
26
  ".": {
27
27
  "types": "./dist/index.d.ts",
28
- "import": "./dist/index.mjs",
29
- "require": "./dist/index.js"
28
+ "import": "./dist/index.js",
29
+ "default": "./dist/index.js"
30
30
  },
31
31
  "./internal": {
32
32
  "types": "./dist/internal/index.d.ts",
33
- "import": "./dist/internal/index.mjs",
34
- "module": "./dist/internal/index.mjs",
35
- "require": "./dist/internal/index.js"
33
+ "import": "./dist/internal/index.js",
34
+ "default": "./dist/internal/index.js"
36
35
  }
37
36
  },
38
37
  "dependencies": {
39
- "@ai-sdk/provider": "4.0.0-beta.10",
40
- "@ai-sdk/provider-utils": "5.0.0-beta.18"
38
+ "@ai-sdk/provider": "4.0.0-beta.11",
39
+ "@ai-sdk/provider-utils": "5.0.0-beta.19"
41
40
  },
42
41
  "devDependencies": {
43
42
  "@types/node": "20.17.24",
44
43
  "tsup": "^8",
45
44
  "typescript": "5.8.3",
46
45
  "zod": "3.25.76",
47
- "@ai-sdk/test-server": "2.0.0-beta.0",
46
+ "@ai-sdk/test-server": "2.0.0-beta.1",
48
47
  "@vercel/ai-tsconfig": "0.0.0"
49
48
  },
50
49
  "peerDependencies": {
@@ -41,6 +41,7 @@ import { googleFailedResponseHandler } from './google-error';
41
41
  import {
42
42
  GoogleGenerativeAIModelId,
43
43
  googleLanguageModelOptions,
44
+ VertexServiceTierMap,
44
45
  } from './google-generative-ai-options';
45
46
  import { GoogleGenerativeAIProviderMetadata } from './google-generative-ai-prompt';
46
47
  import { prepareTools } from './google-prepare-tools';
@@ -152,6 +153,12 @@ export class GoogleGenerativeAILanguageModel implements LanguageModelV4 {
152
153
  });
153
154
  }
154
155
 
156
+ // Vertex API requires another service tier format.
157
+ let sanitizedServiceTier: string | undefined = googleOptions?.serviceTier;
158
+ if (googleOptions?.serviceTier && isVertexProvider) {
159
+ sanitizedServiceTier = VertexServiceTierMap[googleOptions.serviceTier];
160
+ }
161
+
155
162
  const isGemmaModel = this.modelId.toLowerCase().startsWith('gemma-');
156
163
  const supportsFunctionResponseParts = this.modelId.startsWith('gemini-3');
157
164
 
@@ -253,7 +260,7 @@ export class GoogleGenerativeAILanguageModel implements LanguageModelV4 {
253
260
  toolConfig,
254
261
  cachedContent: googleOptions?.cachedContent,
255
262
  labels: googleOptions?.labels,
256
- serviceTier: googleOptions?.serviceTier,
263
+ serviceTier: sanitizedServiceTier,
257
264
  },
258
265
  warnings: [...warnings, ...toolWarnings],
259
266
  providerOptionsName,
@@ -212,3 +212,10 @@ export const googleLanguageModelOptions = lazySchema(() =>
212
212
  export type GoogleLanguageModelOptions = InferSchema<
213
213
  typeof googleLanguageModelOptions
214
214
  >;
215
+
216
+ // Vertex API requires another service tier format.
217
+ export const VertexServiceTierMap = {
218
+ standard: 'SERVICE_TIER_STANDARD',
219
+ flex: 'SERVICE_TIER_FLEX',
220
+ priority: 'SERVICE_TIER_PRIORITY',
221
+ } as const;
package/dist/index.d.mts DELETED
@@ -1,427 +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 { ProviderV4, LanguageModelV4, ImageModelV4, EmbeddingModelV4, Experimental_VideoModelV4, FilesV4 } 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-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
- streamFunctionCallArguments?: boolean | undefined;
43
- serviceTier?: "standard" | "flex" | "priority" | undefined;
44
- }>;
45
- type GoogleLanguageModelOptions = InferSchema<typeof googleLanguageModelOptions>;
46
-
47
- declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
48
- candidates: {
49
- content?: Record<string, never> | {
50
- parts?: ({
51
- functionCall: {
52
- name?: string | null | undefined;
53
- args?: unknown;
54
- partialArgs?: {
55
- jsonPath: string;
56
- stringValue?: string | null | undefined;
57
- numberValue?: number | null | undefined;
58
- boolValue?: boolean | null | undefined;
59
- nullValue?: unknown;
60
- willContinue?: boolean | null | undefined;
61
- }[] | null | undefined;
62
- willContinue?: boolean | null | undefined;
63
- };
64
- thoughtSignature?: string | null | undefined;
65
- } | {
66
- inlineData: {
67
- mimeType: string;
68
- data: string;
69
- };
70
- thought?: boolean | null | undefined;
71
- thoughtSignature?: string | null | undefined;
72
- } | {
73
- toolCall: {
74
- toolType: string;
75
- id: string;
76
- args?: unknown;
77
- };
78
- thoughtSignature?: string | null | undefined;
79
- } | {
80
- toolResponse: {
81
- toolType: string;
82
- id: string;
83
- response?: unknown;
84
- };
85
- thoughtSignature?: string | null | undefined;
86
- } | {
87
- executableCode?: {
88
- language: string;
89
- code: string;
90
- } | null | undefined;
91
- codeExecutionResult?: {
92
- outcome: string;
93
- output?: string | null | undefined;
94
- } | null | undefined;
95
- text?: string | null | undefined;
96
- thought?: boolean | null | undefined;
97
- thoughtSignature?: string | null | undefined;
98
- })[] | null | undefined;
99
- } | null | undefined;
100
- finishReason?: string | null | undefined;
101
- finishMessage?: string | null | undefined;
102
- safetyRatings?: {
103
- category?: string | null | undefined;
104
- probability?: string | null | undefined;
105
- probabilityScore?: number | null | undefined;
106
- severity?: string | null | undefined;
107
- severityScore?: number | null | undefined;
108
- blocked?: boolean | null | undefined;
109
- }[] | null | undefined;
110
- groundingMetadata?: {
111
- webSearchQueries?: string[] | null | undefined;
112
- imageSearchQueries?: string[] | null | undefined;
113
- retrievalQueries?: string[] | null | undefined;
114
- searchEntryPoint?: {
115
- renderedContent: string;
116
- } | null | undefined;
117
- groundingChunks?: {
118
- web?: {
119
- uri: string;
120
- title?: string | null | undefined;
121
- } | null | undefined;
122
- image?: {
123
- sourceUri: string;
124
- imageUri: string;
125
- title?: string | null | undefined;
126
- domain?: string | null | undefined;
127
- } | null | undefined;
128
- retrievedContext?: {
129
- uri?: string | null | undefined;
130
- title?: string | null | undefined;
131
- text?: string | null | undefined;
132
- fileSearchStore?: string | null | undefined;
133
- } | null | undefined;
134
- maps?: {
135
- uri?: string | null | undefined;
136
- title?: string | null | undefined;
137
- text?: string | null | undefined;
138
- placeId?: string | null | undefined;
139
- } | null | undefined;
140
- }[] | null | undefined;
141
- groundingSupports?: {
142
- segment?: {
143
- startIndex?: number | null | undefined;
144
- endIndex?: number | null | undefined;
145
- text?: string | null | undefined;
146
- } | null | undefined;
147
- segment_text?: string | null | undefined;
148
- groundingChunkIndices?: number[] | null | undefined;
149
- supportChunkIndices?: number[] | null | undefined;
150
- confidenceScores?: number[] | null | undefined;
151
- confidenceScore?: number[] | null | undefined;
152
- }[] | null | undefined;
153
- retrievalMetadata?: Record<string, never> | {
154
- webDynamicRetrievalScore: number;
155
- } | null | undefined;
156
- } | null | undefined;
157
- urlContextMetadata?: {
158
- urlMetadata?: {
159
- retrievedUrl: string;
160
- urlRetrievalStatus: string;
161
- }[] | null | undefined;
162
- } | null | undefined;
163
- }[];
164
- usageMetadata?: {
165
- cachedContentTokenCount?: number | null | undefined;
166
- thoughtsTokenCount?: number | null | undefined;
167
- promptTokenCount?: number | null | undefined;
168
- candidatesTokenCount?: number | null | undefined;
169
- totalTokenCount?: number | null | undefined;
170
- trafficType?: string | null | undefined;
171
- promptTokensDetails?: {
172
- modality: string;
173
- tokenCount: number;
174
- }[] | null | undefined;
175
- candidatesTokensDetails?: {
176
- modality: string;
177
- tokenCount: number;
178
- }[] | null | undefined;
179
- } | null | undefined;
180
- promptFeedback?: {
181
- blockReason?: string | null | undefined;
182
- safetyRatings?: {
183
- category?: string | null | undefined;
184
- probability?: string | null | undefined;
185
- probabilityScore?: number | null | undefined;
186
- severity?: string | null | undefined;
187
- severityScore?: number | null | undefined;
188
- blocked?: boolean | null | undefined;
189
- }[] | null | undefined;
190
- } | null | undefined;
191
- serviceTier?: string | null | undefined;
192
- }>;
193
- type GroundingMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['candidates'][number]['groundingMetadata']>;
194
- type UrlContextMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['candidates'][number]['urlContextMetadata']>;
195
- type SafetyRatingSchema = NonNullable<InferSchema<typeof responseSchema>['candidates'][number]['safetyRatings']>[number];
196
- type PromptFeedbackSchema = NonNullable<InferSchema<typeof responseSchema>['promptFeedback']>;
197
- type UsageMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['usageMetadata']>;
198
-
199
- type GoogleGenerativeAIGroundingMetadata = GroundingMetadataSchema;
200
- type GoogleGenerativeAIUrlContextMetadata = UrlContextMetadataSchema;
201
- type GoogleGenerativeAISafetyRating = SafetyRatingSchema;
202
- type GoogleGenerativeAIPromptFeedback = PromptFeedbackSchema;
203
- type GoogleGenerativeAIUsageMetadata = UsageMetadataSchema;
204
- interface GoogleGenerativeAIProviderMetadata {
205
- promptFeedback: GoogleGenerativeAIPromptFeedback | null;
206
- groundingMetadata: GoogleGenerativeAIGroundingMetadata | null;
207
- urlContextMetadata: GoogleGenerativeAIUrlContextMetadata | null;
208
- safetyRatings: GoogleGenerativeAISafetyRating[] | null;
209
- usageMetadata: GoogleGenerativeAIUsageMetadata | null;
210
- finishMessage: string | null;
211
- serviceTier: string | null;
212
- }
213
-
214
- 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 & {});
215
- interface GoogleGenerativeAIImageSettings {
216
- /**
217
- * Override the maximum number of images per call (default 4)
218
- */
219
- maxImagesPerCall?: number;
220
- }
221
-
222
- declare const googleImageModelOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
223
- personGeneration?: "dont_allow" | "allow_adult" | "allow_all" | null | undefined;
224
- aspectRatio?: "1:1" | "3:4" | "4:3" | "9:16" | "16:9" | null | undefined;
225
- }>;
226
- type GoogleImageModelOptions = InferSchema<typeof googleImageModelOptionsSchema>;
227
-
228
- type GoogleGenerativeAIEmbeddingModelId = 'gemini-embedding-001' | 'gemini-embedding-2-preview' | (string & {});
229
- declare const googleEmbeddingModelOptions: _ai_sdk_provider_utils.LazySchema<{
230
- outputDimensionality?: number | undefined;
231
- taskType?: "SEMANTIC_SIMILARITY" | "CLASSIFICATION" | "CLUSTERING" | "RETRIEVAL_DOCUMENT" | "RETRIEVAL_QUERY" | "QUESTION_ANSWERING" | "FACT_VERIFICATION" | "CODE_RETRIEVAL_QUERY" | undefined;
232
- content?: (({
233
- text: string;
234
- } | {
235
- inlineData: {
236
- mimeType: string;
237
- data: string;
238
- };
239
- })[] | null)[] | undefined;
240
- }>;
241
- type GoogleEmbeddingModelOptions = InferSchema<typeof googleEmbeddingModelOptions>;
242
-
243
- 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 & {});
244
-
245
- type GoogleVideoModelOptions = {
246
- pollIntervalMs?: number | null;
247
- pollTimeoutMs?: number | null;
248
- personGeneration?: 'dont_allow' | 'allow_adult' | 'allow_all' | null;
249
- negativePrompt?: string | null;
250
- referenceImages?: Array<{
251
- bytesBase64Encoded?: string;
252
- gcsUri?: string;
253
- }> | null;
254
- [key: string]: unknown;
255
- };
256
-
257
- type GoogleFilesUploadOptions = {
258
- displayName?: string | null;
259
- pollIntervalMs?: number | null;
260
- pollTimeoutMs?: number | null;
261
- [key: string]: unknown;
262
- };
263
-
264
- declare const googleTools: {
265
- /**
266
- * Creates a Google search tool that gives Google direct access to real-time web content.
267
- * Must have name "google_search".
268
- */
269
- googleSearch: _ai_sdk_provider_utils.ProviderToolFactory<{}, {
270
- [x: string]: unknown;
271
- searchTypes?: {
272
- webSearch?: Record<string, never> | undefined;
273
- imageSearch?: Record<string, never> | undefined;
274
- } | undefined;
275
- timeRangeFilter?: {
276
- startTime: string;
277
- endTime: string;
278
- } | undefined;
279
- }, {}>;
280
- /**
281
- * Creates an Enterprise Web Search tool for grounding responses using a compliance-focused web index.
282
- * Designed for highly-regulated industries (finance, healthcare, public sector).
283
- * Does not log customer data and supports VPC service controls.
284
- * Must have name "enterprise_web_search".
285
- *
286
- * @note Only available on Vertex AI. Requires Gemini 2.0 or newer.
287
- *
288
- * @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/web-grounding-enterprise
289
- */
290
- enterpriseWebSearch: _ai_sdk_provider_utils.ProviderToolFactory<{}, {}, {}>;
291
- /**
292
- * Creates a Google Maps grounding tool that gives the model access to Google Maps data.
293
- * Must have name "google_maps".
294
- *
295
- * @see https://ai.google.dev/gemini-api/docs/maps-grounding
296
- * @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/grounding-with-google-maps
297
- */
298
- googleMaps: _ai_sdk_provider_utils.ProviderToolFactory<{}, {}, {}>;
299
- /**
300
- * Creates a URL context tool that gives Google direct access to real-time web content.
301
- * Must have name "url_context".
302
- */
303
- urlContext: _ai_sdk_provider_utils.ProviderToolFactory<{}, {}, {}>;
304
- /**
305
- * Enables Retrieval Augmented Generation (RAG) via the Gemini File Search tool.
306
- * Must have name "file_search".
307
- *
308
- * @param fileSearchStoreNames - Fully-qualified File Search store resource names.
309
- * @param metadataFilter - Optional filter expression to restrict the files that can be retrieved.
310
- * @param topK - Optional result limit for the number of chunks returned from File Search.
311
- *
312
- * @see https://ai.google.dev/gemini-api/docs/file-search
313
- */
314
- fileSearch: _ai_sdk_provider_utils.ProviderToolFactory<{}, {
315
- [x: string]: unknown;
316
- fileSearchStoreNames: string[];
317
- topK?: number | undefined;
318
- metadataFilter?: string | undefined;
319
- }, {}>;
320
- /**
321
- * A tool that enables the model to generate and run Python code.
322
- * Must have name "code_execution".
323
- *
324
- * @note Ensure the selected model supports Code Execution.
325
- * Multi-tool usage with the code execution tool is typically compatible with Gemini >=2 models.
326
- *
327
- * @see https://ai.google.dev/gemini-api/docs/code-execution (Google AI)
328
- * @see https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/code-execution-api (Vertex AI)
329
- */
330
- codeExecution: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
331
- language: string;
332
- code: string;
333
- }, {
334
- outcome: string;
335
- output: string;
336
- }, {}, {}>;
337
- /**
338
- * Creates a Vertex RAG Store tool that enables the model to perform RAG searches against a Vertex RAG Store.
339
- * Must have name "vertex_rag_store".
340
- */
341
- vertexRagStore: _ai_sdk_provider_utils.ProviderToolFactory<{}, {
342
- ragCorpus: string;
343
- topK?: number;
344
- }, {}>;
345
- };
346
-
347
- interface GoogleGenerativeAIProvider extends ProviderV4 {
348
- (modelId: GoogleGenerativeAIModelId): LanguageModelV4;
349
- languageModel(modelId: GoogleGenerativeAIModelId): LanguageModelV4;
350
- chat(modelId: GoogleGenerativeAIModelId): LanguageModelV4;
351
- /**
352
- * Creates a model for image generation.
353
- */
354
- image(modelId: GoogleGenerativeAIImageModelId, settings?: GoogleGenerativeAIImageSettings): ImageModelV4;
355
- /**
356
- * @deprecated Use `chat()` instead.
357
- */
358
- generativeAI(modelId: GoogleGenerativeAIModelId): LanguageModelV4;
359
- /**
360
- * Creates a model for text embeddings.
361
- */
362
- embedding(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV4;
363
- /**
364
- * Creates a model for text embeddings.
365
- */
366
- embeddingModel(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV4;
367
- /**
368
- * @deprecated Use `embedding` instead.
369
- */
370
- textEmbedding(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV4;
371
- /**
372
- * @deprecated Use `embeddingModel` instead.
373
- */
374
- textEmbeddingModel(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV4;
375
- /**
376
- * Creates a model for video generation.
377
- */
378
- video(modelId: GoogleGenerativeAIVideoModelId): Experimental_VideoModelV4;
379
- /**
380
- * Creates a model for video generation.
381
- */
382
- videoModel(modelId: GoogleGenerativeAIVideoModelId): Experimental_VideoModelV4;
383
- files(): FilesV4;
384
- tools: typeof googleTools;
385
- }
386
- interface GoogleGenerativeAIProviderSettings {
387
- /**
388
- * Use a different URL prefix for API calls, e.g. to use proxy servers.
389
- * The default prefix is `https://generativelanguage.googleapis.com/v1beta`.
390
- */
391
- baseURL?: string;
392
- /**
393
- * API key that is being send using the `x-goog-api-key` header.
394
- * It defaults to the `GOOGLE_GENERATIVE_AI_API_KEY` environment variable.
395
- */
396
- apiKey?: string;
397
- /**
398
- * Custom headers to include in the requests.
399
- */
400
- headers?: Record<string, string | undefined>;
401
- /**
402
- * Custom fetch implementation. You can use it as a middleware to intercept requests,
403
- * or to provide a custom fetch implementation for e.g. testing.
404
- */
405
- fetch?: FetchFunction;
406
- /**
407
- * Optional function to generate a unique ID for each request.
408
- */
409
- generateId?: () => string;
410
- /**
411
- * Custom provider name
412
- * Defaults to 'google.generative-ai'.
413
- */
414
- name?: string;
415
- }
416
- /**
417
- * Create a Google Generative AI provider instance.
418
- */
419
- declare function createGoogleGenerativeAI(options?: GoogleGenerativeAIProviderSettings): GoogleGenerativeAIProvider;
420
- /**
421
- * Default Google Generative AI provider instance.
422
- */
423
- declare const google: GoogleGenerativeAIProvider;
424
-
425
- declare const VERSION: string;
426
-
427
- export { type GoogleEmbeddingModelOptions, type GoogleErrorData, type GoogleFilesUploadOptions, 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 };