@ai-sdk/google 3.0.74 → 3.0.77
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/CHANGELOG.md +19 -0
- package/dist/index.d.mts +55 -12
- package/dist/index.d.ts +55 -12
- package/dist/index.js +687 -375
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +687 -375
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +1 -2
- package/dist/internal/index.d.ts +1 -2
- package/dist/internal/index.js +97 -59
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +97 -59
- package/dist/internal/index.mjs.map +1 -1
- package/docs/15-google-generative-ai.mdx +73 -16
- package/package.json +1 -1
- package/src/google-generative-ai-language-model.ts +104 -56
- package/src/google-generative-ai-options.ts +24 -8
- package/src/google-provider.ts +9 -4
- package/src/interactions/build-google-interactions-stream-transform.ts +285 -154
- package/src/interactions/convert-to-google-interactions-input.ts +57 -133
- package/src/interactions/extract-google-interactions-sources.ts +3 -3
- package/src/interactions/google-interactions-agent.ts +6 -7
- package/src/interactions/google-interactions-api.ts +179 -115
- package/src/interactions/google-interactions-language-model-options.ts +126 -0
- package/src/interactions/google-interactions-language-model.ts +173 -60
- package/src/interactions/google-interactions-prompt.ts +239 -114
- package/src/interactions/map-google-interactions-finish-reason.ts +3 -5
- package/src/interactions/parse-google-interactions-outputs.ts +80 -74
- package/src/interactions/prepare-google-interactions-tools.ts +1 -1
- package/src/interactions/stream-google-interactions.ts +2 -2
- package/src/interactions/synthesize-google-interactions-agent-stream.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @ai-sdk/google
|
|
2
2
|
|
|
3
|
+
## 3.0.77
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0f9f9bf: feat(google): read `serviceTier` from `x-gemini-service-tier` response header in Gemini API and use PayGo for Vertex
|
|
8
|
+
|
|
9
|
+
## 3.0.76
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- f259bd1: fix(google): fix streaming tool call args
|
|
14
|
+
- 756fec1: feat(provider/google): add `gemini-3.5-flash`
|
|
15
|
+
|
|
16
|
+
## 3.0.75
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- ab15576: feat(google): update Interactions API implementation to cater for upstream breaking changes coming May 26
|
|
21
|
+
|
|
3
22
|
## 3.0.74
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -11,7 +11,7 @@ declare const googleErrorDataSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
11
11
|
}>;
|
|
12
12
|
type GoogleErrorData = InferSchema<typeof googleErrorDataSchema>;
|
|
13
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-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-3.1-flash-tts-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 & {});
|
|
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-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-3.1-flash-tts-preview' | 'gemini-3.5-flash' | '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
15
|
declare const googleLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
16
16
|
responseModalities?: ("TEXT" | "IMAGE")[] | undefined;
|
|
17
17
|
thinkingConfig?: {
|
|
@@ -41,6 +41,8 @@ declare const googleLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
|
41
41
|
} | undefined;
|
|
42
42
|
streamFunctionCallArguments?: boolean | undefined;
|
|
43
43
|
serviceTier?: "standard" | "flex" | "priority" | undefined;
|
|
44
|
+
sharedRequestType?: "standard" | "flex" | "priority" | undefined;
|
|
45
|
+
requestType?: "shared" | undefined;
|
|
44
46
|
}>;
|
|
45
47
|
type GoogleLanguageModelOptions = InferSchema<typeof googleLanguageModelOptions>;
|
|
46
48
|
|
|
@@ -189,7 +191,6 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
189
191
|
blocked?: boolean | null | undefined;
|
|
190
192
|
}[] | null | undefined;
|
|
191
193
|
} | null | undefined;
|
|
192
|
-
serviceTier?: string | null | undefined;
|
|
193
194
|
}>;
|
|
194
195
|
type GroundingMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['candidates'][number]['groundingMetadata']>;
|
|
195
196
|
type UrlContextMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['candidates'][number]['urlContextMetadata']>;
|
|
@@ -269,7 +270,7 @@ type GoogleVideoModelOptions = {
|
|
|
269
270
|
* the two surfaces (`:generateContent` vs `/interactions`) are independent and
|
|
270
271
|
* may diverge over time.
|
|
271
272
|
*/
|
|
272
|
-
type GoogleInteractionsModelId = 'gemini-2.5-computer-use-preview-10-2025' | '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-native-audio-preview-12-2025' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro' | 'gemini-2.5-pro-preview-tts' | 'gemini-3-flash-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-pro-preview' | 'gemini-3.1-pro-preview' | 'gemini-3.1-flash-image-preview' | 'gemini-3.1-flash-lite-preview' | 'gemini-3.1-flash-tts-preview' | 'lyria-3-clip-preview' | 'lyria-3-pro-preview' | (string & {});
|
|
273
|
+
type GoogleInteractionsModelId = 'gemini-2.5-computer-use-preview-10-2025' | '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-native-audio-preview-12-2025' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro' | 'gemini-2.5-pro-preview-tts' | 'gemini-3-flash-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-pro-preview' | 'gemini-3.1-pro-preview' | 'gemini-3.1-flash-image-preview' | 'gemini-3.1-flash-lite-preview' | 'gemini-3.1-flash-tts-preview' | 'gemini-3.5-flash' | 'lyria-3-clip-preview' | 'lyria-3-pro-preview' | (string & {});
|
|
273
274
|
/**
|
|
274
275
|
* Provider-options schema for `google.interactions(...)` calls. Read from the
|
|
275
276
|
* shared `providerOptions.google.*` namespace (per PRD); per-call options that
|
|
@@ -292,6 +293,22 @@ declare const googleInteractionsLanguageModelOptions: _ai_sdk_provider_utils.Laz
|
|
|
292
293
|
} | null | undefined;
|
|
293
294
|
thinkingLevel?: "minimal" | "low" | "medium" | "high" | null | undefined;
|
|
294
295
|
thinkingSummaries?: "auto" | "none" | null | undefined;
|
|
296
|
+
responseFormat?: ({
|
|
297
|
+
[x: string]: unknown;
|
|
298
|
+
type: "text";
|
|
299
|
+
mimeType?: string | null | undefined;
|
|
300
|
+
schema?: unknown;
|
|
301
|
+
} | {
|
|
302
|
+
[x: string]: unknown;
|
|
303
|
+
type: "image";
|
|
304
|
+
mimeType?: string | null | undefined;
|
|
305
|
+
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" | null | undefined;
|
|
306
|
+
imageSize?: "1K" | "2K" | "4K" | "512" | null | undefined;
|
|
307
|
+
} | {
|
|
308
|
+
[x: string]: unknown;
|
|
309
|
+
type: "audio";
|
|
310
|
+
mimeType?: string | null | undefined;
|
|
311
|
+
})[] | null | undefined;
|
|
295
312
|
imageConfig?: {
|
|
296
313
|
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" | null | undefined;
|
|
297
314
|
imageSize?: "1K" | "2K" | "4K" | "512" | null | undefined;
|
|
@@ -303,6 +320,29 @@ declare const googleInteractionsLanguageModelOptions: _ai_sdk_provider_utils.Laz
|
|
|
303
320
|
signature?: string | null | undefined;
|
|
304
321
|
interactionId?: string | null | undefined;
|
|
305
322
|
pollingTimeoutMs?: number | null | undefined;
|
|
323
|
+
background?: boolean | null | undefined;
|
|
324
|
+
environment?: string | {
|
|
325
|
+
type: "remote";
|
|
326
|
+
sources?: ({
|
|
327
|
+
type: "gcs";
|
|
328
|
+
source: string;
|
|
329
|
+
target?: string | null | undefined;
|
|
330
|
+
} | {
|
|
331
|
+
type: "repository";
|
|
332
|
+
source: string;
|
|
333
|
+
target?: string | null | undefined;
|
|
334
|
+
} | {
|
|
335
|
+
type: "inline";
|
|
336
|
+
content: string;
|
|
337
|
+
target: string;
|
|
338
|
+
})[] | null | undefined;
|
|
339
|
+
network?: "disabled" | {
|
|
340
|
+
allowlist: {
|
|
341
|
+
domain: string;
|
|
342
|
+
transform?: Record<string, string>[] | null | undefined;
|
|
343
|
+
}[];
|
|
344
|
+
} | null | undefined;
|
|
345
|
+
} | null | undefined;
|
|
306
346
|
}>;
|
|
307
347
|
type GoogleLanguageModelInteractionsOptions = InferSchema<typeof googleInteractionsLanguageModelOptions>;
|
|
308
348
|
|
|
@@ -332,14 +372,12 @@ type GoogleInteractionsProviderMetadata = {
|
|
|
332
372
|
* Type-only module: declares the union of supported Gemini Interactions agent
|
|
333
373
|
* names. Used by the `google.interactions({ agent })` factory branch.
|
|
334
374
|
*
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
* passing an unknown agent name is a compile-time error. Add new agents here
|
|
340
|
-
* as Google publishes them.
|
|
375
|
+
* Strict string-literal union: unknown agent names are a compile-time error.
|
|
376
|
+
* User-defined agents (created via the `/agents` endpoint) are addressed by
|
|
377
|
+
* a separate `{ managedAgent: string }` factory shape — see
|
|
378
|
+
* `GoogleInteractionsModelInput`.
|
|
341
379
|
*/
|
|
342
|
-
type GoogleInteractionsAgentName = 'deep-research-pro-preview-12-2025' | 'deep-research-preview-04-2026' | 'deep-research-max-preview-04-2026';
|
|
380
|
+
type GoogleInteractionsAgentName = 'deep-research-pro-preview-12-2025' | 'deep-research-preview-04-2026' | 'deep-research-max-preview-04-2026' | 'antigravity-preview-05-2026';
|
|
343
381
|
|
|
344
382
|
declare const googleTools: {
|
|
345
383
|
/**
|
|
@@ -462,11 +500,16 @@ interface GoogleGenerativeAIProvider extends ProviderV3 {
|
|
|
462
500
|
videoModel(modelId: GoogleGenerativeAIVideoModelId): Experimental_VideoModelV3;
|
|
463
501
|
/**
|
|
464
502
|
* Creates a language model targeting the Gemini Interactions API
|
|
465
|
-
* (`POST /v1beta/interactions`). Pass
|
|
466
|
-
*
|
|
503
|
+
* (`POST /v1beta/interactions`). Pass:
|
|
504
|
+
* - a model ID (string),
|
|
505
|
+
* - `{ agent: <name> }` to use a known Gemini agent preset, or
|
|
506
|
+
* - `{ managedAgent: <name> }` to use a user-defined agent created via
|
|
507
|
+
* the `/v1beta/agents` endpoint.
|
|
467
508
|
*/
|
|
468
509
|
interactions(modelIdOrAgent: GoogleInteractionsModelId | {
|
|
469
510
|
agent: GoogleInteractionsAgentName;
|
|
511
|
+
} | {
|
|
512
|
+
managedAgent: string;
|
|
470
513
|
}): LanguageModelV3;
|
|
471
514
|
tools: typeof googleTools;
|
|
472
515
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ declare const googleErrorDataSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
11
11
|
}>;
|
|
12
12
|
type GoogleErrorData = InferSchema<typeof googleErrorDataSchema>;
|
|
13
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-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-3.1-flash-tts-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 & {});
|
|
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-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-3.1-flash-tts-preview' | 'gemini-3.5-flash' | '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
15
|
declare const googleLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
16
16
|
responseModalities?: ("TEXT" | "IMAGE")[] | undefined;
|
|
17
17
|
thinkingConfig?: {
|
|
@@ -41,6 +41,8 @@ declare const googleLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
|
41
41
|
} | undefined;
|
|
42
42
|
streamFunctionCallArguments?: boolean | undefined;
|
|
43
43
|
serviceTier?: "standard" | "flex" | "priority" | undefined;
|
|
44
|
+
sharedRequestType?: "standard" | "flex" | "priority" | undefined;
|
|
45
|
+
requestType?: "shared" | undefined;
|
|
44
46
|
}>;
|
|
45
47
|
type GoogleLanguageModelOptions = InferSchema<typeof googleLanguageModelOptions>;
|
|
46
48
|
|
|
@@ -189,7 +191,6 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
|
189
191
|
blocked?: boolean | null | undefined;
|
|
190
192
|
}[] | null | undefined;
|
|
191
193
|
} | null | undefined;
|
|
192
|
-
serviceTier?: string | null | undefined;
|
|
193
194
|
}>;
|
|
194
195
|
type GroundingMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['candidates'][number]['groundingMetadata']>;
|
|
195
196
|
type UrlContextMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['candidates'][number]['urlContextMetadata']>;
|
|
@@ -269,7 +270,7 @@ type GoogleVideoModelOptions = {
|
|
|
269
270
|
* the two surfaces (`:generateContent` vs `/interactions`) are independent and
|
|
270
271
|
* may diverge over time.
|
|
271
272
|
*/
|
|
272
|
-
type GoogleInteractionsModelId = 'gemini-2.5-computer-use-preview-10-2025' | '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-native-audio-preview-12-2025' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro' | 'gemini-2.5-pro-preview-tts' | 'gemini-3-flash-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-pro-preview' | 'gemini-3.1-pro-preview' | 'gemini-3.1-flash-image-preview' | 'gemini-3.1-flash-lite-preview' | 'gemini-3.1-flash-tts-preview' | 'lyria-3-clip-preview' | 'lyria-3-pro-preview' | (string & {});
|
|
273
|
+
type GoogleInteractionsModelId = 'gemini-2.5-computer-use-preview-10-2025' | '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-native-audio-preview-12-2025' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro' | 'gemini-2.5-pro-preview-tts' | 'gemini-3-flash-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-pro-preview' | 'gemini-3.1-pro-preview' | 'gemini-3.1-flash-image-preview' | 'gemini-3.1-flash-lite-preview' | 'gemini-3.1-flash-tts-preview' | 'gemini-3.5-flash' | 'lyria-3-clip-preview' | 'lyria-3-pro-preview' | (string & {});
|
|
273
274
|
/**
|
|
274
275
|
* Provider-options schema for `google.interactions(...)` calls. Read from the
|
|
275
276
|
* shared `providerOptions.google.*` namespace (per PRD); per-call options that
|
|
@@ -292,6 +293,22 @@ declare const googleInteractionsLanguageModelOptions: _ai_sdk_provider_utils.Laz
|
|
|
292
293
|
} | null | undefined;
|
|
293
294
|
thinkingLevel?: "minimal" | "low" | "medium" | "high" | null | undefined;
|
|
294
295
|
thinkingSummaries?: "auto" | "none" | null | undefined;
|
|
296
|
+
responseFormat?: ({
|
|
297
|
+
[x: string]: unknown;
|
|
298
|
+
type: "text";
|
|
299
|
+
mimeType?: string | null | undefined;
|
|
300
|
+
schema?: unknown;
|
|
301
|
+
} | {
|
|
302
|
+
[x: string]: unknown;
|
|
303
|
+
type: "image";
|
|
304
|
+
mimeType?: string | null | undefined;
|
|
305
|
+
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" | null | undefined;
|
|
306
|
+
imageSize?: "1K" | "2K" | "4K" | "512" | null | undefined;
|
|
307
|
+
} | {
|
|
308
|
+
[x: string]: unknown;
|
|
309
|
+
type: "audio";
|
|
310
|
+
mimeType?: string | null | undefined;
|
|
311
|
+
})[] | null | undefined;
|
|
295
312
|
imageConfig?: {
|
|
296
313
|
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" | null | undefined;
|
|
297
314
|
imageSize?: "1K" | "2K" | "4K" | "512" | null | undefined;
|
|
@@ -303,6 +320,29 @@ declare const googleInteractionsLanguageModelOptions: _ai_sdk_provider_utils.Laz
|
|
|
303
320
|
signature?: string | null | undefined;
|
|
304
321
|
interactionId?: string | null | undefined;
|
|
305
322
|
pollingTimeoutMs?: number | null | undefined;
|
|
323
|
+
background?: boolean | null | undefined;
|
|
324
|
+
environment?: string | {
|
|
325
|
+
type: "remote";
|
|
326
|
+
sources?: ({
|
|
327
|
+
type: "gcs";
|
|
328
|
+
source: string;
|
|
329
|
+
target?: string | null | undefined;
|
|
330
|
+
} | {
|
|
331
|
+
type: "repository";
|
|
332
|
+
source: string;
|
|
333
|
+
target?: string | null | undefined;
|
|
334
|
+
} | {
|
|
335
|
+
type: "inline";
|
|
336
|
+
content: string;
|
|
337
|
+
target: string;
|
|
338
|
+
})[] | null | undefined;
|
|
339
|
+
network?: "disabled" | {
|
|
340
|
+
allowlist: {
|
|
341
|
+
domain: string;
|
|
342
|
+
transform?: Record<string, string>[] | null | undefined;
|
|
343
|
+
}[];
|
|
344
|
+
} | null | undefined;
|
|
345
|
+
} | null | undefined;
|
|
306
346
|
}>;
|
|
307
347
|
type GoogleLanguageModelInteractionsOptions = InferSchema<typeof googleInteractionsLanguageModelOptions>;
|
|
308
348
|
|
|
@@ -332,14 +372,12 @@ type GoogleInteractionsProviderMetadata = {
|
|
|
332
372
|
* Type-only module: declares the union of supported Gemini Interactions agent
|
|
333
373
|
* names. Used by the `google.interactions({ agent })` factory branch.
|
|
334
374
|
*
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
339
|
-
* passing an unknown agent name is a compile-time error. Add new agents here
|
|
340
|
-
* as Google publishes them.
|
|
375
|
+
* Strict string-literal union: unknown agent names are a compile-time error.
|
|
376
|
+
* User-defined agents (created via the `/agents` endpoint) are addressed by
|
|
377
|
+
* a separate `{ managedAgent: string }` factory shape — see
|
|
378
|
+
* `GoogleInteractionsModelInput`.
|
|
341
379
|
*/
|
|
342
|
-
type GoogleInteractionsAgentName = 'deep-research-pro-preview-12-2025' | 'deep-research-preview-04-2026' | 'deep-research-max-preview-04-2026';
|
|
380
|
+
type GoogleInteractionsAgentName = 'deep-research-pro-preview-12-2025' | 'deep-research-preview-04-2026' | 'deep-research-max-preview-04-2026' | 'antigravity-preview-05-2026';
|
|
343
381
|
|
|
344
382
|
declare const googleTools: {
|
|
345
383
|
/**
|
|
@@ -462,11 +500,16 @@ interface GoogleGenerativeAIProvider extends ProviderV3 {
|
|
|
462
500
|
videoModel(modelId: GoogleGenerativeAIVideoModelId): Experimental_VideoModelV3;
|
|
463
501
|
/**
|
|
464
502
|
* Creates a language model targeting the Gemini Interactions API
|
|
465
|
-
* (`POST /v1beta/interactions`). Pass
|
|
466
|
-
*
|
|
503
|
+
* (`POST /v1beta/interactions`). Pass:
|
|
504
|
+
* - a model ID (string),
|
|
505
|
+
* - `{ agent: <name> }` to use a known Gemini agent preset, or
|
|
506
|
+
* - `{ managedAgent: <name> }` to use a user-defined agent created via
|
|
507
|
+
* the `/v1beta/agents` endpoint.
|
|
467
508
|
*/
|
|
468
509
|
interactions(modelIdOrAgent: GoogleInteractionsModelId | {
|
|
469
510
|
agent: GoogleInteractionsAgentName;
|
|
511
|
+
} | {
|
|
512
|
+
managedAgent: string;
|
|
470
513
|
}): LanguageModelV3;
|
|
471
514
|
tools: typeof googleTools;
|
|
472
515
|
}
|