@ai-sdk/google 3.0.0-beta.15 → 3.0.0-beta.17

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.
@@ -31,14 +31,15 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  var internal_exports = {};
32
32
  __export(internal_exports, {
33
33
  GoogleGenerativeAILanguageModel: () => GoogleGenerativeAILanguageModel,
34
- googleTools: () => googleTools,
35
- safetyRatingSchema: () => safetyRatingSchema
34
+ getGroundingMetadataSchema: () => getGroundingMetadataSchema,
35
+ getUrlContextMetadataSchema: () => getUrlContextMetadataSchema,
36
+ googleTools: () => googleTools
36
37
  });
37
38
  module.exports = __toCommonJS(internal_exports);
38
39
 
39
40
  // src/google-generative-ai-language-model.ts
40
- var import_provider_utils5 = require("@ai-sdk/provider-utils");
41
- var z5 = __toESM(require("zod/v4"));
41
+ var import_provider_utils4 = require("@ai-sdk/provider-utils");
42
+ var z3 = __toESM(require("zod/v4"));
42
43
 
43
44
  // src/convert-json-schema-to-openapi-schema.ts
44
45
  function convertJSONSchemaToOpenAPISchema(jsonSchema) {
@@ -312,54 +313,71 @@ function getModelPath(modelId) {
312
313
  // src/google-error.ts
313
314
  var import_provider_utils2 = require("@ai-sdk/provider-utils");
314
315
  var z = __toESM(require("zod/v4"));
315
- var googleErrorDataSchema = z.object({
316
- error: z.object({
317
- code: z.number().nullable(),
318
- message: z.string(),
319
- status: z.string()
320
- })
321
- });
316
+ var googleErrorDataSchema = (0, import_provider_utils2.lazySchema)(
317
+ () => (0, import_provider_utils2.zodSchema)(
318
+ z.object({
319
+ error: z.object({
320
+ code: z.number().nullable(),
321
+ message: z.string(),
322
+ status: z.string()
323
+ })
324
+ })
325
+ )
326
+ );
322
327
  var googleFailedResponseHandler = (0, import_provider_utils2.createJsonErrorResponseHandler)({
323
328
  errorSchema: googleErrorDataSchema,
324
329
  errorToMessage: (data) => data.error.message
325
330
  });
326
331
 
327
332
  // src/google-generative-ai-options.ts
333
+ var import_provider_utils3 = require("@ai-sdk/provider-utils");
328
334
  var z2 = __toESM(require("zod/v4"));
329
- var googleGenerativeAIProviderOptions = z2.object({
330
- responseModalities: z2.array(z2.enum(["TEXT", "IMAGE"])).optional(),
331
- thinkingConfig: z2.object({
332
- thinkingBudget: z2.number().optional(),
333
- includeThoughts: z2.boolean().optional()
334
- }).optional(),
335
- /**
336
- Optional.
337
- The name of the cached content used as context to serve the prediction.
338
- Format: cachedContents/{cachedContent}
339
- */
340
- cachedContent: z2.string().optional(),
341
- /**
342
- * Optional. Enable structured output. Default is true.
343
- *
344
- * This is useful when the JSON Schema contains elements that are
345
- * not supported by the OpenAPI schema version that
346
- * Google Generative AI uses. You can use this to disable
347
- * structured outputs if you need to.
348
- */
349
- structuredOutputs: z2.boolean().optional(),
350
- /**
351
- Optional. A list of unique safety settings for blocking unsafe content.
352
- */
353
- safetySettings: z2.array(
335
+ var googleGenerativeAIProviderOptions = (0, import_provider_utils3.lazySchema)(
336
+ () => (0, import_provider_utils3.zodSchema)(
354
337
  z2.object({
355
- category: z2.enum([
356
- "HARM_CATEGORY_UNSPECIFIED",
357
- "HARM_CATEGORY_HATE_SPEECH",
358
- "HARM_CATEGORY_DANGEROUS_CONTENT",
359
- "HARM_CATEGORY_HARASSMENT",
360
- "HARM_CATEGORY_SEXUALLY_EXPLICIT",
361
- "HARM_CATEGORY_CIVIC_INTEGRITY"
362
- ]),
338
+ responseModalities: z2.array(z2.enum(["TEXT", "IMAGE"])).optional(),
339
+ thinkingConfig: z2.object({
340
+ thinkingBudget: z2.number().optional(),
341
+ includeThoughts: z2.boolean().optional()
342
+ }).optional(),
343
+ /**
344
+ * Optional.
345
+ * The name of the cached content used as context to serve the prediction.
346
+ * Format: cachedContents/{cachedContent}
347
+ */
348
+ cachedContent: z2.string().optional(),
349
+ /**
350
+ * Optional. Enable structured output. Default is true.
351
+ *
352
+ * This is useful when the JSON Schema contains elements that are
353
+ * not supported by the OpenAPI schema version that
354
+ * Google Generative AI uses. You can use this to disable
355
+ * structured outputs if you need to.
356
+ */
357
+ structuredOutputs: z2.boolean().optional(),
358
+ /**
359
+ * Optional. A list of unique safety settings for blocking unsafe content.
360
+ */
361
+ safetySettings: z2.array(
362
+ z2.object({
363
+ category: z2.enum([
364
+ "HARM_CATEGORY_UNSPECIFIED",
365
+ "HARM_CATEGORY_HATE_SPEECH",
366
+ "HARM_CATEGORY_DANGEROUS_CONTENT",
367
+ "HARM_CATEGORY_HARASSMENT",
368
+ "HARM_CATEGORY_SEXUALLY_EXPLICIT",
369
+ "HARM_CATEGORY_CIVIC_INTEGRITY"
370
+ ]),
371
+ threshold: z2.enum([
372
+ "HARM_BLOCK_THRESHOLD_UNSPECIFIED",
373
+ "BLOCK_LOW_AND_ABOVE",
374
+ "BLOCK_MEDIUM_AND_ABOVE",
375
+ "BLOCK_ONLY_HIGH",
376
+ "BLOCK_NONE",
377
+ "OFF"
378
+ ])
379
+ })
380
+ ).optional(),
363
381
  threshold: z2.enum([
364
382
  "HARM_BLOCK_THRESHOLD_UNSPECIFIED",
365
383
  "BLOCK_LOW_AND_ABOVE",
@@ -367,41 +385,33 @@ var googleGenerativeAIProviderOptions = z2.object({
367
385
  "BLOCK_ONLY_HIGH",
368
386
  "BLOCK_NONE",
369
387
  "OFF"
370
- ])
388
+ ]).optional(),
389
+ /**
390
+ * Optional. Enables timestamp understanding for audio-only files.
391
+ *
392
+ * https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/audio-understanding
393
+ */
394
+ audioTimestamp: z2.boolean().optional(),
395
+ /**
396
+ * Optional. Defines labels used in billing reports. Available on Vertex AI only.
397
+ *
398
+ * https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/add-labels-to-api-calls
399
+ */
400
+ labels: z2.record(z2.string(), z2.string()).optional(),
401
+ /**
402
+ * Optional. If specified, the media resolution specified will be used.
403
+ *
404
+ * https://ai.google.dev/api/generate-content#MediaResolution
405
+ */
406
+ mediaResolution: z2.enum([
407
+ "MEDIA_RESOLUTION_UNSPECIFIED",
408
+ "MEDIA_RESOLUTION_LOW",
409
+ "MEDIA_RESOLUTION_MEDIUM",
410
+ "MEDIA_RESOLUTION_HIGH"
411
+ ]).optional()
371
412
  })
372
- ).optional(),
373
- threshold: z2.enum([
374
- "HARM_BLOCK_THRESHOLD_UNSPECIFIED",
375
- "BLOCK_LOW_AND_ABOVE",
376
- "BLOCK_MEDIUM_AND_ABOVE",
377
- "BLOCK_ONLY_HIGH",
378
- "BLOCK_NONE",
379
- "OFF"
380
- ]).optional(),
381
- /**
382
- * Optional. Enables timestamp understanding for audio-only files.
383
- *
384
- * https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/audio-understanding
385
- */
386
- audioTimestamp: z2.boolean().optional(),
387
- /**
388
- * Optional. Defines labels used in billing reports. Available on Vertex AI only.
389
- *
390
- * https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/add-labels-to-api-calls
391
- */
392
- labels: z2.record(z2.string(), z2.string()).optional(),
393
- /**
394
- * Optional. If specified, the media resolution specified will be used.
395
- *
396
- * https://ai.google.dev/api/generate-content#MediaResolution
397
- */
398
- mediaResolution: z2.enum([
399
- "MEDIA_RESOLUTION_UNSPECIFIED",
400
- "MEDIA_RESOLUTION_LOW",
401
- "MEDIA_RESOLUTION_MEDIUM",
402
- "MEDIA_RESOLUTION_HIGH"
403
- ]).optional()
404
- });
413
+ )
414
+ );
405
415
 
406
416
  // src/google-prepare-tools.ts
407
417
  var import_provider2 = require("@ai-sdk/provider");
@@ -577,64 +587,6 @@ function mapGoogleGenerativeAIFinishReason({
577
587
  }
578
588
  }
579
589
 
580
- // src/tool/google-search.ts
581
- var import_provider_utils3 = require("@ai-sdk/provider-utils");
582
- var z3 = __toESM(require("zod/v4"));
583
- var groundingChunkSchema = z3.object({
584
- web: z3.object({ uri: z3.string(), title: z3.string() }).nullish(),
585
- retrievedContext: z3.object({ uri: z3.string(), title: z3.string() }).nullish()
586
- });
587
- var groundingMetadataSchema = z3.object({
588
- webSearchQueries: z3.array(z3.string()).nullish(),
589
- retrievalQueries: z3.array(z3.string()).nullish(),
590
- searchEntryPoint: z3.object({ renderedContent: z3.string() }).nullish(),
591
- groundingChunks: z3.array(groundingChunkSchema).nullish(),
592
- groundingSupports: z3.array(
593
- z3.object({
594
- segment: z3.object({
595
- startIndex: z3.number().nullish(),
596
- endIndex: z3.number().nullish(),
597
- text: z3.string().nullish()
598
- }),
599
- segment_text: z3.string().nullish(),
600
- groundingChunkIndices: z3.array(z3.number()).nullish(),
601
- supportChunkIndices: z3.array(z3.number()).nullish(),
602
- confidenceScores: z3.array(z3.number()).nullish(),
603
- confidenceScore: z3.array(z3.number()).nullish()
604
- })
605
- ).nullish(),
606
- retrievalMetadata: z3.union([
607
- z3.object({
608
- webDynamicRetrievalScore: z3.number()
609
- }),
610
- z3.object({})
611
- ]).nullish()
612
- });
613
- var googleSearch = (0, import_provider_utils3.createProviderDefinedToolFactory)({
614
- id: "google.google_search",
615
- name: "google_search",
616
- inputSchema: z3.object({
617
- mode: z3.enum(["MODE_DYNAMIC", "MODE_UNSPECIFIED"]).default("MODE_UNSPECIFIED"),
618
- dynamicThreshold: z3.number().default(1)
619
- })
620
- });
621
-
622
- // src/tool/url-context.ts
623
- var import_provider_utils4 = require("@ai-sdk/provider-utils");
624
- var z4 = __toESM(require("zod/v4"));
625
- var urlMetadataSchema = z4.object({
626
- retrievedUrl: z4.string(),
627
- urlRetrievalStatus: z4.string()
628
- });
629
- var urlContextMetadataSchema = z4.object({
630
- urlMetadata: z4.array(urlMetadataSchema)
631
- });
632
- var urlContext = (0, import_provider_utils4.createProviderDefinedToolFactory)({
633
- id: "google.url_context",
634
- name: "url_context",
635
- inputSchema: z4.object({})
636
- });
637
-
638
590
  // src/google-generative-ai-language-model.ts
639
591
  var GoogleGenerativeAILanguageModel = class {
640
592
  constructor(modelId, config) {
@@ -642,7 +594,7 @@ var GoogleGenerativeAILanguageModel = class {
642
594
  var _a;
643
595
  this.modelId = modelId;
644
596
  this.config = config;
645
- this.generateId = (_a = config.generateId) != null ? _a : import_provider_utils5.generateId;
597
+ this.generateId = (_a = config.generateId) != null ? _a : import_provider_utils4.generateId;
646
598
  }
647
599
  get provider() {
648
600
  return this.config.provider;
@@ -668,7 +620,7 @@ var GoogleGenerativeAILanguageModel = class {
668
620
  }) {
669
621
  var _a, _b;
670
622
  const warnings = [];
671
- const googleOptions = await (0, import_provider_utils5.parseProviderOptions)({
623
+ const googleOptions = await (0, import_provider_utils4.parseProviderOptions)({
672
624
  provider: "google",
673
625
  providerOptions,
674
626
  schema: googleGenerativeAIProviderOptions
@@ -736,22 +688,22 @@ var GoogleGenerativeAILanguageModel = class {
736
688
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
737
689
  const { args, warnings } = await this.getArgs(options);
738
690
  const body = JSON.stringify(args);
739
- const mergedHeaders = (0, import_provider_utils5.combineHeaders)(
740
- await (0, import_provider_utils5.resolve)(this.config.headers),
691
+ const mergedHeaders = (0, import_provider_utils4.combineHeaders)(
692
+ await (0, import_provider_utils4.resolve)(this.config.headers),
741
693
  options.headers
742
694
  );
743
695
  const {
744
696
  responseHeaders,
745
697
  value: response,
746
698
  rawValue: rawResponse
747
- } = await (0, import_provider_utils5.postJsonToApi)({
699
+ } = await (0, import_provider_utils4.postJsonToApi)({
748
700
  url: `${this.config.baseURL}/${getModelPath(
749
701
  this.modelId
750
702
  )}:generateContent`,
751
703
  headers: mergedHeaders,
752
704
  body: args,
753
705
  failedResponseHandler: googleFailedResponseHandler,
754
- successfulResponseHandler: (0, import_provider_utils5.createJsonResponseHandler)(responseSchema),
706
+ successfulResponseHandler: (0, import_provider_utils4.createJsonResponseHandler)(responseSchema),
755
707
  abortSignal: options.abortSignal,
756
708
  fetch: this.config.fetch
757
709
  });
@@ -847,18 +799,18 @@ var GoogleGenerativeAILanguageModel = class {
847
799
  async doStream(options) {
848
800
  const { args, warnings } = await this.getArgs(options);
849
801
  const body = JSON.stringify(args);
850
- const headers = (0, import_provider_utils5.combineHeaders)(
851
- await (0, import_provider_utils5.resolve)(this.config.headers),
802
+ const headers = (0, import_provider_utils4.combineHeaders)(
803
+ await (0, import_provider_utils4.resolve)(this.config.headers),
852
804
  options.headers
853
805
  );
854
- const { responseHeaders, value: response } = await (0, import_provider_utils5.postJsonToApi)({
806
+ const { responseHeaders, value: response } = await (0, import_provider_utils4.postJsonToApi)({
855
807
  url: `${this.config.baseURL}/${getModelPath(
856
808
  this.modelId
857
809
  )}:streamGenerateContent?alt=sse`,
858
810
  headers,
859
811
  body: args,
860
812
  failedResponseHandler: googleFailedResponseHandler,
861
- successfulResponseHandler: (0, import_provider_utils5.createEventSourceResponseHandler)(chunkSchema),
813
+ successfulResponseHandler: (0, import_provider_utils4.createEventSourceResponseHandler)(chunkSchema),
862
814
  abortSignal: options.abortSignal,
863
815
  fetch: this.config.fetch
864
816
  });
@@ -1130,103 +1082,175 @@ function extractSources({
1130
1082
  title: chunk.web.title
1131
1083
  }));
1132
1084
  }
1133
- var contentSchema = z5.object({
1134
- parts: z5.array(
1135
- z5.union([
1085
+ var getGroundingMetadataSchema = () => z3.object({
1086
+ webSearchQueries: z3.array(z3.string()).nullish(),
1087
+ retrievalQueries: z3.array(z3.string()).nullish(),
1088
+ searchEntryPoint: z3.object({ renderedContent: z3.string() }).nullish(),
1089
+ groundingChunks: z3.array(
1090
+ z3.object({
1091
+ web: z3.object({ uri: z3.string(), title: z3.string() }).nullish(),
1092
+ retrievedContext: z3.object({ uri: z3.string(), title: z3.string() }).nullish()
1093
+ })
1094
+ ).nullish(),
1095
+ groundingSupports: z3.array(
1096
+ z3.object({
1097
+ segment: z3.object({
1098
+ startIndex: z3.number().nullish(),
1099
+ endIndex: z3.number().nullish(),
1100
+ text: z3.string().nullish()
1101
+ }),
1102
+ segment_text: z3.string().nullish(),
1103
+ groundingChunkIndices: z3.array(z3.number()).nullish(),
1104
+ supportChunkIndices: z3.array(z3.number()).nullish(),
1105
+ confidenceScores: z3.array(z3.number()).nullish(),
1106
+ confidenceScore: z3.array(z3.number()).nullish()
1107
+ })
1108
+ ).nullish(),
1109
+ retrievalMetadata: z3.union([
1110
+ z3.object({
1111
+ webDynamicRetrievalScore: z3.number()
1112
+ }),
1113
+ z3.object({})
1114
+ ]).nullish()
1115
+ });
1116
+ var getContentSchema = () => z3.object({
1117
+ parts: z3.array(
1118
+ z3.union([
1136
1119
  // note: order matters since text can be fully empty
1137
- z5.object({
1138
- functionCall: z5.object({
1139
- name: z5.string(),
1140
- args: z5.unknown()
1120
+ z3.object({
1121
+ functionCall: z3.object({
1122
+ name: z3.string(),
1123
+ args: z3.unknown()
1141
1124
  }),
1142
- thoughtSignature: z5.string().nullish()
1125
+ thoughtSignature: z3.string().nullish()
1143
1126
  }),
1144
- z5.object({
1145
- inlineData: z5.object({
1146
- mimeType: z5.string(),
1147
- data: z5.string()
1127
+ z3.object({
1128
+ inlineData: z3.object({
1129
+ mimeType: z3.string(),
1130
+ data: z3.string()
1148
1131
  })
1149
1132
  }),
1150
- z5.object({
1151
- executableCode: z5.object({
1152
- language: z5.string(),
1153
- code: z5.string()
1133
+ z3.object({
1134
+ executableCode: z3.object({
1135
+ language: z3.string(),
1136
+ code: z3.string()
1154
1137
  }).nullish(),
1155
- codeExecutionResult: z5.object({
1156
- outcome: z5.string(),
1157
- output: z5.string()
1138
+ codeExecutionResult: z3.object({
1139
+ outcome: z3.string(),
1140
+ output: z3.string()
1158
1141
  }).nullish(),
1159
- text: z5.string().nullish(),
1160
- thought: z5.boolean().nullish(),
1161
- thoughtSignature: z5.string().nullish()
1142
+ text: z3.string().nullish(),
1143
+ thought: z3.boolean().nullish(),
1144
+ thoughtSignature: z3.string().nullish()
1162
1145
  })
1163
1146
  ])
1164
1147
  ).nullish()
1165
1148
  });
1166
- var safetyRatingSchema = z5.object({
1167
- category: z5.string().nullish(),
1168
- probability: z5.string().nullish(),
1169
- probabilityScore: z5.number().nullish(),
1170
- severity: z5.string().nullish(),
1171
- severityScore: z5.number().nullish(),
1172
- blocked: z5.boolean().nullish()
1149
+ var getSafetyRatingSchema = () => z3.object({
1150
+ category: z3.string().nullish(),
1151
+ probability: z3.string().nullish(),
1152
+ probabilityScore: z3.number().nullish(),
1153
+ severity: z3.string().nullish(),
1154
+ severityScore: z3.number().nullish(),
1155
+ blocked: z3.boolean().nullish()
1173
1156
  });
1174
- var usageSchema = z5.object({
1175
- cachedContentTokenCount: z5.number().nullish(),
1176
- thoughtsTokenCount: z5.number().nullish(),
1177
- promptTokenCount: z5.number().nullish(),
1178
- candidatesTokenCount: z5.number().nullish(),
1179
- totalTokenCount: z5.number().nullish()
1157
+ var usageSchema = z3.object({
1158
+ cachedContentTokenCount: z3.number().nullish(),
1159
+ thoughtsTokenCount: z3.number().nullish(),
1160
+ promptTokenCount: z3.number().nullish(),
1161
+ candidatesTokenCount: z3.number().nullish(),
1162
+ totalTokenCount: z3.number().nullish()
1180
1163
  });
1181
- var responseSchema = z5.object({
1182
- candidates: z5.array(
1183
- z5.object({
1184
- content: contentSchema.nullish().or(z5.object({}).strict()),
1185
- finishReason: z5.string().nullish(),
1186
- safetyRatings: z5.array(safetyRatingSchema).nullish(),
1187
- groundingMetadata: groundingMetadataSchema.nullish(),
1188
- urlContextMetadata: urlContextMetadataSchema.nullish()
1164
+ var getUrlContextMetadataSchema = () => z3.object({
1165
+ urlMetadata: z3.array(
1166
+ z3.object({
1167
+ retrievedUrl: z3.string(),
1168
+ urlRetrievalStatus: z3.string()
1189
1169
  })
1190
- ),
1191
- usageMetadata: usageSchema.nullish(),
1192
- promptFeedback: z5.object({
1193
- blockReason: z5.string().nullish(),
1194
- safetyRatings: z5.array(safetyRatingSchema).nullish()
1195
- }).nullish()
1170
+ )
1196
1171
  });
1197
- var chunkSchema = z5.object({
1198
- candidates: z5.array(
1199
- z5.object({
1200
- content: contentSchema.nullish(),
1201
- finishReason: z5.string().nullish(),
1202
- safetyRatings: z5.array(safetyRatingSchema).nullish(),
1203
- groundingMetadata: groundingMetadataSchema.nullish(),
1204
- urlContextMetadata: urlContextMetadataSchema.nullish()
1172
+ var responseSchema = (0, import_provider_utils4.lazySchema)(
1173
+ () => (0, import_provider_utils4.zodSchema)(
1174
+ z3.object({
1175
+ candidates: z3.array(
1176
+ z3.object({
1177
+ content: getContentSchema().nullish().or(z3.object({}).strict()),
1178
+ finishReason: z3.string().nullish(),
1179
+ safetyRatings: z3.array(getSafetyRatingSchema()).nullish(),
1180
+ groundingMetadata: getGroundingMetadataSchema().nullish(),
1181
+ urlContextMetadata: getUrlContextMetadataSchema().nullish()
1182
+ })
1183
+ ),
1184
+ usageMetadata: usageSchema.nullish(),
1185
+ promptFeedback: z3.object({
1186
+ blockReason: z3.string().nullish(),
1187
+ safetyRatings: z3.array(getSafetyRatingSchema()).nullish()
1188
+ }).nullish()
1205
1189
  })
1206
- ).nullish(),
1207
- usageMetadata: usageSchema.nullish(),
1208
- promptFeedback: z5.object({
1209
- blockReason: z5.string().nullish(),
1210
- safetyRatings: z5.array(safetyRatingSchema).nullish()
1211
- }).nullish()
1212
- });
1190
+ )
1191
+ );
1192
+ var chunkSchema = (0, import_provider_utils4.lazySchema)(
1193
+ () => (0, import_provider_utils4.zodSchema)(
1194
+ z3.object({
1195
+ candidates: z3.array(
1196
+ z3.object({
1197
+ content: getContentSchema().nullish(),
1198
+ finishReason: z3.string().nullish(),
1199
+ safetyRatings: z3.array(getSafetyRatingSchema()).nullish(),
1200
+ groundingMetadata: getGroundingMetadataSchema().nullish(),
1201
+ urlContextMetadata: getUrlContextMetadataSchema().nullish()
1202
+ })
1203
+ ).nullish(),
1204
+ usageMetadata: usageSchema.nullish(),
1205
+ promptFeedback: z3.object({
1206
+ blockReason: z3.string().nullish(),
1207
+ safetyRatings: z3.array(getSafetyRatingSchema()).nullish()
1208
+ }).nullish()
1209
+ })
1210
+ )
1211
+ );
1213
1212
 
1214
1213
  // src/tool/code-execution.ts
1215
- var import_provider_utils6 = require("@ai-sdk/provider-utils");
1216
- var z6 = __toESM(require("zod/v4"));
1217
- var codeExecution = (0, import_provider_utils6.createProviderDefinedToolFactoryWithOutputSchema)({
1214
+ var import_provider_utils5 = require("@ai-sdk/provider-utils");
1215
+ var z4 = __toESM(require("zod/v4"));
1216
+ var codeExecution = (0, import_provider_utils5.createProviderDefinedToolFactoryWithOutputSchema)({
1218
1217
  id: "google.code_execution",
1219
1218
  name: "code_execution",
1220
- inputSchema: z6.object({
1221
- language: z6.string().describe("The programming language of the code."),
1222
- code: z6.string().describe("The code to be executed.")
1219
+ inputSchema: z4.object({
1220
+ language: z4.string().describe("The programming language of the code."),
1221
+ code: z4.string().describe("The code to be executed.")
1223
1222
  }),
1224
- outputSchema: z6.object({
1225
- outcome: z6.string().describe('The outcome of the execution (e.g., "OUTCOME_OK").'),
1226
- output: z6.string().describe("The output from the code execution.")
1223
+ outputSchema: z4.object({
1224
+ outcome: z4.string().describe('The outcome of the execution (e.g., "OUTCOME_OK").'),
1225
+ output: z4.string().describe("The output from the code execution.")
1227
1226
  })
1228
1227
  });
1229
1228
 
1229
+ // src/tool/google-search.ts
1230
+ var import_provider_utils6 = require("@ai-sdk/provider-utils");
1231
+ var z5 = __toESM(require("zod/v4"));
1232
+ var googleSearch = (0, import_provider_utils6.createProviderDefinedToolFactory)({
1233
+ id: "google.google_search",
1234
+ name: "google_search",
1235
+ inputSchema: (0, import_provider_utils6.lazySchema)(
1236
+ () => (0, import_provider_utils6.zodSchema)(
1237
+ z5.object({
1238
+ mode: z5.enum(["MODE_DYNAMIC", "MODE_UNSPECIFIED"]).default("MODE_UNSPECIFIED"),
1239
+ dynamicThreshold: z5.number().default(1)
1240
+ })
1241
+ )
1242
+ )
1243
+ });
1244
+
1245
+ // src/tool/url-context.ts
1246
+ var import_provider_utils7 = require("@ai-sdk/provider-utils");
1247
+ var z6 = __toESM(require("zod/v4"));
1248
+ var urlContext = (0, import_provider_utils7.createProviderDefinedToolFactory)({
1249
+ id: "google.url_context",
1250
+ name: "url_context",
1251
+ inputSchema: (0, import_provider_utils7.lazySchema)(() => (0, import_provider_utils7.zodSchema)(z6.object({})))
1252
+ });
1253
+
1230
1254
  // src/google-tools.ts
1231
1255
  var googleTools = {
1232
1256
  /**
@@ -1254,7 +1278,8 @@ var googleTools = {
1254
1278
  // Annotate the CommonJS export names for ESM import in node:
1255
1279
  0 && (module.exports = {
1256
1280
  GoogleGenerativeAILanguageModel,
1257
- googleTools,
1258
- safetyRatingSchema
1281
+ getGroundingMetadataSchema,
1282
+ getUrlContextMetadataSchema,
1283
+ googleTools
1259
1284
  });
1260
1285
  //# sourceMappingURL=index.js.map