@ai-sdk/google 4.0.85 → 4.0.86

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,559 +1,564 @@
1
- import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
2
- import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE, Resolvable, FetchFunction, InferSchema, createToolNameMapping } from '@ai-sdk/provider-utils';
3
- import * as _ai_sdk_provider from '@ai-sdk/provider';
4
- import { LanguageModelV4, JSONObject, LanguageModelV4CallOptions, SharedV4Warning, LanguageModelV4GenerateResult, LanguageModelV4StreamResult, SpeechModelV4 } from '@ai-sdk/provider';
5
- import { z } from 'zod/v4';
6
-
1
+ import { FetchFunction, InferSchema, Resolvable, WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE, createToolNameMapping } from "@ai-sdk/provider-utils";
2
+ import { z } from "zod/v4";
3
+ import { JSONObject, LanguageModelV4, LanguageModelV4CallOptions, LanguageModelV4GenerateResult, LanguageModelV4StreamResult, SharedV4Warning, SpeechModelV4 } from "@ai-sdk/provider";
4
+ //#region src/google-prompt.d.ts
7
5
  type GoogleSystemInstruction = {
8
- parts: Array<{
9
- text: string;
10
- }>;
6
+ parts: Array<{
7
+ text: string;
8
+ }>;
11
9
  };
12
10
  type GoogleContent = {
13
- role: 'user' | 'model';
14
- parts: Array<GoogleContentPart>;
11
+ role: 'user' | 'model';
12
+ parts: Array<GoogleContentPart>;
15
13
  };
16
14
  type GoogleContentPart = {
17
- text: string;
18
- thought?: boolean;
19
- thoughtSignature?: string;
15
+ text: string;
16
+ thought?: boolean;
17
+ thoughtSignature?: string;
20
18
  } | {
21
- inlineData: {
22
- mimeType: string;
23
- data: string;
24
- };
25
- thought?: boolean;
26
- thoughtSignature?: string;
19
+ inlineData: {
20
+ mimeType: string;
21
+ data: string;
22
+ };
23
+ thought?: boolean;
24
+ thoughtSignature?: string;
27
25
  } | {
28
- functionCall: {
29
- id?: string;
30
- name: string;
31
- args: unknown;
32
- };
33
- thoughtSignature?: string;
26
+ functionCall: {
27
+ id?: string;
28
+ name: string;
29
+ args: unknown;
30
+ };
31
+ thoughtSignature?: string;
34
32
  } | {
35
- functionResponse: {
36
- id?: string;
37
- name: string;
38
- response: unknown;
39
- parts?: Array<GoogleFunctionResponsePart>;
40
- };
33
+ functionResponse: {
34
+ id?: string;
35
+ name: string;
36
+ response: unknown;
37
+ parts?: Array<GoogleFunctionResponsePart>;
38
+ };
41
39
  } | {
42
- fileData: {
43
- mimeType: string;
44
- fileUri: string;
45
- };
46
- thought?: boolean;
47
- thoughtSignature?: string;
40
+ fileData: {
41
+ mimeType: string;
42
+ fileUri: string;
43
+ };
44
+ thought?: boolean;
45
+ thoughtSignature?: string;
48
46
  } | {
49
- toolCall: {
50
- toolType: string;
51
- args?: unknown;
52
- id: string;
53
- };
54
- thoughtSignature?: string;
47
+ toolCall: {
48
+ toolType: string;
49
+ args?: unknown;
50
+ id: string;
51
+ };
52
+ thoughtSignature?: string;
55
53
  } | {
56
- toolResponse: {
57
- toolType: string;
58
- response?: unknown;
59
- id: string;
60
- };
61
- thoughtSignature?: string;
54
+ toolResponse: {
55
+ toolType: string;
56
+ response?: unknown;
57
+ id: string;
58
+ };
59
+ thoughtSignature?: string;
62
60
  } | {
63
- executableCode: {
64
- language: string;
65
- code: string;
66
- };
61
+ executableCode: {
62
+ language: string;
63
+ code: string;
64
+ };
67
65
  } | {
68
- codeExecutionResult: {
69
- outcome: string;
70
- output: string;
71
- };
66
+ codeExecutionResult: {
67
+ outcome: string;
68
+ output: string;
69
+ };
72
70
  };
73
71
  type GoogleFunctionResponsePart = {
74
- inlineData: {
75
- mimeType: string;
76
- data: string;
77
- };
72
+ inlineData: {
73
+ mimeType: string;
74
+ data: string;
75
+ };
78
76
  } | {
79
- fileData: {
80
- mimeType: string;
81
- fileUri: string;
82
- };
77
+ fileData: {
78
+ mimeType: string;
79
+ fileUri: string;
80
+ };
83
81
  };
84
-
82
+ //#endregion
83
+ //#region src/google-language-model-options.d.ts
85
84
  type GoogleModelId = '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-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-pro-latest' | 'gemini-flash-latest' | 'gemini-flash-lite-latest' | 'deep-research-pro-preview-12-2025' | 'deep-research-max-preview-04-2026' | 'deep-research-preview-04-2026' | '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 & {});
86
-
87
- type GoogleLanguageModelConfig = {
88
- provider: string;
89
- baseURL: string;
90
- headers?: Resolvable<Record<string, string | undefined>>;
91
- fetch?: FetchFunction;
92
- generateId: () => string;
93
- /**
94
- * The supported URLs for the model.
95
- */
96
- supportedUrls?: () => LanguageModelV4['supportedUrls'];
97
- /**
98
- * Settings for downloading remote files in tool results before conversion.
99
- */
100
- downloadToolResultFiles?: {
101
- maxBytes: number;
102
- supportsGoogleCloudStorageUrls?: boolean;
103
- };
85
+ //#endregion
86
+ //#region src/google-language-model.d.ts
87
+ export type GoogleLanguageModelConfig = {
88
+ provider: string;
89
+ baseURL: string;
90
+ headers?: Resolvable<Record<string, string | undefined>>;
91
+ fetch?: FetchFunction;
92
+ generateId: () => string;
93
+ /**
94
+ * The supported URLs for the model.
95
+ */
96
+ supportedUrls?: () => LanguageModelV4['supportedUrls'];
97
+ /**
98
+ * Settings for downloading remote files in tool results before conversion.
99
+ */
100
+ downloadToolResultFiles?: {
101
+ maxBytes: number;
102
+ supportsGoogleCloudStorageUrls?: boolean;
103
+ };
104
104
  };
105
- declare class GoogleLanguageModel implements LanguageModelV4 {
106
- readonly specificationVersion = "v4";
107
- readonly modelId: GoogleModelId;
108
- private readonly config;
109
- private readonly generateId;
110
- static [WORKFLOW_SERIALIZE](model: GoogleLanguageModel): {
111
- modelId: string;
112
- config: JSONObject;
105
+ export declare class GoogleLanguageModel implements LanguageModelV4 {
106
+ readonly specificationVersion = "v4";
107
+ readonly modelId: GoogleModelId;
108
+ private readonly config;
109
+ private readonly generateId;
110
+ static [WORKFLOW_SERIALIZE](model: GoogleLanguageModel): {
111
+ modelId: string;
112
+ config: JSONObject;
113
+ };
114
+ static [WORKFLOW_DESERIALIZE](options: {
115
+ modelId: string;
116
+ config: GoogleLanguageModelConfig;
117
+ }): GoogleLanguageModel;
118
+ constructor(modelId: GoogleModelId, config: GoogleLanguageModelConfig);
119
+ get provider(): string;
120
+ get supportedUrls(): Record<string, RegExp[]> | PromiseLike<Record<string, RegExp[]>>;
121
+ static prepareRequest({ modelId, config, options: { prompt, maxOutputTokens, temperature, topP, topK, frequencyPenalty, presencePenalty, stopSequences, responseFormat, seed, tools, toolChoice, reasoning, providerOptions, abortSignal }, isStreaming }: {
122
+ modelId: GoogleModelId;
123
+ config: GoogleLanguageModelConfig;
124
+ options: LanguageModelV4CallOptions;
125
+ isStreaming?: boolean;
126
+ }): Promise<{
127
+ args: {
128
+ generationConfig: {
129
+ imageConfig?: {
130
+ 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;
131
+ imageSize?: "1K" | "2K" | "4K" | "512" | undefined;
132
+ personGeneration?: "PERSON_GENERATION_UNSPECIFIED" | "ALLOW_ALL" | "ALLOW_ADULT" | "ALLOW_NONE" | undefined;
133
+ prominentPeople?: "PROMINENT_PEOPLE_UNSPECIFIED" | "ALLOW_PROMINENT_PEOPLE" | "BLOCK_PROMINENT_PEOPLE" | undefined;
134
+ imageOutputOptions?: {
135
+ mimeType?: "image/jpeg" | "image/png" | undefined;
136
+ compressionQuality?: number | undefined;
137
+ } | undefined;
138
+ } | undefined;
139
+ mediaResolution?: "MEDIA_RESOLUTION_UNSPECIFIED" | "MEDIA_RESOLUTION_LOW" | "MEDIA_RESOLUTION_MEDIUM" | "MEDIA_RESOLUTION_HIGH" | undefined;
140
+ responseModalities: ("TEXT" | "IMAGE")[] | undefined;
141
+ thinkingConfig: {
142
+ thinkingBudget?: number | undefined;
143
+ includeThoughts?: boolean | undefined;
144
+ thinkingLevel?: "minimal" | "low" | "medium" | "high" | undefined;
145
+ } | undefined;
146
+ audioTimestamp?: true | undefined;
147
+ maxOutputTokens: number | undefined;
148
+ temperature: number | undefined;
149
+ topK: number | undefined;
150
+ topP: number | undefined;
151
+ frequencyPenalty: number | undefined;
152
+ presencePenalty: number | undefined;
153
+ stopSequences: string[] | undefined;
154
+ seed: number | undefined;
155
+ responseMimeType: string | undefined;
156
+ responseJsonSchema: import("@ai-sdk/provider").JSONSchema7 | undefined;
157
+ };
158
+ contents: GoogleContent[];
159
+ systemInstruction: GoogleSystemInstruction | undefined;
160
+ safetySettings: {
161
+ category: "HARM_CATEGORY_UNSPECIFIED" | "HARM_CATEGORY_HATE_SPEECH" | "HARM_CATEGORY_DANGEROUS_CONTENT" | "HARM_CATEGORY_HARASSMENT" | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | "HARM_CATEGORY_CIVIC_INTEGRITY";
162
+ threshold: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF";
163
+ }[] | undefined;
164
+ tools: ({
165
+ functionDeclarations: {
166
+ name: string;
167
+ description: string;
168
+ parametersJsonSchema: unknown;
169
+ }[];
170
+ } | Record<string, any>)[] | undefined;
171
+ toolConfig: {
172
+ retrievalConfig?: {
173
+ latLng?: {
174
+ latitude: number;
175
+ longitude: number;
176
+ } | undefined;
177
+ } | undefined;
178
+ functionCallingConfig?: {
179
+ mode: "AUTO" | "NONE" | "ANY" | "VALIDATED";
180
+ allowedFunctionNames?: string[];
181
+ streamFunctionCallArguments?: boolean;
182
+ } | {
183
+ streamFunctionCallArguments: true;
184
+ mode?: "AUTO" | "NONE" | "ANY" | "VALIDATED" | undefined;
185
+ allowedFunctionNames?: string[];
186
+ } | undefined;
187
+ includeServerSideToolInvocations?: boolean;
188
+ } | undefined;
189
+ cachedContent: string | undefined;
190
+ labels: Record<string, string> | undefined;
191
+ serviceTier: "standard" | "flex" | "priority" | undefined;
113
192
  };
114
- static [WORKFLOW_DESERIALIZE](options: {
115
- modelId: string;
116
- config: GoogleLanguageModelConfig;
117
- }): GoogleLanguageModel;
118
- constructor(modelId: GoogleModelId, config: GoogleLanguageModelConfig);
119
- get provider(): string;
120
- get supportedUrls(): Record<string, RegExp[]> | PromiseLike<Record<string, RegExp[]>>;
121
- static prepareRequest({ modelId, config, options: { prompt, maxOutputTokens, temperature, topP, topK, frequencyPenalty, presencePenalty, stopSequences, responseFormat, seed, tools, toolChoice, reasoning, providerOptions, abortSignal, }, isStreaming, }: {
122
- modelId: GoogleModelId;
123
- config: GoogleLanguageModelConfig;
124
- options: LanguageModelV4CallOptions;
125
- isStreaming?: boolean;
126
- }): Promise<{
127
- args: {
128
- generationConfig: {
129
- imageConfig?: {
130
- 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;
131
- imageSize?: "1K" | "2K" | "4K" | "512" | undefined;
132
- personGeneration?: "PERSON_GENERATION_UNSPECIFIED" | "ALLOW_ALL" | "ALLOW_ADULT" | "ALLOW_NONE" | undefined;
133
- prominentPeople?: "PROMINENT_PEOPLE_UNSPECIFIED" | "ALLOW_PROMINENT_PEOPLE" | "BLOCK_PROMINENT_PEOPLE" | undefined;
134
- imageOutputOptions?: {
135
- mimeType?: "image/jpeg" | "image/png" | undefined;
136
- compressionQuality?: number | undefined;
137
- } | undefined;
138
- } | undefined;
139
- mediaResolution?: "MEDIA_RESOLUTION_UNSPECIFIED" | "MEDIA_RESOLUTION_LOW" | "MEDIA_RESOLUTION_MEDIUM" | "MEDIA_RESOLUTION_HIGH" | undefined;
140
- responseModalities: ("TEXT" | "IMAGE")[] | undefined;
141
- thinkingConfig: {
142
- thinkingBudget?: number | undefined;
143
- includeThoughts?: boolean | undefined;
144
- thinkingLevel?: "minimal" | "low" | "medium" | "high" | undefined;
145
- } | undefined;
146
- audioTimestamp?: true | undefined;
147
- maxOutputTokens: number | undefined;
148
- temperature: number | undefined;
149
- topK: number | undefined;
150
- topP: number | undefined;
151
- frequencyPenalty: number | undefined;
152
- presencePenalty: number | undefined;
153
- stopSequences: string[] | undefined;
154
- seed: number | undefined;
155
- responseMimeType: string | undefined;
156
- responseJsonSchema: _ai_sdk_provider.JSONSchema7 | undefined;
157
- };
158
- contents: GoogleContent[];
159
- systemInstruction: GoogleSystemInstruction | undefined;
160
- safetySettings: {
161
- category: "HARM_CATEGORY_UNSPECIFIED" | "HARM_CATEGORY_HATE_SPEECH" | "HARM_CATEGORY_DANGEROUS_CONTENT" | "HARM_CATEGORY_HARASSMENT" | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | "HARM_CATEGORY_CIVIC_INTEGRITY";
162
- threshold: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF";
163
- }[] | undefined;
164
- tools: ({
165
- functionDeclarations: {
166
- name: string;
167
- description: string;
168
- parametersJsonSchema: unknown;
169
- }[];
170
- } | Record<string, any>)[] | undefined;
171
- toolConfig: {
172
- retrievalConfig?: {
173
- latLng?: {
174
- latitude: number;
175
- longitude: number;
176
- } | undefined;
177
- } | undefined;
178
- functionCallingConfig?: {
179
- mode: "AUTO" | "NONE" | "ANY" | "VALIDATED";
180
- allowedFunctionNames?: string[];
181
- streamFunctionCallArguments?: boolean;
182
- } | {
183
- streamFunctionCallArguments: true;
184
- mode?: "AUTO" | "NONE" | "ANY" | "VALIDATED" | undefined;
185
- allowedFunctionNames?: string[];
186
- } | undefined;
187
- includeServerSideToolInvocations?: boolean;
188
- } | undefined;
189
- cachedContent: string | undefined;
190
- labels: Record<string, string> | undefined;
191
- serviceTier: "standard" | "flex" | "priority" | undefined;
192
- };
193
- warnings: SharedV4Warning[];
194
- providerOptionsNames: readonly string[];
195
- extraHeaders: Record<string, string> | undefined;
196
- toolNameMapping: _ai_sdk_provider_utils.ToolNameMapping;
197
- }>;
198
- private getArgs;
199
- static convertGenerateContentResponse({ config, response, warnings, providerOptionsNames, toolNameMapping, }: {
200
- config: GoogleLanguageModelConfig;
201
- response: InferSchema<typeof responseSchema>;
202
- warnings: SharedV4Warning[];
203
- providerOptionsNames: readonly string[];
204
- toolNameMapping?: ReturnType<typeof createToolNameMapping>;
205
- }): LanguageModelV4GenerateResult;
206
- doGenerate(options: LanguageModelV4CallOptions): Promise<LanguageModelV4GenerateResult>;
207
- doStream(options: LanguageModelV4CallOptions): Promise<LanguageModelV4StreamResult>;
193
+ warnings: SharedV4Warning[];
194
+ providerOptionsNames: readonly string[];
195
+ extraHeaders: Record<string, string> | undefined;
196
+ toolNameMapping: import("@ai-sdk/provider-utils").ToolNameMapping;
197
+ }>;
198
+ private getArgs;
199
+ static convertGenerateContentResponse({ config, response, warnings, providerOptionsNames, toolNameMapping }: {
200
+ config: GoogleLanguageModelConfig;
201
+ response: InferSchema<typeof responseSchema>;
202
+ warnings: SharedV4Warning[];
203
+ providerOptionsNames: readonly string[];
204
+ toolNameMapping?: ReturnType<typeof createToolNameMapping>;
205
+ }): LanguageModelV4GenerateResult;
206
+ doGenerate(options: LanguageModelV4CallOptions): Promise<LanguageModelV4GenerateResult>;
207
+ doStream(options: LanguageModelV4CallOptions): Promise<LanguageModelV4StreamResult>;
208
208
  }
209
- declare const getGroundingMetadataSchema: () => z.ZodObject<{
210
- webSearchQueries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
211
- imageSearchQueries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
212
- retrievalQueries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
213
- searchEntryPoint: z.ZodOptional<z.ZodNullable<z.ZodObject<{
214
- renderedContent: z.ZodString;
209
+ export declare const getGroundingMetadataSchema: () => z.ZodObject<{
210
+ webSearchQueries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
211
+ imageSearchQueries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
212
+ retrievalQueries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
213
+ searchEntryPoint: z.ZodOptional<z.ZodNullable<z.ZodObject<{
214
+ renderedContent: z.ZodString;
215
+ }, z.core.$strip>>>;
216
+ groundingChunks: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
217
+ web: z.ZodOptional<z.ZodNullable<z.ZodObject<{
218
+ uri: z.ZodString;
219
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
215
220
  }, z.core.$strip>>>;
216
- groundingChunks: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
217
- web: z.ZodOptional<z.ZodNullable<z.ZodObject<{
218
- uri: z.ZodString;
219
- title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
220
- }, z.core.$strip>>>;
221
- image: z.ZodOptional<z.ZodNullable<z.ZodObject<{
222
- sourceUri: z.ZodString;
223
- imageUri: z.ZodString;
224
- title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
225
- domain: z.ZodOptional<z.ZodNullable<z.ZodString>>;
226
- }, z.core.$strip>>>;
227
- retrievedContext: z.ZodOptional<z.ZodNullable<z.ZodObject<{
228
- uri: z.ZodOptional<z.ZodNullable<z.ZodString>>;
229
- title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
230
- text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
231
- fileSearchStore: z.ZodOptional<z.ZodNullable<z.ZodString>>;
232
- }, z.core.$strip>>>;
233
- maps: z.ZodOptional<z.ZodNullable<z.ZodObject<{
234
- uri: z.ZodOptional<z.ZodNullable<z.ZodString>>;
235
- title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
236
- text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
237
- placeId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
238
- }, z.core.$strip>>>;
239
- }, z.core.$strip>>>>;
240
- groundingSupports: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
241
- segment: z.ZodOptional<z.ZodNullable<z.ZodObject<{
242
- startIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
243
- endIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
244
- text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
245
- }, z.core.$strip>>>;
246
- segment_text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
247
- groundingChunkIndices: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
248
- supportChunkIndices: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
249
- confidenceScores: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
250
- confidenceScore: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
251
- }, z.core.$strip>>>>;
252
- retrievalMetadata: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
253
- webDynamicRetrievalScore: z.ZodNumber;
254
- }, z.core.$strip>, z.ZodObject<{}, z.core.$strip>]>>>;
221
+ image: z.ZodOptional<z.ZodNullable<z.ZodObject<{
222
+ sourceUri: z.ZodString;
223
+ imageUri: z.ZodString;
224
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
225
+ domain: z.ZodOptional<z.ZodNullable<z.ZodString>>;
226
+ }, z.core.$strip>>>;
227
+ retrievedContext: z.ZodOptional<z.ZodNullable<z.ZodObject<{
228
+ uri: z.ZodOptional<z.ZodNullable<z.ZodString>>;
229
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
230
+ text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
231
+ fileSearchStore: z.ZodOptional<z.ZodNullable<z.ZodString>>;
232
+ }, z.core.$strip>>>;
233
+ maps: z.ZodOptional<z.ZodNullable<z.ZodObject<{
234
+ uri: z.ZodOptional<z.ZodNullable<z.ZodString>>;
235
+ title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
236
+ text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
237
+ placeId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
238
+ }, z.core.$strip>>>;
239
+ }, z.core.$strip>>>>;
240
+ groundingSupports: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
241
+ segment: z.ZodOptional<z.ZodNullable<z.ZodObject<{
242
+ startIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
243
+ endIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
244
+ text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
245
+ }, z.core.$strip>>>;
246
+ segment_text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
247
+ groundingChunkIndices: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
248
+ supportChunkIndices: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
249
+ confidenceScores: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
250
+ confidenceScore: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
251
+ }, z.core.$strip>>>>;
252
+ retrievalMetadata: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
253
+ webDynamicRetrievalScore: z.ZodNumber;
254
+ }, z.core.$strip>, z.ZodObject<{}, z.core.$strip>]>>>;
255
255
  }, z.core.$strip>;
256
- declare const getUrlContextMetadataSchema: () => z.ZodObject<{
257
- urlMetadata: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
258
- retrievedUrl: z.ZodString;
259
- urlRetrievalStatus: z.ZodString;
260
- }, z.core.$strip>>>>;
256
+ export declare const getUrlContextMetadataSchema: () => z.ZodObject<{
257
+ urlMetadata: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
258
+ retrievedUrl: z.ZodString;
259
+ urlRetrievalStatus: z.ZodString;
260
+ }, z.core.$strip>>>>;
261
261
  }, z.core.$strip>;
262
- declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
263
- responseId?: string | null | undefined;
264
- candidates?: {
265
- content?: Record<string, never> | {
266
- parts?: ({
267
- functionCall: {
268
- id?: string | null | undefined;
269
- name?: string | null | undefined;
270
- args?: unknown;
271
- partialArgs?: {
272
- jsonPath: string;
273
- stringValue?: string | null | undefined;
274
- numberValue?: number | null | undefined;
275
- boolValue?: boolean | null | undefined;
276
- nullValue?: unknown;
277
- willContinue?: boolean | null | undefined;
278
- }[] | null | undefined;
279
- willContinue?: boolean | null | undefined;
280
- };
281
- thoughtSignature?: string | null | undefined;
282
- } | {
283
- inlineData: {
284
- mimeType: string;
285
- data: string;
286
- };
287
- thought?: boolean | null | undefined;
288
- thoughtSignature?: string | null | undefined;
289
- } | {
290
- toolCall: {
291
- toolType: string;
292
- id: string;
293
- args?: unknown;
294
- };
295
- thoughtSignature?: string | null | undefined;
296
- } | {
297
- toolResponse: {
298
- toolType: string;
299
- id: string;
300
- response?: unknown;
301
- };
302
- thoughtSignature?: string | null | undefined;
303
- } | {
304
- executableCode?: {
305
- language: string;
306
- code: string;
307
- } | null | undefined;
308
- codeExecutionResult?: {
309
- outcome: string;
310
- output?: string | null | undefined;
311
- } | null | undefined;
312
- text?: string | null | undefined;
313
- thought?: boolean | null | undefined;
314
- thoughtSignature?: string | null | undefined;
315
- })[] | null | undefined;
316
- } | null | undefined;
317
- finishReason?: string | null | undefined;
318
- finishMessage?: string | null | undefined;
319
- safetyRatings?: {
320
- category?: string | null | undefined;
321
- probability?: string | null | undefined;
322
- probabilityScore?: number | null | undefined;
323
- severity?: string | null | undefined;
324
- severityScore?: number | null | undefined;
325
- blocked?: boolean | null | undefined;
326
- }[] | null | undefined;
327
- groundingMetadata?: {
328
- webSearchQueries?: string[] | null | undefined;
329
- imageSearchQueries?: string[] | null | undefined;
330
- retrievalQueries?: string[] | null | undefined;
331
- searchEntryPoint?: {
332
- renderedContent: string;
333
- } | null | undefined;
334
- groundingChunks?: {
335
- web?: {
336
- uri: string;
337
- title?: string | null | undefined;
338
- } | null | undefined;
339
- image?: {
340
- sourceUri: string;
341
- imageUri: string;
342
- title?: string | null | undefined;
343
- domain?: string | null | undefined;
344
- } | null | undefined;
345
- retrievedContext?: {
346
- uri?: string | null | undefined;
347
- title?: string | null | undefined;
348
- text?: string | null | undefined;
349
- fileSearchStore?: string | null | undefined;
350
- } | null | undefined;
351
- maps?: {
352
- uri?: string | null | undefined;
353
- title?: string | null | undefined;
354
- text?: string | null | undefined;
355
- placeId?: string | null | undefined;
356
- } | null | undefined;
357
- }[] | null | undefined;
358
- groundingSupports?: {
359
- segment?: {
360
- startIndex?: number | null | undefined;
361
- endIndex?: number | null | undefined;
362
- text?: string | null | undefined;
363
- } | null | undefined;
364
- segment_text?: string | null | undefined;
365
- groundingChunkIndices?: number[] | null | undefined;
366
- supportChunkIndices?: number[] | null | undefined;
367
- confidenceScores?: number[] | null | undefined;
368
- confidenceScore?: number[] | null | undefined;
369
- }[] | null | undefined;
370
- retrievalMetadata?: Record<string, never> | {
371
- webDynamicRetrievalScore: number;
372
- } | null | undefined;
262
+ export declare const responseSchema: import("@ai-sdk/provider-utils").LazySchema<{
263
+ responseId?: string | null | undefined;
264
+ candidates?: {
265
+ content?: Record<string, never> | {
266
+ parts?: ({
267
+ functionCall: {
268
+ id?: string | null | undefined;
269
+ name?: string | null | undefined;
270
+ args?: unknown;
271
+ partialArgs?: {
272
+ jsonPath: string;
273
+ stringValue?: string | null | undefined;
274
+ numberValue?: number | null | undefined;
275
+ boolValue?: boolean | null | undefined;
276
+ nullValue?: unknown;
277
+ willContinue?: boolean | null | undefined;
278
+ }[] | null | undefined;
279
+ willContinue?: boolean | null | undefined;
280
+ };
281
+ thoughtSignature?: string | null | undefined;
282
+ } | {
283
+ inlineData: {
284
+ mimeType: string;
285
+ data: string;
286
+ };
287
+ thought?: boolean | null | undefined;
288
+ thoughtSignature?: string | null | undefined;
289
+ } | {
290
+ toolCall: {
291
+ toolType: string;
292
+ id: string;
293
+ args?: unknown;
294
+ };
295
+ thoughtSignature?: string | null | undefined;
296
+ } | {
297
+ toolResponse: {
298
+ toolType: string;
299
+ id: string;
300
+ response?: unknown;
301
+ };
302
+ thoughtSignature?: string | null | undefined;
303
+ } | {
304
+ executableCode?: {
305
+ language: string;
306
+ code: string;
373
307
  } | null | undefined;
374
- urlContextMetadata?: {
375
- urlMetadata?: {
376
- retrievedUrl: string;
377
- urlRetrievalStatus: string;
378
- }[] | null | undefined;
308
+ codeExecutionResult?: {
309
+ outcome: string;
310
+ output?: string | null | undefined;
379
311
  } | null | undefined;
312
+ text?: string | null | undefined;
313
+ thought?: boolean | null | undefined;
314
+ thoughtSignature?: string | null | undefined;
315
+ })[] | null | undefined;
316
+ } | null | undefined;
317
+ finishReason?: string | null | undefined;
318
+ finishMessage?: string | null | undefined;
319
+ safetyRatings?: {
320
+ category?: string | null | undefined;
321
+ probability?: string | null | undefined;
322
+ probabilityScore?: number | null | undefined;
323
+ severity?: string | null | undefined;
324
+ severityScore?: number | null | undefined;
325
+ blocked?: boolean | null | undefined;
380
326
  }[] | null | undefined;
381
- usageMetadata?: {
382
- [x: string]: unknown;
383
- cachedContentTokenCount?: number | null | undefined;
384
- thoughtsTokenCount?: number | null | undefined;
385
- promptTokenCount?: number | null | undefined;
386
- candidatesTokenCount?: number | null | undefined;
387
- toolUsePromptTokenCount?: number | null | undefined;
388
- totalTokenCount?: number | null | undefined;
389
- trafficType?: string | null | undefined;
390
- serviceTier?: string | null | undefined;
391
- promptTokensDetails?: {
392
- [x: string]: unknown;
393
- modality: string;
394
- tokenCount: number;
395
- }[] | null | undefined;
396
- cacheTokensDetails?: {
397
- [x: string]: unknown;
398
- modality: string;
399
- tokenCount: number;
400
- }[] | null | undefined;
401
- candidatesTokensDetails?: {
402
- [x: string]: unknown;
403
- modality: string;
404
- tokenCount: number;
405
- }[] | null | undefined;
406
- toolUsePromptTokensDetails?: {
407
- [x: string]: unknown;
408
- modality: string;
409
- tokenCount: number;
410
- }[] | null | undefined;
327
+ groundingMetadata?: {
328
+ webSearchQueries?: string[] | null | undefined;
329
+ imageSearchQueries?: string[] | null | undefined;
330
+ retrievalQueries?: string[] | null | undefined;
331
+ searchEntryPoint?: {
332
+ renderedContent: string;
333
+ } | null | undefined;
334
+ groundingChunks?: {
335
+ web?: {
336
+ uri: string;
337
+ title?: string | null | undefined;
338
+ } | null | undefined;
339
+ image?: {
340
+ sourceUri: string;
341
+ imageUri: string;
342
+ title?: string | null | undefined;
343
+ domain?: string | null | undefined;
344
+ } | null | undefined;
345
+ retrievedContext?: {
346
+ uri?: string | null | undefined;
347
+ title?: string | null | undefined;
348
+ text?: string | null | undefined;
349
+ fileSearchStore?: string | null | undefined;
350
+ } | null | undefined;
351
+ maps?: {
352
+ uri?: string | null | undefined;
353
+ title?: string | null | undefined;
354
+ text?: string | null | undefined;
355
+ placeId?: string | null | undefined;
356
+ } | null | undefined;
357
+ }[] | null | undefined;
358
+ groundingSupports?: {
359
+ segment?: {
360
+ startIndex?: number | null | undefined;
361
+ endIndex?: number | null | undefined;
362
+ text?: string | null | undefined;
363
+ } | null | undefined;
364
+ segment_text?: string | null | undefined;
365
+ groundingChunkIndices?: number[] | null | undefined;
366
+ supportChunkIndices?: number[] | null | undefined;
367
+ confidenceScores?: number[] | null | undefined;
368
+ confidenceScore?: number[] | null | undefined;
369
+ }[] | null | undefined;
370
+ retrievalMetadata?: Record<string, never> | {
371
+ webDynamicRetrievalScore: number;
372
+ } | null | undefined;
411
373
  } | null | undefined;
412
- promptFeedback?: {
413
- blockReason?: string | null | undefined;
414
- safetyRatings?: {
415
- category?: string | null | undefined;
416
- probability?: string | null | undefined;
417
- probabilityScore?: number | null | undefined;
418
- severity?: string | null | undefined;
419
- severityScore?: number | null | undefined;
420
- blocked?: boolean | null | undefined;
421
- }[] | null | undefined;
374
+ urlContextMetadata?: {
375
+ urlMetadata?: {
376
+ retrievedUrl: string;
377
+ urlRetrievalStatus: string;
378
+ }[] | null | undefined;
422
379
  } | null | undefined;
380
+ }[] | null | undefined;
381
+ usageMetadata?: {
382
+ [x: string]: unknown;
383
+ cachedContentTokenCount?: number | null | undefined;
384
+ thoughtsTokenCount?: number | null | undefined;
385
+ promptTokenCount?: number | null | undefined;
386
+ candidatesTokenCount?: number | null | undefined;
387
+ toolUsePromptTokenCount?: number | null | undefined;
388
+ totalTokenCount?: number | null | undefined;
389
+ trafficType?: string | null | undefined;
390
+ serviceTier?: string | null | undefined;
391
+ promptTokensDetails?: {
392
+ [x: string]: unknown;
393
+ modality: string;
394
+ tokenCount: number;
395
+ }[] | null | undefined;
396
+ cacheTokensDetails?: {
397
+ [x: string]: unknown;
398
+ modality: string;
399
+ tokenCount: number;
400
+ }[] | null | undefined;
401
+ candidatesTokensDetails?: {
402
+ [x: string]: unknown;
403
+ modality: string;
404
+ tokenCount: number;
405
+ }[] | null | undefined;
406
+ toolUsePromptTokensDetails?: {
407
+ [x: string]: unknown;
408
+ modality: string;
409
+ tokenCount: number;
410
+ }[] | null | undefined;
411
+ } | null | undefined;
412
+ promptFeedback?: {
413
+ blockReason?: string | null | undefined;
414
+ safetyRatings?: {
415
+ category?: string | null | undefined;
416
+ probability?: string | null | undefined;
417
+ probabilityScore?: number | null | undefined;
418
+ severity?: string | null | undefined;
419
+ severityScore?: number | null | undefined;
420
+ blocked?: boolean | null | undefined;
421
+ }[] | null | undefined;
422
+ } | null | undefined;
423
423
  }>;
424
424
  type CandidateSchema = NonNullable<InferSchema<typeof responseSchema>['candidates']>[number];
425
- type GroundingMetadataSchema = NonNullable<CandidateSchema['groundingMetadata']>;
426
- type UrlContextMetadataSchema = NonNullable<CandidateSchema['urlContextMetadata']>;
427
- type SafetyRatingSchema = NonNullable<CandidateSchema['safetyRatings']>[number];
428
- type PromptFeedbackSchema = NonNullable<InferSchema<typeof responseSchema>['promptFeedback']>;
429
- type UsageMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['usageMetadata']>;
430
-
425
+ export type GroundingMetadataSchema = NonNullable<CandidateSchema['groundingMetadata']>;
426
+ export type UrlContextMetadataSchema = NonNullable<CandidateSchema['urlContextMetadata']>;
427
+ export type SafetyRatingSchema = NonNullable<CandidateSchema['safetyRatings']>[number];
428
+ export type PromptFeedbackSchema = NonNullable<InferSchema<typeof responseSchema>['promptFeedback']>;
429
+ export type UsageMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['usageMetadata']>;
430
+ //#endregion
431
+ //#region src/google-speech-model-options.d.ts
431
432
  type GoogleSpeechModelId = 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro-preview-tts' | 'gemini-3.1-flash-tts-preview' | 'gemini-3.8-flash-tts' | 'gemini-3.8-flash-lite-tts' | (string & {});
432
-
433
+ //#endregion
434
+ //#region src/google-speech-model.d.ts
433
435
  interface GoogleSpeechModelConfig {
434
- provider: string;
435
- baseURL: string;
436
- headers?: Resolvable<Record<string, string | undefined>>;
437
- fetch?: FetchFunction;
438
- _internal?: {
439
- currentDate?: () => Date;
440
- };
436
+ provider: string;
437
+ baseURL: string;
438
+ headers?: Resolvable<Record<string, string | undefined>>;
439
+ fetch?: FetchFunction;
440
+ _internal?: {
441
+ currentDate?: () => Date;
442
+ };
441
443
  }
442
- declare class GoogleSpeechModel implements SpeechModelV4 {
443
- readonly modelId: GoogleSpeechModelId;
444
- private readonly config;
445
- readonly specificationVersion = "v4";
446
- static [WORKFLOW_SERIALIZE](model: GoogleSpeechModel): {
447
- modelId: string;
448
- config: _ai_sdk_provider.JSONObject;
449
- };
450
- static [WORKFLOW_DESERIALIZE](options: {
451
- modelId: GoogleSpeechModelId;
452
- config: GoogleSpeechModelConfig;
453
- }): GoogleSpeechModel;
454
- get provider(): string;
455
- constructor(modelId: GoogleSpeechModelId, config: GoogleSpeechModelConfig);
456
- private getArgs;
457
- doGenerate(options: Parameters<SpeechModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<SpeechModelV4['doGenerate']>>>;
444
+ export declare class GoogleSpeechModel implements SpeechModelV4 {
445
+ readonly modelId: GoogleSpeechModelId;
446
+ private readonly config;
447
+ readonly specificationVersion = "v4";
448
+ static [WORKFLOW_SERIALIZE](model: GoogleSpeechModel): {
449
+ modelId: string;
450
+ config: import("@ai-sdk/provider").JSONObject;
451
+ };
452
+ static [WORKFLOW_DESERIALIZE](options: {
453
+ modelId: GoogleSpeechModelId;
454
+ config: GoogleSpeechModelConfig;
455
+ }): GoogleSpeechModel;
456
+ get provider(): string;
457
+ constructor(modelId: GoogleSpeechModelId, config: GoogleSpeechModelConfig);
458
+ private getArgs;
459
+ doGenerate(options: Parameters<SpeechModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<SpeechModelV4['doGenerate']>>>;
458
460
  }
459
-
461
+ //#endregion
462
+ //#region src/google-speech-input.d.ts
460
463
  /**
461
464
  * Inspects speech input without replacing provider option validation. This is
462
465
  * also used by intermediaries that need the transcript or voice kind before
463
466
  * invoking a model. Model support for structured turns is validated separately.
464
467
  */
465
- declare function getGoogleSpeechInput({ text, voice, providerOptions, }: {
466
- text: string;
467
- voice?: string;
468
- providerOptions?: Record<string, unknown>;
468
+ export declare function getGoogleSpeechInput({ text, voice, providerOptions }: {
469
+ text: string;
470
+ voice?: string;
471
+ providerOptions?: Record<string, unknown>;
469
472
  }): {
470
- text: string;
471
- usesCustomVoice: boolean;
473
+ text: string;
474
+ usesCustomVoice: boolean;
472
475
  };
473
-
474
- declare const googleTools: {
475
- /**
476
- * Creates a Google search tool that gives Google direct access to real-time web content.
477
- * Must have name "google_search".
478
- */
479
- googleSearch: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {}, {
480
- [x: string]: unknown;
481
- searchTypes?: {
482
- webSearch?: Record<string, never> | undefined;
483
- imageSearch?: Record<string, never> | undefined;
484
- } | undefined;
485
- timeRangeFilter?: {
486
- startTime: string;
487
- endTime: string;
488
- } | undefined;
489
- }, {}>;
490
- /**
491
- * Creates an Enterprise Web Search tool for grounding responses using a compliance-focused web index.
492
- * Designed for highly-regulated industries (finance, healthcare, public sector).
493
- * Does not log customer data and supports VPC service controls.
494
- * Must have name "enterprise_web_search".
495
- *
496
- * @note Only available on Vertex AI. Requires Gemini 2.0 or newer.
497
- *
498
- * @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/web-grounding-enterprise
499
- */
500
- enterpriseWebSearch: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {}, {}, {}>;
501
- /**
502
- * Creates a Google Maps grounding tool that gives the model access to Google Maps data.
503
- * Must have name "google_maps".
504
- *
505
- * @see https://ai.google.dev/gemini-api/docs/maps-grounding
506
- * @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/grounding-with-google-maps
507
- */
508
- googleMaps: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {}, {}, {}>;
509
- /**
510
- * Creates a URL context tool that gives Google direct access to real-time web content.
511
- * Must have name "url_context".
512
- */
513
- urlContext: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {}, {}, {}>;
514
- /**
515
- * Enables Retrieval Augmented Generation (RAG) via the Gemini File Search tool.
516
- * Must have name "file_search".
517
- *
518
- * @param fileSearchStoreNames - Fully-qualified File Search store resource names.
519
- * @param metadataFilter - Optional filter expression to restrict the files that can be retrieved.
520
- * @param topK - Optional result limit for the number of chunks returned from File Search.
521
- *
522
- * @see https://ai.google.dev/gemini-api/docs/file-search
523
- */
524
- fileSearch: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {}, {
525
- [x: string]: unknown;
526
- fileSearchStoreNames: string[];
527
- topK?: number | undefined;
528
- metadataFilter?: string | undefined;
529
- }, {}>;
530
- /**
531
- * A tool that enables the model to generate and run Python code.
532
- * Must have name "code_execution".
533
- *
534
- * @note Ensure the selected model supports Code Execution.
535
- * Multi-tool usage with the code execution tool is typically compatible with Gemini >=2 models.
536
- *
537
- * @see https://ai.google.dev/gemini-api/docs/code-execution (Google AI)
538
- * @see https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/code-execution-api (Vertex AI)
539
- */
540
- codeExecution: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{
541
- language: string;
542
- code: string;
543
- }, {
544
- outcome: string;
545
- output: string;
546
- }, {}, {}>;
547
- /**
548
- * Creates a Vertex RAG Store tool that enables the model to perform RAG searches against a Vertex RAG Store.
549
- * Must have name "vertex_rag_store".
550
- */
551
- vertexRagStore: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {}, {
552
- ragCorpus: string;
553
- topK?: number;
554
- }, {}>;
476
+ //#endregion
477
+ //#region src/google-tools.d.ts
478
+ export declare const googleTools: {
479
+ /**
480
+ * Creates a Google search tool that gives Google direct access to real-time web content.
481
+ * Must have name "google_search".
482
+ */
483
+ googleSearch: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{}, {}, {
484
+ [x: string]: unknown;
485
+ searchTypes?: {
486
+ webSearch?: Record<string, never> | undefined;
487
+ imageSearch?: Record<string, never> | undefined;
488
+ } | undefined;
489
+ timeRangeFilter?: {
490
+ startTime: string;
491
+ endTime: string;
492
+ } | undefined;
493
+ }, {}>;
494
+ /**
495
+ * Creates an Enterprise Web Search tool for grounding responses using a compliance-focused web index.
496
+ * Designed for highly-regulated industries (finance, healthcare, public sector).
497
+ * Does not log customer data and supports VPC service controls.
498
+ * Must have name "enterprise_web_search".
499
+ *
500
+ * @note Only available on Vertex AI. Requires Gemini 2.0 or newer.
501
+ *
502
+ * @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/web-grounding-enterprise
503
+ */
504
+ enterpriseWebSearch: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{}, {}, {}, {}>;
505
+ /**
506
+ * Creates a Google Maps grounding tool that gives the model access to Google Maps data.
507
+ * Must have name "google_maps".
508
+ *
509
+ * @see https://ai.google.dev/gemini-api/docs/maps-grounding
510
+ * @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/grounding-with-google-maps
511
+ */
512
+ googleMaps: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{}, {}, {}, {}>;
513
+ /**
514
+ * Creates a URL context tool that gives Google direct access to real-time web content.
515
+ * Must have name "url_context".
516
+ */
517
+ urlContext: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{}, {}, {}, {}>;
518
+ /**
519
+ * Enables Retrieval Augmented Generation (RAG) via the Gemini File Search tool.
520
+ * Must have name "file_search".
521
+ *
522
+ * @param fileSearchStoreNames - Fully-qualified File Search store resource names.
523
+ * @param metadataFilter - Optional filter expression to restrict the files that can be retrieved.
524
+ * @param topK - Optional result limit for the number of chunks returned from File Search.
525
+ *
526
+ * @see https://ai.google.dev/gemini-api/docs/file-search
527
+ */
528
+ fileSearch: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{}, {}, {
529
+ [x: string]: unknown;
530
+ fileSearchStoreNames: string[];
531
+ topK?: number | undefined;
532
+ metadataFilter?: string | undefined;
533
+ }, {}>;
534
+ /**
535
+ * A tool that enables the model to generate and run Python code.
536
+ * Must have name "code_execution".
537
+ *
538
+ * @note Ensure the selected model supports Code Execution.
539
+ * Multi-tool usage with the code execution tool is typically compatible with Gemini >=2 models.
540
+ *
541
+ * @see https://ai.google.dev/gemini-api/docs/code-execution (Google AI)
542
+ * @see https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/code-execution-api (Vertex AI)
543
+ */
544
+ codeExecution: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{
545
+ language: string;
546
+ code: string;
547
+ }, {
548
+ outcome: string;
549
+ output: string;
550
+ }, {}, {}>;
551
+ /**
552
+ * Creates a Vertex RAG Store tool that enables the model to perform RAG searches against a Vertex RAG Store.
553
+ * Must have name "vertex_rag_store".
554
+ */
555
+ vertexRagStore: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<{}, {}, {
556
+ ragCorpus: string;
557
+ topK?: number;
558
+ }, {}>;
555
559
  };
556
-
560
+ //#endregion
561
+ //#region src/interactions/google-interactions-language-model-options.d.ts
557
562
  /**
558
563
  * Type-only union of Gemini model IDs that the Interactions API accepts via
559
564
  * `model:`. Mirrors `Model` from `googleapis/js-genai`
@@ -564,48 +569,50 @@ declare const googleTools: {
564
569
  * may diverge over time.
565
570
  */
566
571
  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' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'lyria-3-clip-preview' | 'lyria-3-pro-preview' | (string & {});
567
-
572
+ //#endregion
573
+ //#region src/interactions/google-interactions-language-model.d.ts
568
574
  type GoogleInteractionsConfig = {
569
- provider: string;
570
- baseURL: string;
571
- headers?: Resolvable<Record<string, string | undefined>>;
572
- fetch?: FetchFunction;
573
- generateId: () => string;
574
- supportedUrls?: () => LanguageModelV4['supportedUrls'];
575
+ provider: string;
576
+ baseURL: string;
577
+ headers?: Resolvable<Record<string, string | undefined>>;
578
+ fetch?: FetchFunction;
579
+ generateId: () => string;
580
+ supportedUrls?: () => LanguageModelV4['supportedUrls'];
575
581
  };
576
582
  type GoogleInteractionsModelInput = GoogleInteractionsModelId | {
577
- agent: string;
583
+ agent: string;
578
584
  } | {
579
- managedAgent: string;
585
+ managedAgent: string;
580
586
  };
581
- declare class GoogleInteractionsLanguageModel implements LanguageModelV4 {
582
- readonly specificationVersion = "v4";
583
- readonly modelId: string;
584
- /**
585
- * Optional agent name. When provided, the request body sends `agent:` instead
586
- * of `model:` and rejects `generation_config` (warned, not thrown).
587
- */
588
- readonly agent: string | undefined;
589
- private readonly config;
590
- static [WORKFLOW_SERIALIZE](model: GoogleInteractionsLanguageModel): {
591
- agent: string | undefined;
592
- modelId: string;
593
- config: _ai_sdk_provider.JSONObject;
594
- };
595
- static [WORKFLOW_DESERIALIZE](options: {
596
- modelId: string;
597
- agent?: string;
598
- config: GoogleInteractionsConfig;
599
- }): GoogleInteractionsLanguageModel;
600
- constructor(modelOrAgent: GoogleInteractionsModelInput, config: GoogleInteractionsConfig);
601
- get provider(): string;
602
- get supportedUrls(): Record<string, RegExp[]> | PromiseLike<Record<string, RegExp[]>>;
603
- private getArgs;
604
- doGenerate(options: LanguageModelV4CallOptions): Promise<LanguageModelV4GenerateResult>;
605
- doStream(options: LanguageModelV4CallOptions): Promise<LanguageModelV4StreamResult>;
606
- private doStreamBackground;
587
+ export declare class GoogleInteractionsLanguageModel implements LanguageModelV4 {
588
+ readonly specificationVersion = "v4";
589
+ readonly modelId: string;
590
+ /**
591
+ * Optional agent name. When provided, the request body sends `agent:` instead
592
+ * of `model:` and rejects `generation_config` (warned, not thrown).
593
+ */
594
+ readonly agent: string | undefined;
595
+ private readonly config;
596
+ static [WORKFLOW_SERIALIZE](model: GoogleInteractionsLanguageModel): {
597
+ agent: string | undefined;
598
+ modelId: string;
599
+ config: import("@ai-sdk/provider").JSONObject;
600
+ };
601
+ static [WORKFLOW_DESERIALIZE](options: {
602
+ modelId: string;
603
+ agent?: string;
604
+ config: GoogleInteractionsConfig;
605
+ }): GoogleInteractionsLanguageModel;
606
+ constructor(modelOrAgent: GoogleInteractionsModelInput, config: GoogleInteractionsConfig);
607
+ get provider(): string;
608
+ get supportedUrls(): Record<string, RegExp[]> | PromiseLike<Record<string, RegExp[]>>;
609
+ private getArgs;
610
+ doGenerate(options: LanguageModelV4CallOptions): Promise<LanguageModelV4GenerateResult>;
611
+ doStream(options: LanguageModelV4CallOptions): Promise<LanguageModelV4StreamResult>;
612
+ private doStreamBackground;
607
613
  }
608
-
614
+ //#endregion
615
+ //#region src/interactions/google-interactions-agent.d.ts
609
616
  /**
610
617
  * Type-only module: declares the union of supported Gemini Interactions agent
611
618
  * names. Used by the `google.interactions({ agent })` factory branch.
@@ -616,5 +623,6 @@ declare class GoogleInteractionsLanguageModel implements LanguageModelV4 {
616
623
  * `GoogleInteractionsModelInput`.
617
624
  */
618
625
  type GoogleInteractionsAgentName = 'deep-research-pro-preview-12-2025' | 'deep-research-preview-04-2026' | 'deep-research-max-preview-04-2026' | 'antigravity-preview-05-2026';
619
-
620
- export { type GoogleInteractionsAgentName, GoogleInteractionsLanguageModel, type GoogleInteractionsModelId, type GoogleInteractionsModelInput, GoogleLanguageModel, type GoogleLanguageModelConfig, type GoogleModelId, GoogleSpeechModel, type GroundingMetadataSchema, type PromptFeedbackSchema, type SafetyRatingSchema, type UrlContextMetadataSchema, type UsageMetadataSchema, getGoogleSpeechInput, getGroundingMetadataSchema, getUrlContextMetadataSchema, googleTools, responseSchema };
626
+ //#endregion
627
+ export type { GoogleInteractionsAgentName, GoogleInteractionsModelId, GoogleInteractionsModelInput, GoogleModelId };
628
+ //# sourceMappingURL=index.d.ts.map