@ai-sdk/google 4.0.0-beta.44 → 4.0.0-beta.46
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 +25 -0
- package/README.md +4 -4
- package/dist/index.d.ts +40 -40
- package/dist/index.js +102 -108
- package/dist/index.js.map +1 -1
- package/dist/internal/index.d.ts +16 -16
- package/dist/internal/index.js +62 -62
- package/dist/internal/index.js.map +1 -1
- package/docs/{15-google-generative-ai.mdx → 15-google.mdx} +36 -36
- package/package.json +7 -6
- package/src/{convert-google-generative-ai-usage.ts → convert-google-usage.ts} +6 -6
- package/src/{convert-to-google-generative-ai-messages.ts → convert-to-google-messages.ts} +15 -15
- package/src/{google-generative-ai-embedding-model.ts → google-embedding-model.ts} +10 -16
- package/src/{google-generative-ai-embedding-options.ts → google-embedding-options.ts} +1 -1
- package/src/{google-generative-ai-files.ts → google-files.ts} +3 -3
- package/src/{google-generative-ai-image-model.ts → google-image-model.ts} +16 -20
- package/src/{google-generative-ai-image-settings.ts → google-image-settings.ts} +2 -2
- package/src/{google-generative-ai-language-model.ts → google-language-model.ts} +29 -34
- package/src/{google-generative-ai-options.ts → google-options.ts} +2 -2
- package/src/google-prepare-tools.ts +9 -5
- package/src/google-prompt.ts +82 -0
- package/src/google-provider.ts +42 -46
- package/src/{google-generative-ai-video-model.ts → google-video-model.ts} +5 -5
- package/src/{google-generative-ai-video-settings.ts → google-video-settings.ts} +1 -1
- package/src/index.ts +28 -10
- package/src/internal/index.ts +2 -2
- package/src/{map-google-generative-ai-finish-reason.ts → map-google-finish-reason.ts} +1 -1
- package/src/tool/code-execution.ts +2 -2
- package/src/tool/enterprise-web-search.ts +9 -3
- package/src/tool/file-search.ts +5 -7
- package/src/tool/google-maps.ts +3 -2
- package/src/tool/google-search.ts +10 -11
- package/src/tool/url-context.ts +4 -2
- package/src/tool/vertex-rag-store.ts +9 -6
- package/src/google-generative-ai-prompt.ts +0 -82
package/dist/internal/index.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE, Resolvable, FetchFunction, In
|
|
|
3
3
|
import { LanguageModelV4, JSONObject, LanguageModelV4CallOptions, LanguageModelV4GenerateResult, LanguageModelV4StreamResult } from '@ai-sdk/provider';
|
|
4
4
|
import { z } from 'zod/v4';
|
|
5
5
|
|
|
6
|
-
type
|
|
6
|
+
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-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 & {});
|
|
7
7
|
|
|
8
|
-
type
|
|
8
|
+
type GoogleConfig = {
|
|
9
9
|
provider: string;
|
|
10
10
|
baseURL: string;
|
|
11
11
|
headers?: Resolvable<Record<string, string | undefined>>;
|
|
@@ -16,20 +16,20 @@ type GoogleGenerativeAIConfig = {
|
|
|
16
16
|
*/
|
|
17
17
|
supportedUrls?: () => LanguageModelV4['supportedUrls'];
|
|
18
18
|
};
|
|
19
|
-
declare class
|
|
19
|
+
declare class GoogleLanguageModel implements LanguageModelV4 {
|
|
20
20
|
readonly specificationVersion = "v4";
|
|
21
|
-
readonly modelId:
|
|
21
|
+
readonly modelId: GoogleModelId;
|
|
22
22
|
private readonly config;
|
|
23
23
|
private readonly generateId;
|
|
24
|
-
static [WORKFLOW_SERIALIZE](model:
|
|
24
|
+
static [WORKFLOW_SERIALIZE](model: GoogleLanguageModel): {
|
|
25
25
|
modelId: string;
|
|
26
26
|
config: JSONObject;
|
|
27
27
|
};
|
|
28
28
|
static [WORKFLOW_DESERIALIZE](options: {
|
|
29
29
|
modelId: string;
|
|
30
|
-
config:
|
|
31
|
-
}):
|
|
32
|
-
constructor(modelId:
|
|
30
|
+
config: GoogleConfig;
|
|
31
|
+
}): GoogleLanguageModel;
|
|
32
|
+
constructor(modelId: GoogleModelId, config: GoogleConfig);
|
|
33
33
|
get provider(): string;
|
|
34
34
|
get supportedUrls(): Record<string, RegExp[]> | PromiseLike<Record<string, RegExp[]>>;
|
|
35
35
|
private getArgs;
|
|
@@ -246,7 +246,7 @@ declare const googleTools: {
|
|
|
246
246
|
* Creates a Google search tool that gives Google direct access to real-time web content.
|
|
247
247
|
* Must have name "google_search".
|
|
248
248
|
*/
|
|
249
|
-
googleSearch: _ai_sdk_provider_utils.
|
|
249
|
+
googleSearch: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {}, {
|
|
250
250
|
[x: string]: unknown;
|
|
251
251
|
searchTypes?: {
|
|
252
252
|
webSearch?: Record<string, never> | undefined;
|
|
@@ -267,7 +267,7 @@ declare const googleTools: {
|
|
|
267
267
|
*
|
|
268
268
|
* @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/web-grounding-enterprise
|
|
269
269
|
*/
|
|
270
|
-
enterpriseWebSearch: _ai_sdk_provider_utils.
|
|
270
|
+
enterpriseWebSearch: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {}, {}, {}>;
|
|
271
271
|
/**
|
|
272
272
|
* Creates a Google Maps grounding tool that gives the model access to Google Maps data.
|
|
273
273
|
* Must have name "google_maps".
|
|
@@ -275,12 +275,12 @@ declare const googleTools: {
|
|
|
275
275
|
* @see https://ai.google.dev/gemini-api/docs/maps-grounding
|
|
276
276
|
* @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/grounding-with-google-maps
|
|
277
277
|
*/
|
|
278
|
-
googleMaps: _ai_sdk_provider_utils.
|
|
278
|
+
googleMaps: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {}, {}, {}>;
|
|
279
279
|
/**
|
|
280
280
|
* Creates a URL context tool that gives Google direct access to real-time web content.
|
|
281
281
|
* Must have name "url_context".
|
|
282
282
|
*/
|
|
283
|
-
urlContext: _ai_sdk_provider_utils.
|
|
283
|
+
urlContext: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {}, {}, {}>;
|
|
284
284
|
/**
|
|
285
285
|
* Enables Retrieval Augmented Generation (RAG) via the Gemini File Search tool.
|
|
286
286
|
* Must have name "file_search".
|
|
@@ -291,7 +291,7 @@ declare const googleTools: {
|
|
|
291
291
|
*
|
|
292
292
|
* @see https://ai.google.dev/gemini-api/docs/file-search
|
|
293
293
|
*/
|
|
294
|
-
fileSearch: _ai_sdk_provider_utils.
|
|
294
|
+
fileSearch: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {}, {
|
|
295
295
|
[x: string]: unknown;
|
|
296
296
|
fileSearchStoreNames: string[];
|
|
297
297
|
topK?: number | undefined;
|
|
@@ -307,7 +307,7 @@ declare const googleTools: {
|
|
|
307
307
|
* @see https://ai.google.dev/gemini-api/docs/code-execution (Google AI)
|
|
308
308
|
* @see https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/code-execution-api (Vertex AI)
|
|
309
309
|
*/
|
|
310
|
-
codeExecution: _ai_sdk_provider_utils.
|
|
310
|
+
codeExecution: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{
|
|
311
311
|
language: string;
|
|
312
312
|
code: string;
|
|
313
313
|
}, {
|
|
@@ -318,10 +318,10 @@ declare const googleTools: {
|
|
|
318
318
|
* Creates a Vertex RAG Store tool that enables the model to perform RAG searches against a Vertex RAG Store.
|
|
319
319
|
* Must have name "vertex_rag_store".
|
|
320
320
|
*/
|
|
321
|
-
vertexRagStore: _ai_sdk_provider_utils.
|
|
321
|
+
vertexRagStore: _ai_sdk_provider_utils.ProviderExecutedToolFactory<{}, {}, {
|
|
322
322
|
ragCorpus: string;
|
|
323
323
|
topK?: number;
|
|
324
324
|
}, {}>;
|
|
325
325
|
};
|
|
326
326
|
|
|
327
|
-
export {
|
|
327
|
+
export { GoogleLanguageModel, type GoogleModelId, type GroundingMetadataSchema, type PromptFeedbackSchema, type SafetyRatingSchema, type UrlContextMetadataSchema, type UsageMetadataSchema, getGroundingMetadataSchema, getUrlContextMetadataSchema, googleTools };
|
package/dist/internal/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/google-
|
|
1
|
+
// src/google-language-model.ts
|
|
2
2
|
import {
|
|
3
3
|
combineHeaders,
|
|
4
4
|
createEventSourceResponseHandler,
|
|
@@ -18,8 +18,8 @@ import {
|
|
|
18
18
|
} from "@ai-sdk/provider-utils";
|
|
19
19
|
import { z as z3 } from "zod/v4";
|
|
20
20
|
|
|
21
|
-
// src/convert-google-
|
|
22
|
-
function
|
|
21
|
+
// src/convert-google-usage.ts
|
|
22
|
+
function convertGoogleUsage(usage) {
|
|
23
23
|
var _a, _b, _c, _d;
|
|
24
24
|
if (usage == null) {
|
|
25
25
|
return {
|
|
@@ -173,7 +173,7 @@ function isEmptyObjectSchema(jsonSchema) {
|
|
|
173
173
|
return jsonSchema != null && typeof jsonSchema === "object" && jsonSchema.type === "object" && (jsonSchema.properties == null || Object.keys(jsonSchema.properties).length === 0) && !jsonSchema.additionalProperties;
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
// src/convert-to-google-
|
|
176
|
+
// src/convert-to-google-messages.ts
|
|
177
177
|
import {
|
|
178
178
|
UnsupportedFunctionalityError
|
|
179
179
|
} from "@ai-sdk/provider";
|
|
@@ -288,7 +288,7 @@ function appendLegacyToolResultParts(parts, toolName, outputValue) {
|
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function convertToGoogleMessages(prompt, options) {
|
|
292
292
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
293
293
|
const systemInstructionParts = [];
|
|
294
294
|
const contents = [];
|
|
@@ -506,7 +506,7 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
|
|
|
506
506
|
name: part.toolName,
|
|
507
507
|
response: {
|
|
508
508
|
name: part.toolName,
|
|
509
|
-
content: output.type === "execution-denied" ? (_h = output.reason) != null ? _h : "Tool execution denied." : output.value
|
|
509
|
+
content: output.type === "execution-denied" ? (_h = output.reason) != null ? _h : "Tool call execution denied." : output.value
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
512
|
});
|
|
@@ -558,7 +558,7 @@ var googleFailedResponseHandler = createJsonErrorResponseHandler({
|
|
|
558
558
|
errorToMessage: (data) => data.error.message
|
|
559
559
|
});
|
|
560
560
|
|
|
561
|
-
// src/google-
|
|
561
|
+
// src/google-options.ts
|
|
562
562
|
import { lazySchema as lazySchema2, zodSchema as zodSchema2 } from "@ai-sdk/provider-utils";
|
|
563
563
|
import { z as z2 } from "zod/v4";
|
|
564
564
|
var googleLanguageModelOptions = lazySchema2(
|
|
@@ -582,7 +582,7 @@ var googleLanguageModelOptions = lazySchema2(
|
|
|
582
582
|
*
|
|
583
583
|
* This is useful when the JSON Schema contains elements that are
|
|
584
584
|
* not supported by the OpenAPI schema version that
|
|
585
|
-
* Google
|
|
585
|
+
* Google uses. You can use this to disable
|
|
586
586
|
* structured outputs if you need to.
|
|
587
587
|
*/
|
|
588
588
|
structuredOutputs: z2.boolean().optional(),
|
|
@@ -707,7 +707,8 @@ import {
|
|
|
707
707
|
function prepareTools({
|
|
708
708
|
tools,
|
|
709
709
|
toolChoice,
|
|
710
|
-
modelId
|
|
710
|
+
modelId,
|
|
711
|
+
isVertexProvider = false
|
|
711
712
|
}) {
|
|
712
713
|
var _a, _b;
|
|
713
714
|
tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
|
|
@@ -843,7 +844,9 @@ function prepareTools({
|
|
|
843
844
|
}
|
|
844
845
|
const combinedToolConfig = {
|
|
845
846
|
functionCallingConfig: { mode: "VALIDATED" },
|
|
846
|
-
|
|
847
|
+
...!isVertexProvider && {
|
|
848
|
+
includeServerSideToolInvocations: true
|
|
849
|
+
}
|
|
847
850
|
};
|
|
848
851
|
if (toolChoice != null) {
|
|
849
852
|
switch (toolChoice.type) {
|
|
@@ -1175,8 +1178,8 @@ function resolvePartialArgValue(arg) {
|
|
|
1175
1178
|
return void 0;
|
|
1176
1179
|
}
|
|
1177
1180
|
|
|
1178
|
-
// src/map-google-
|
|
1179
|
-
function
|
|
1181
|
+
// src/map-google-finish-reason.ts
|
|
1182
|
+
function mapGoogleFinishReason({
|
|
1180
1183
|
finishReason,
|
|
1181
1184
|
hasToolCalls
|
|
1182
1185
|
}) {
|
|
@@ -1201,8 +1204,8 @@ function mapGoogleGenerativeAIFinishReason({
|
|
|
1201
1204
|
}
|
|
1202
1205
|
}
|
|
1203
1206
|
|
|
1204
|
-
// src/google-
|
|
1205
|
-
var
|
|
1207
|
+
// src/google-language-model.ts
|
|
1208
|
+
var GoogleLanguageModel = class _GoogleLanguageModel {
|
|
1206
1209
|
constructor(modelId, config) {
|
|
1207
1210
|
this.specificationVersion = "v4";
|
|
1208
1211
|
var _a;
|
|
@@ -1217,7 +1220,7 @@ var GoogleGenerativeAILanguageModel = class _GoogleGenerativeAILanguageModel {
|
|
|
1217
1220
|
});
|
|
1218
1221
|
}
|
|
1219
1222
|
static [WORKFLOW_DESERIALIZE](options) {
|
|
1220
|
-
return new
|
|
1223
|
+
return new _GoogleLanguageModel(options.modelId, options.config);
|
|
1221
1224
|
}
|
|
1222
1225
|
get provider() {
|
|
1223
1226
|
return this.config.provider;
|
|
@@ -1278,14 +1281,11 @@ var GoogleGenerativeAILanguageModel = class _GoogleGenerativeAILanguageModel {
|
|
|
1278
1281
|
}
|
|
1279
1282
|
const isGemmaModel = this.modelId.toLowerCase().startsWith("gemma-");
|
|
1280
1283
|
const supportsFunctionResponseParts = this.modelId.startsWith("gemini-3");
|
|
1281
|
-
const { contents, systemInstruction } =
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
supportsFunctionResponseParts
|
|
1287
|
-
}
|
|
1288
|
-
);
|
|
1284
|
+
const { contents, systemInstruction } = convertToGoogleMessages(prompt, {
|
|
1285
|
+
isGemmaModel,
|
|
1286
|
+
providerOptionsName,
|
|
1287
|
+
supportsFunctionResponseParts
|
|
1288
|
+
});
|
|
1289
1289
|
const {
|
|
1290
1290
|
tools: googleTools2,
|
|
1291
1291
|
toolConfig: googleToolConfig,
|
|
@@ -1293,7 +1293,8 @@ var GoogleGenerativeAILanguageModel = class _GoogleGenerativeAILanguageModel {
|
|
|
1293
1293
|
} = prepareTools({
|
|
1294
1294
|
tools,
|
|
1295
1295
|
toolChoice,
|
|
1296
|
-
modelId: this.modelId
|
|
1296
|
+
modelId: this.modelId,
|
|
1297
|
+
isVertexProvider
|
|
1297
1298
|
});
|
|
1298
1299
|
const resolvedThinking = resolveThinkingConfig({
|
|
1299
1300
|
reasoning,
|
|
@@ -1508,7 +1509,7 @@ var GoogleGenerativeAILanguageModel = class _GoogleGenerativeAILanguageModel {
|
|
|
1508
1509
|
return {
|
|
1509
1510
|
content,
|
|
1510
1511
|
finishReason: {
|
|
1511
|
-
unified:
|
|
1512
|
+
unified: mapGoogleFinishReason({
|
|
1512
1513
|
finishReason: candidate.finishReason,
|
|
1513
1514
|
// Only count client-executed tool calls for finish reason determination.
|
|
1514
1515
|
hasToolCalls: content.some(
|
|
@@ -1517,7 +1518,7 @@ var GoogleGenerativeAILanguageModel = class _GoogleGenerativeAILanguageModel {
|
|
|
1517
1518
|
}),
|
|
1518
1519
|
raw: (_j = candidate.finishReason) != null ? _j : void 0
|
|
1519
1520
|
},
|
|
1520
|
-
usage:
|
|
1521
|
+
usage: convertGoogleUsage(usageMetadata),
|
|
1521
1522
|
warnings,
|
|
1522
1523
|
providerMetadata: {
|
|
1523
1524
|
[providerOptionsName]: {
|
|
@@ -1886,7 +1887,7 @@ var GoogleGenerativeAILanguageModel = class _GoogleGenerativeAILanguageModel {
|
|
|
1886
1887
|
}
|
|
1887
1888
|
if (candidate.finishReason != null) {
|
|
1888
1889
|
finishReason = {
|
|
1889
|
-
unified:
|
|
1890
|
+
unified: mapGoogleFinishReason({
|
|
1890
1891
|
finishReason: candidate.finishReason,
|
|
1891
1892
|
hasToolCalls
|
|
1892
1893
|
}),
|
|
@@ -1921,7 +1922,7 @@ var GoogleGenerativeAILanguageModel = class _GoogleGenerativeAILanguageModel {
|
|
|
1921
1922
|
controller.enqueue({
|
|
1922
1923
|
type: "finish",
|
|
1923
1924
|
finishReason,
|
|
1924
|
-
usage:
|
|
1925
|
+
usage: convertGoogleUsage(usage),
|
|
1925
1926
|
providerMetadata
|
|
1926
1927
|
});
|
|
1927
1928
|
}
|
|
@@ -2285,9 +2286,9 @@ var chunkSchema = lazySchema3(
|
|
|
2285
2286
|
);
|
|
2286
2287
|
|
|
2287
2288
|
// src/tool/code-execution.ts
|
|
2288
|
-
import {
|
|
2289
|
+
import { createProviderExecutedToolFactory } from "@ai-sdk/provider-utils";
|
|
2289
2290
|
import { z as z4 } from "zod/v4";
|
|
2290
|
-
var codeExecution =
|
|
2291
|
+
var codeExecution = createProviderExecutedToolFactory({
|
|
2291
2292
|
id: "google.code_execution",
|
|
2292
2293
|
inputSchema: z4.object({
|
|
2293
2294
|
language: z4.string().describe("The programming language of the code."),
|
|
@@ -2301,19 +2302,20 @@ var codeExecution = createProviderToolFactoryWithOutputSchema({
|
|
|
2301
2302
|
|
|
2302
2303
|
// src/tool/enterprise-web-search.ts
|
|
2303
2304
|
import {
|
|
2304
|
-
|
|
2305
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory2,
|
|
2305
2306
|
lazySchema as lazySchema4,
|
|
2306
2307
|
zodSchema as zodSchema4
|
|
2307
2308
|
} from "@ai-sdk/provider-utils";
|
|
2308
2309
|
import { z as z5 } from "zod/v4";
|
|
2309
|
-
var enterpriseWebSearch =
|
|
2310
|
+
var enterpriseWebSearch = createProviderExecutedToolFactory2({
|
|
2310
2311
|
id: "google.enterprise_web_search",
|
|
2311
|
-
inputSchema: lazySchema4(() => zodSchema4(z5.object({})))
|
|
2312
|
+
inputSchema: lazySchema4(() => zodSchema4(z5.object({}))),
|
|
2313
|
+
outputSchema: lazySchema4(() => zodSchema4(z5.object({})))
|
|
2312
2314
|
});
|
|
2313
2315
|
|
|
2314
2316
|
// src/tool/file-search.ts
|
|
2315
2317
|
import {
|
|
2316
|
-
|
|
2318
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory3,
|
|
2317
2319
|
lazySchema as lazySchema5,
|
|
2318
2320
|
zodSchema as zodSchema5
|
|
2319
2321
|
} from "@ai-sdk/provider-utils";
|
|
@@ -2334,29 +2336,28 @@ var fileSearchArgsBaseSchema = z6.object({
|
|
|
2334
2336
|
"Metadata filter to apply to the file search retrieval documents. See https://google.aip.dev/160 for the syntax of the filter expression."
|
|
2335
2337
|
).optional()
|
|
2336
2338
|
}).passthrough();
|
|
2337
|
-
var
|
|
2338
|
-
() => zodSchema5(fileSearchArgsBaseSchema)
|
|
2339
|
-
);
|
|
2340
|
-
var fileSearch = createProviderToolFactory2({
|
|
2339
|
+
var fileSearch = createProviderExecutedToolFactory3({
|
|
2341
2340
|
id: "google.file_search",
|
|
2342
|
-
inputSchema:
|
|
2341
|
+
inputSchema: lazySchema5(() => zodSchema5(z6.object({}))),
|
|
2342
|
+
outputSchema: lazySchema5(() => zodSchema5(z6.object({})))
|
|
2343
2343
|
});
|
|
2344
2344
|
|
|
2345
2345
|
// src/tool/google-maps.ts
|
|
2346
2346
|
import {
|
|
2347
|
-
|
|
2347
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory4,
|
|
2348
2348
|
lazySchema as lazySchema6,
|
|
2349
2349
|
zodSchema as zodSchema6
|
|
2350
2350
|
} from "@ai-sdk/provider-utils";
|
|
2351
2351
|
import { z as z7 } from "zod/v4";
|
|
2352
|
-
var googleMaps =
|
|
2352
|
+
var googleMaps = createProviderExecutedToolFactory4({
|
|
2353
2353
|
id: "google.google_maps",
|
|
2354
|
-
inputSchema: lazySchema6(() => zodSchema6(z7.object({})))
|
|
2354
|
+
inputSchema: lazySchema6(() => zodSchema6(z7.object({}))),
|
|
2355
|
+
outputSchema: lazySchema6(() => zodSchema6(z7.object({})))
|
|
2355
2356
|
});
|
|
2356
2357
|
|
|
2357
2358
|
// src/tool/google-search.ts
|
|
2358
2359
|
import {
|
|
2359
|
-
|
|
2360
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory5,
|
|
2360
2361
|
lazySchema as lazySchema7,
|
|
2361
2362
|
zodSchema as zodSchema7
|
|
2362
2363
|
} from "@ai-sdk/provider-utils";
|
|
@@ -2371,37 +2372,36 @@ var googleSearchToolArgsBaseSchema = z8.object({
|
|
|
2371
2372
|
endTime: z8.string()
|
|
2372
2373
|
}).optional()
|
|
2373
2374
|
}).passthrough();
|
|
2374
|
-
var
|
|
2375
|
-
|
|
2376
|
-
)
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
id: "google.google_search",
|
|
2380
|
-
inputSchema: googleSearchToolArgsSchema
|
|
2381
|
-
}
|
|
2382
|
-
);
|
|
2375
|
+
var googleSearch = createProviderExecutedToolFactory5({
|
|
2376
|
+
id: "google.google_search",
|
|
2377
|
+
inputSchema: lazySchema7(() => zodSchema7(z8.object({}))),
|
|
2378
|
+
outputSchema: lazySchema7(() => zodSchema7(z8.object({})))
|
|
2379
|
+
});
|
|
2383
2380
|
|
|
2384
2381
|
// src/tool/url-context.ts
|
|
2385
2382
|
import {
|
|
2386
|
-
|
|
2383
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory6,
|
|
2387
2384
|
lazySchema as lazySchema8,
|
|
2388
2385
|
zodSchema as zodSchema8
|
|
2389
2386
|
} from "@ai-sdk/provider-utils";
|
|
2390
2387
|
import { z as z9 } from "zod/v4";
|
|
2391
|
-
var urlContext =
|
|
2388
|
+
var urlContext = createProviderExecutedToolFactory6({
|
|
2392
2389
|
id: "google.url_context",
|
|
2393
|
-
inputSchema: lazySchema8(() => zodSchema8(z9.object({})))
|
|
2390
|
+
inputSchema: lazySchema8(() => zodSchema8(z9.object({}))),
|
|
2391
|
+
outputSchema: lazySchema8(() => zodSchema8(z9.object({})))
|
|
2394
2392
|
});
|
|
2395
2393
|
|
|
2396
2394
|
// src/tool/vertex-rag-store.ts
|
|
2397
|
-
import {
|
|
2395
|
+
import {
|
|
2396
|
+
createProviderExecutedToolFactory as createProviderExecutedToolFactory7,
|
|
2397
|
+
lazySchema as lazySchema9,
|
|
2398
|
+
zodSchema as zodSchema9
|
|
2399
|
+
} from "@ai-sdk/provider-utils";
|
|
2398
2400
|
import { z as z10 } from "zod/v4";
|
|
2399
|
-
var vertexRagStore =
|
|
2401
|
+
var vertexRagStore = createProviderExecutedToolFactory7({
|
|
2400
2402
|
id: "google.vertex_rag_store",
|
|
2401
|
-
inputSchema: z10.object({
|
|
2402
|
-
|
|
2403
|
-
topK: z10.number().optional()
|
|
2404
|
-
})
|
|
2403
|
+
inputSchema: lazySchema9(() => zodSchema9(z10.object({}))),
|
|
2404
|
+
outputSchema: lazySchema9(() => zodSchema9(z10.object({})))
|
|
2405
2405
|
});
|
|
2406
2406
|
|
|
2407
2407
|
// src/google-tools.ts
|
|
@@ -2464,7 +2464,7 @@ var googleTools = {
|
|
|
2464
2464
|
vertexRagStore
|
|
2465
2465
|
};
|
|
2466
2466
|
export {
|
|
2467
|
-
|
|
2467
|
+
GoogleLanguageModel,
|
|
2468
2468
|
getGroundingMetadataSchema,
|
|
2469
2469
|
getUrlContextMetadataSchema,
|
|
2470
2470
|
googleTools
|