@ai-sdk/google 2.0.17 → 2.0.19
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 +17 -0
- package/dist/index.d.mts +139 -132
- package/dist/index.d.ts +139 -132
- package/dist/index.js +332 -270
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +327 -251
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +139 -11
- package/dist/internal/index.d.ts +139 -11
- package/dist/internal/index.js +263 -220
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +254 -205
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/internal/index.mjs
CHANGED
@@ -4,11 +4,13 @@ import {
|
|
4
4
|
createEventSourceResponseHandler,
|
5
5
|
createJsonResponseHandler,
|
6
6
|
generateId,
|
7
|
+
lazySchema as lazySchema3,
|
7
8
|
parseProviderOptions,
|
8
9
|
postJsonToApi,
|
9
|
-
resolve
|
10
|
+
resolve,
|
11
|
+
zodSchema as zodSchema3
|
10
12
|
} from "@ai-sdk/provider-utils";
|
11
|
-
import
|
13
|
+
import * as z3 from "zod/v4";
|
12
14
|
|
13
15
|
// src/convert-json-schema-to-openapi-schema.ts
|
14
16
|
function convertJSONSchemaToOpenAPISchema(jsonSchema) {
|
@@ -33,12 +35,9 @@ function convertJSONSchemaToOpenAPISchema(jsonSchema) {
|
|
33
35
|
enum: enumValues
|
34
36
|
} = jsonSchema;
|
35
37
|
const result = {};
|
36
|
-
if (description)
|
37
|
-
|
38
|
-
if (
|
39
|
-
result.required = required;
|
40
|
-
if (format)
|
41
|
-
result.format = format;
|
38
|
+
if (description) result.description = description;
|
39
|
+
if (required) result.required = required;
|
40
|
+
if (format) result.format = format;
|
42
41
|
if (constValue !== void 0) {
|
43
42
|
result.enum = [constValue];
|
44
43
|
}
|
@@ -285,56 +284,80 @@ function getModelPath(modelId) {
|
|
285
284
|
}
|
286
285
|
|
287
286
|
// src/google-error.ts
|
288
|
-
import {
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
287
|
+
import {
|
288
|
+
createJsonErrorResponseHandler,
|
289
|
+
lazySchema,
|
290
|
+
zodSchema
|
291
|
+
} from "@ai-sdk/provider-utils";
|
292
|
+
import * as z from "zod/v4";
|
293
|
+
var googleErrorDataSchema = lazySchema(
|
294
|
+
() => zodSchema(
|
295
|
+
z.object({
|
296
|
+
error: z.object({
|
297
|
+
code: z.number().nullable(),
|
298
|
+
message: z.string(),
|
299
|
+
status: z.string()
|
300
|
+
})
|
301
|
+
})
|
302
|
+
)
|
303
|
+
);
|
297
304
|
var googleFailedResponseHandler = createJsonErrorResponseHandler({
|
298
305
|
errorSchema: googleErrorDataSchema,
|
299
306
|
errorToMessage: (data) => data.error.message
|
300
307
|
});
|
301
308
|
|
302
309
|
// src/google-generative-ai-options.ts
|
303
|
-
import {
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
/**
|
311
|
-
Optional.
|
312
|
-
The name of the cached content used as context to serve the prediction.
|
313
|
-
Format: cachedContents/{cachedContent}
|
314
|
-
*/
|
315
|
-
cachedContent: z2.string().optional(),
|
316
|
-
/**
|
317
|
-
* Optional. Enable structured output. Default is true.
|
318
|
-
*
|
319
|
-
* This is useful when the JSON Schema contains elements that are
|
320
|
-
* not supported by the OpenAPI schema version that
|
321
|
-
* Google Generative AI uses. You can use this to disable
|
322
|
-
* structured outputs if you need to.
|
323
|
-
*/
|
324
|
-
structuredOutputs: z2.boolean().optional(),
|
325
|
-
/**
|
326
|
-
Optional. A list of unique safety settings for blocking unsafe content.
|
327
|
-
*/
|
328
|
-
safetySettings: z2.array(
|
310
|
+
import {
|
311
|
+
lazySchema as lazySchema2,
|
312
|
+
zodSchema as zodSchema2
|
313
|
+
} from "@ai-sdk/provider-utils";
|
314
|
+
import * as z2 from "zod/v4";
|
315
|
+
var googleGenerativeAIProviderOptions = lazySchema2(
|
316
|
+
() => zodSchema2(
|
329
317
|
z2.object({
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
318
|
+
responseModalities: z2.array(z2.enum(["TEXT", "IMAGE"])).optional(),
|
319
|
+
thinkingConfig: z2.object({
|
320
|
+
thinkingBudget: z2.number().optional(),
|
321
|
+
includeThoughts: z2.boolean().optional()
|
322
|
+
}).optional(),
|
323
|
+
/**
|
324
|
+
* Optional.
|
325
|
+
* The name of the cached content used as context to serve the prediction.
|
326
|
+
* Format: cachedContents/{cachedContent}
|
327
|
+
*/
|
328
|
+
cachedContent: z2.string().optional(),
|
329
|
+
/**
|
330
|
+
* Optional. Enable structured output. Default is true.
|
331
|
+
*
|
332
|
+
* This is useful when the JSON Schema contains elements that are
|
333
|
+
* not supported by the OpenAPI schema version that
|
334
|
+
* Google Generative AI uses. You can use this to disable
|
335
|
+
* structured outputs if you need to.
|
336
|
+
*/
|
337
|
+
structuredOutputs: z2.boolean().optional(),
|
338
|
+
/**
|
339
|
+
* Optional. A list of unique safety settings for blocking unsafe content.
|
340
|
+
*/
|
341
|
+
safetySettings: z2.array(
|
342
|
+
z2.object({
|
343
|
+
category: z2.enum([
|
344
|
+
"HARM_CATEGORY_UNSPECIFIED",
|
345
|
+
"HARM_CATEGORY_HATE_SPEECH",
|
346
|
+
"HARM_CATEGORY_DANGEROUS_CONTENT",
|
347
|
+
"HARM_CATEGORY_HARASSMENT",
|
348
|
+
"HARM_CATEGORY_SEXUALLY_EXPLICIT",
|
349
|
+
"HARM_CATEGORY_CIVIC_INTEGRITY"
|
350
|
+
]),
|
351
|
+
threshold: z2.enum([
|
352
|
+
"HARM_BLOCK_THRESHOLD_UNSPECIFIED",
|
353
|
+
"BLOCK_LOW_AND_ABOVE",
|
354
|
+
"BLOCK_MEDIUM_AND_ABOVE",
|
355
|
+
"BLOCK_ONLY_HIGH",
|
356
|
+
"BLOCK_NONE",
|
357
|
+
"OFF"
|
358
|
+
])
|
359
|
+
})
|
360
|
+
).optional(),
|
338
361
|
threshold: z2.enum([
|
339
362
|
"HARM_BLOCK_THRESHOLD_UNSPECIFIED",
|
340
363
|
"BLOCK_LOW_AND_ABOVE",
|
@@ -342,30 +365,33 @@ var googleGenerativeAIProviderOptions = z2.object({
|
|
342
365
|
"BLOCK_ONLY_HIGH",
|
343
366
|
"BLOCK_NONE",
|
344
367
|
"OFF"
|
345
|
-
])
|
368
|
+
]).optional(),
|
369
|
+
/**
|
370
|
+
* Optional. Enables timestamp understanding for audio-only files.
|
371
|
+
*
|
372
|
+
* https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/audio-understanding
|
373
|
+
*/
|
374
|
+
audioTimestamp: z2.boolean().optional(),
|
375
|
+
/**
|
376
|
+
* Optional. Defines labels used in billing reports. Available on Vertex AI only.
|
377
|
+
*
|
378
|
+
* https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/add-labels-to-api-calls
|
379
|
+
*/
|
380
|
+
labels: z2.record(z2.string(), z2.string()).optional(),
|
381
|
+
/**
|
382
|
+
* Optional. If specified, the media resolution specified will be used.
|
383
|
+
*
|
384
|
+
* https://ai.google.dev/api/generate-content#MediaResolution
|
385
|
+
*/
|
386
|
+
mediaResolution: z2.enum([
|
387
|
+
"MEDIA_RESOLUTION_UNSPECIFIED",
|
388
|
+
"MEDIA_RESOLUTION_LOW",
|
389
|
+
"MEDIA_RESOLUTION_MEDIUM",
|
390
|
+
"MEDIA_RESOLUTION_HIGH"
|
391
|
+
]).optional()
|
346
392
|
})
|
347
|
-
)
|
348
|
-
|
349
|
-
"HARM_BLOCK_THRESHOLD_UNSPECIFIED",
|
350
|
-
"BLOCK_LOW_AND_ABOVE",
|
351
|
-
"BLOCK_MEDIUM_AND_ABOVE",
|
352
|
-
"BLOCK_ONLY_HIGH",
|
353
|
-
"BLOCK_NONE",
|
354
|
-
"OFF"
|
355
|
-
]).optional(),
|
356
|
-
/**
|
357
|
-
* Optional. Enables timestamp understanding for audio-only files.
|
358
|
-
*
|
359
|
-
* https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/audio-understanding
|
360
|
-
*/
|
361
|
-
audioTimestamp: z2.boolean().optional(),
|
362
|
-
/**
|
363
|
-
* Optional. Defines labels used in billing reports. Available on Vertex AI only.
|
364
|
-
*
|
365
|
-
* https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/add-labels-to-api-calls
|
366
|
-
*/
|
367
|
-
labels: z2.record(z2.string(), z2.string()).optional()
|
368
|
-
});
|
393
|
+
)
|
394
|
+
);
|
369
395
|
|
370
396
|
// src/google-prepare-tools.ts
|
371
397
|
import {
|
@@ -538,64 +564,6 @@ function mapGoogleGenerativeAIFinishReason({
|
|
538
564
|
}
|
539
565
|
}
|
540
566
|
|
541
|
-
// src/tool/google-search.ts
|
542
|
-
import { createProviderDefinedToolFactory } from "@ai-sdk/provider-utils";
|
543
|
-
import { z as z3 } from "zod/v4";
|
544
|
-
var groundingChunkSchema = z3.object({
|
545
|
-
web: z3.object({ uri: z3.string(), title: z3.string() }).nullish(),
|
546
|
-
retrievedContext: z3.object({ uri: z3.string(), title: z3.string() }).nullish()
|
547
|
-
});
|
548
|
-
var groundingMetadataSchema = z3.object({
|
549
|
-
webSearchQueries: z3.array(z3.string()).nullish(),
|
550
|
-
retrievalQueries: z3.array(z3.string()).nullish(),
|
551
|
-
searchEntryPoint: z3.object({ renderedContent: z3.string() }).nullish(),
|
552
|
-
groundingChunks: z3.array(groundingChunkSchema).nullish(),
|
553
|
-
groundingSupports: z3.array(
|
554
|
-
z3.object({
|
555
|
-
segment: z3.object({
|
556
|
-
startIndex: z3.number().nullish(),
|
557
|
-
endIndex: z3.number().nullish(),
|
558
|
-
text: z3.string().nullish()
|
559
|
-
}),
|
560
|
-
segment_text: z3.string().nullish(),
|
561
|
-
groundingChunkIndices: z3.array(z3.number()).nullish(),
|
562
|
-
supportChunkIndices: z3.array(z3.number()).nullish(),
|
563
|
-
confidenceScores: z3.array(z3.number()).nullish(),
|
564
|
-
confidenceScore: z3.array(z3.number()).nullish()
|
565
|
-
})
|
566
|
-
).nullish(),
|
567
|
-
retrievalMetadata: z3.union([
|
568
|
-
z3.object({
|
569
|
-
webDynamicRetrievalScore: z3.number()
|
570
|
-
}),
|
571
|
-
z3.object({})
|
572
|
-
]).nullish()
|
573
|
-
});
|
574
|
-
var googleSearch = createProviderDefinedToolFactory({
|
575
|
-
id: "google.google_search",
|
576
|
-
name: "google_search",
|
577
|
-
inputSchema: z3.object({
|
578
|
-
mode: z3.enum(["MODE_DYNAMIC", "MODE_UNSPECIFIED"]).default("MODE_UNSPECIFIED"),
|
579
|
-
dynamicThreshold: z3.number().default(1)
|
580
|
-
})
|
581
|
-
});
|
582
|
-
|
583
|
-
// src/tool/url-context.ts
|
584
|
-
import { createProviderDefinedToolFactory as createProviderDefinedToolFactory2 } from "@ai-sdk/provider-utils";
|
585
|
-
import { z as z4 } from "zod/v4";
|
586
|
-
var urlMetadataSchema = z4.object({
|
587
|
-
retrievedUrl: z4.string(),
|
588
|
-
urlRetrievalStatus: z4.string()
|
589
|
-
});
|
590
|
-
var urlContextMetadataSchema = z4.object({
|
591
|
-
urlMetadata: z4.array(urlMetadataSchema)
|
592
|
-
});
|
593
|
-
var urlContext = createProviderDefinedToolFactory2({
|
594
|
-
id: "google.url_context",
|
595
|
-
name: "url_context",
|
596
|
-
inputSchema: z4.object({})
|
597
|
-
});
|
598
|
-
|
599
567
|
// src/google-generative-ai-language-model.ts
|
600
568
|
var GoogleGenerativeAILanguageModel = class {
|
601
569
|
constructor(modelId, config) {
|
@@ -1088,103 +1056,183 @@ function extractSources({
|
|
1088
1056
|
title: chunk.web.title
|
1089
1057
|
}));
|
1090
1058
|
}
|
1091
|
-
var
|
1092
|
-
|
1093
|
-
|
1059
|
+
var getGroundingMetadataSchema = () => z3.object({
|
1060
|
+
webSearchQueries: z3.array(z3.string()).nullish(),
|
1061
|
+
retrievalQueries: z3.array(z3.string()).nullish(),
|
1062
|
+
searchEntryPoint: z3.object({ renderedContent: z3.string() }).nullish(),
|
1063
|
+
groundingChunks: z3.array(
|
1064
|
+
z3.object({
|
1065
|
+
web: z3.object({ uri: z3.string(), title: z3.string() }).nullish(),
|
1066
|
+
retrievedContext: z3.object({ uri: z3.string(), title: z3.string() }).nullish()
|
1067
|
+
})
|
1068
|
+
).nullish(),
|
1069
|
+
groundingSupports: z3.array(
|
1070
|
+
z3.object({
|
1071
|
+
segment: z3.object({
|
1072
|
+
startIndex: z3.number().nullish(),
|
1073
|
+
endIndex: z3.number().nullish(),
|
1074
|
+
text: z3.string().nullish()
|
1075
|
+
}),
|
1076
|
+
segment_text: z3.string().nullish(),
|
1077
|
+
groundingChunkIndices: z3.array(z3.number()).nullish(),
|
1078
|
+
supportChunkIndices: z3.array(z3.number()).nullish(),
|
1079
|
+
confidenceScores: z3.array(z3.number()).nullish(),
|
1080
|
+
confidenceScore: z3.array(z3.number()).nullish()
|
1081
|
+
})
|
1082
|
+
).nullish(),
|
1083
|
+
retrievalMetadata: z3.union([
|
1084
|
+
z3.object({
|
1085
|
+
webDynamicRetrievalScore: z3.number()
|
1086
|
+
}),
|
1087
|
+
z3.object({})
|
1088
|
+
]).nullish()
|
1089
|
+
});
|
1090
|
+
var getContentSchema = () => z3.object({
|
1091
|
+
parts: z3.array(
|
1092
|
+
z3.union([
|
1094
1093
|
// note: order matters since text can be fully empty
|
1095
|
-
|
1096
|
-
functionCall:
|
1097
|
-
name:
|
1098
|
-
args:
|
1094
|
+
z3.object({
|
1095
|
+
functionCall: z3.object({
|
1096
|
+
name: z3.string(),
|
1097
|
+
args: z3.unknown()
|
1099
1098
|
}),
|
1100
|
-
thoughtSignature:
|
1099
|
+
thoughtSignature: z3.string().nullish()
|
1101
1100
|
}),
|
1102
|
-
|
1103
|
-
inlineData:
|
1104
|
-
mimeType:
|
1105
|
-
data:
|
1101
|
+
z3.object({
|
1102
|
+
inlineData: z3.object({
|
1103
|
+
mimeType: z3.string(),
|
1104
|
+
data: z3.string()
|
1106
1105
|
})
|
1107
1106
|
}),
|
1108
|
-
|
1109
|
-
executableCode:
|
1110
|
-
language:
|
1111
|
-
code:
|
1107
|
+
z3.object({
|
1108
|
+
executableCode: z3.object({
|
1109
|
+
language: z3.string(),
|
1110
|
+
code: z3.string()
|
1112
1111
|
}).nullish(),
|
1113
|
-
codeExecutionResult:
|
1114
|
-
outcome:
|
1115
|
-
output:
|
1112
|
+
codeExecutionResult: z3.object({
|
1113
|
+
outcome: z3.string(),
|
1114
|
+
output: z3.string()
|
1116
1115
|
}).nullish(),
|
1117
|
-
text:
|
1118
|
-
thought:
|
1119
|
-
thoughtSignature:
|
1116
|
+
text: z3.string().nullish(),
|
1117
|
+
thought: z3.boolean().nullish(),
|
1118
|
+
thoughtSignature: z3.string().nullish()
|
1120
1119
|
})
|
1121
1120
|
])
|
1122
1121
|
).nullish()
|
1123
1122
|
});
|
1124
|
-
var
|
1125
|
-
category:
|
1126
|
-
probability:
|
1127
|
-
probabilityScore:
|
1128
|
-
severity:
|
1129
|
-
severityScore:
|
1130
|
-
blocked:
|
1123
|
+
var getSafetyRatingSchema = () => z3.object({
|
1124
|
+
category: z3.string().nullish(),
|
1125
|
+
probability: z3.string().nullish(),
|
1126
|
+
probabilityScore: z3.number().nullish(),
|
1127
|
+
severity: z3.string().nullish(),
|
1128
|
+
severityScore: z3.number().nullish(),
|
1129
|
+
blocked: z3.boolean().nullish()
|
1131
1130
|
});
|
1132
|
-
var usageSchema =
|
1133
|
-
cachedContentTokenCount:
|
1134
|
-
thoughtsTokenCount:
|
1135
|
-
promptTokenCount:
|
1136
|
-
candidatesTokenCount:
|
1137
|
-
totalTokenCount:
|
1131
|
+
var usageSchema = z3.object({
|
1132
|
+
cachedContentTokenCount: z3.number().nullish(),
|
1133
|
+
thoughtsTokenCount: z3.number().nullish(),
|
1134
|
+
promptTokenCount: z3.number().nullish(),
|
1135
|
+
candidatesTokenCount: z3.number().nullish(),
|
1136
|
+
totalTokenCount: z3.number().nullish()
|
1138
1137
|
});
|
1139
|
-
var
|
1140
|
-
|
1141
|
-
|
1142
|
-
|
1143
|
-
|
1144
|
-
safetyRatings: z5.array(safetyRatingSchema).nullish(),
|
1145
|
-
groundingMetadata: groundingMetadataSchema.nullish(),
|
1146
|
-
urlContextMetadata: urlContextMetadataSchema.nullish()
|
1138
|
+
var getUrlContextMetadataSchema = () => z3.object({
|
1139
|
+
urlMetadata: z3.array(
|
1140
|
+
z3.object({
|
1141
|
+
retrievedUrl: z3.string(),
|
1142
|
+
urlRetrievalStatus: z3.string()
|
1147
1143
|
})
|
1148
|
-
)
|
1149
|
-
usageMetadata: usageSchema.nullish(),
|
1150
|
-
promptFeedback: z5.object({
|
1151
|
-
blockReason: z5.string().nullish(),
|
1152
|
-
safetyRatings: z5.array(safetyRatingSchema).nullish()
|
1153
|
-
}).nullish()
|
1144
|
+
)
|
1154
1145
|
});
|
1155
|
-
var
|
1156
|
-
|
1157
|
-
|
1158
|
-
|
1159
|
-
|
1160
|
-
|
1161
|
-
|
1162
|
-
|
1146
|
+
var responseSchema = lazySchema3(
|
1147
|
+
() => zodSchema3(
|
1148
|
+
z3.object({
|
1149
|
+
candidates: z3.array(
|
1150
|
+
z3.object({
|
1151
|
+
content: getContentSchema().nullish().or(z3.object({}).strict()),
|
1152
|
+
finishReason: z3.string().nullish(),
|
1153
|
+
safetyRatings: z3.array(getSafetyRatingSchema()).nullish(),
|
1154
|
+
groundingMetadata: getGroundingMetadataSchema().nullish(),
|
1155
|
+
urlContextMetadata: getUrlContextMetadataSchema().nullish()
|
1156
|
+
})
|
1157
|
+
),
|
1158
|
+
usageMetadata: usageSchema.nullish(),
|
1159
|
+
promptFeedback: z3.object({
|
1160
|
+
blockReason: z3.string().nullish(),
|
1161
|
+
safetyRatings: z3.array(getSafetyRatingSchema()).nullish()
|
1162
|
+
}).nullish()
|
1163
1163
|
})
|
1164
|
-
)
|
1165
|
-
|
1166
|
-
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
|
1164
|
+
)
|
1165
|
+
);
|
1166
|
+
var chunkSchema = lazySchema3(
|
1167
|
+
() => zodSchema3(
|
1168
|
+
z3.object({
|
1169
|
+
candidates: z3.array(
|
1170
|
+
z3.object({
|
1171
|
+
content: getContentSchema().nullish(),
|
1172
|
+
finishReason: z3.string().nullish(),
|
1173
|
+
safetyRatings: z3.array(getSafetyRatingSchema()).nullish(),
|
1174
|
+
groundingMetadata: getGroundingMetadataSchema().nullish(),
|
1175
|
+
urlContextMetadata: getUrlContextMetadataSchema().nullish()
|
1176
|
+
})
|
1177
|
+
).nullish(),
|
1178
|
+
usageMetadata: usageSchema.nullish(),
|
1179
|
+
promptFeedback: z3.object({
|
1180
|
+
blockReason: z3.string().nullish(),
|
1181
|
+
safetyRatings: z3.array(getSafetyRatingSchema()).nullish()
|
1182
|
+
}).nullish()
|
1183
|
+
})
|
1184
|
+
)
|
1185
|
+
);
|
1171
1186
|
|
1172
1187
|
// src/tool/code-execution.ts
|
1173
1188
|
import { createProviderDefinedToolFactoryWithOutputSchema } from "@ai-sdk/provider-utils";
|
1174
|
-
import
|
1189
|
+
import * as z4 from "zod/v4";
|
1175
1190
|
var codeExecution = createProviderDefinedToolFactoryWithOutputSchema({
|
1176
1191
|
id: "google.code_execution",
|
1177
1192
|
name: "code_execution",
|
1178
|
-
inputSchema:
|
1179
|
-
language:
|
1180
|
-
code:
|
1193
|
+
inputSchema: z4.object({
|
1194
|
+
language: z4.string().describe("The programming language of the code."),
|
1195
|
+
code: z4.string().describe("The code to be executed.")
|
1181
1196
|
}),
|
1182
|
-
outputSchema:
|
1183
|
-
outcome:
|
1184
|
-
output:
|
1197
|
+
outputSchema: z4.object({
|
1198
|
+
outcome: z4.string().describe('The outcome of the execution (e.g., "OUTCOME_OK").'),
|
1199
|
+
output: z4.string().describe("The output from the code execution.")
|
1185
1200
|
})
|
1186
1201
|
});
|
1187
1202
|
|
1203
|
+
// src/tool/google-search.ts
|
1204
|
+
import {
|
1205
|
+
createProviderDefinedToolFactory,
|
1206
|
+
lazySchema as lazySchema4,
|
1207
|
+
zodSchema as zodSchema4
|
1208
|
+
} from "@ai-sdk/provider-utils";
|
1209
|
+
import * as z5 from "zod/v4";
|
1210
|
+
var googleSearch = createProviderDefinedToolFactory({
|
1211
|
+
id: "google.google_search",
|
1212
|
+
name: "google_search",
|
1213
|
+
inputSchema: lazySchema4(
|
1214
|
+
() => zodSchema4(
|
1215
|
+
z5.object({
|
1216
|
+
mode: z5.enum(["MODE_DYNAMIC", "MODE_UNSPECIFIED"]).default("MODE_UNSPECIFIED"),
|
1217
|
+
dynamicThreshold: z5.number().default(1)
|
1218
|
+
})
|
1219
|
+
)
|
1220
|
+
)
|
1221
|
+
});
|
1222
|
+
|
1223
|
+
// src/tool/url-context.ts
|
1224
|
+
import {
|
1225
|
+
createProviderDefinedToolFactory as createProviderDefinedToolFactory2,
|
1226
|
+
lazySchema as lazySchema5,
|
1227
|
+
zodSchema as zodSchema5
|
1228
|
+
} from "@ai-sdk/provider-utils";
|
1229
|
+
import * as z6 from "zod/v4";
|
1230
|
+
var urlContext = createProviderDefinedToolFactory2({
|
1231
|
+
id: "google.url_context",
|
1232
|
+
name: "url_context",
|
1233
|
+
inputSchema: lazySchema5(() => zodSchema5(z6.object({})))
|
1234
|
+
});
|
1235
|
+
|
1188
1236
|
// src/google-tools.ts
|
1189
1237
|
var googleTools = {
|
1190
1238
|
/**
|
@@ -1211,7 +1259,8 @@ var googleTools = {
|
|
1211
1259
|
};
|
1212
1260
|
export {
|
1213
1261
|
GoogleGenerativeAILanguageModel,
|
1214
|
-
|
1215
|
-
|
1262
|
+
getGroundingMetadataSchema,
|
1263
|
+
getUrlContextMetadataSchema,
|
1264
|
+
googleTools
|
1216
1265
|
};
|
1217
1266
|
//# sourceMappingURL=index.mjs.map
|