@ai-sdk/google 2.1.0-beta.9 → 3.0.0-beta.15

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 CHANGED
@@ -1,5 +1,56 @@
1
1
  # @ai-sdk/google
2
2
 
3
+ ## 3.0.0-beta.15
4
+
5
+ ### Patch Changes
6
+
7
+ - 95f65c2: chore: use import \* from zod/v4
8
+ - Updated dependencies [95f65c2]
9
+ - Updated dependencies [95f65c2]
10
+ - @ai-sdk/provider-utils@4.0.0-beta.11
11
+
12
+ ## 3.0.0-beta.14
13
+
14
+ ### Major Changes
15
+
16
+ - dee8b05: ai SDK 6 beta
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies [dee8b05]
21
+ - @ai-sdk/provider@3.0.0-beta.6
22
+ - @ai-sdk/provider-utils@4.0.0-beta.10
23
+
24
+ ## 2.1.0-beta.13
25
+
26
+ ### Patch Changes
27
+
28
+ - Updated dependencies [521c537]
29
+ - @ai-sdk/provider-utils@3.1.0-beta.9
30
+
31
+ ## 2.1.0-beta.12
32
+
33
+ ### Patch Changes
34
+
35
+ - Updated dependencies [e06565c]
36
+ - @ai-sdk/provider-utils@3.1.0-beta.8
37
+
38
+ ## 2.1.0-beta.11
39
+
40
+ ### Patch Changes
41
+
42
+ - 9a728c8: support latest gemini model id
43
+
44
+ ## 2.1.0-beta.10
45
+
46
+ ### Patch Changes
47
+
48
+ - e8109d3: feat: tool execution approval
49
+ - Updated dependencies [046aa3b]
50
+ - Updated dependencies [e8109d3]
51
+ - @ai-sdk/provider@2.1.0-beta.5
52
+ - @ai-sdk/provider-utils@3.1.0-beta.7
53
+
3
54
  ## 2.1.0-beta.9
4
55
 
5
56
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { z } from 'zod/v4';
1
+ import * as z from 'zod/v4';
2
2
  import { ProviderV3, LanguageModelV3, ImageModelV3, EmbeddingModelV3 } from '@ai-sdk/provider';
3
3
  import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
4
4
  import { FetchFunction } from '@ai-sdk/provider-utils';
@@ -12,7 +12,7 @@ declare const googleErrorDataSchema: z.ZodObject<{
12
12
  }, z.core.$strip>;
13
13
  type GoogleErrorData = z.infer<typeof googleErrorDataSchema>;
14
14
 
15
- type GoogleGenerativeAIModelId = 'gemini-1.5-flash' | 'gemini-1.5-flash-latest' | 'gemini-1.5-flash-001' | 'gemini-1.5-flash-002' | 'gemini-1.5-flash-8b' | 'gemini-1.5-flash-8b-latest' | 'gemini-1.5-flash-8b-001' | 'gemini-1.5-pro' | 'gemini-1.5-pro-latest' | 'gemini-1.5-pro-001' | 'gemini-1.5-pro-002' | 'gemini-2.0-flash' | 'gemini-2.0-flash-001' | 'gemini-2.0-flash-live-001' | 'gemini-2.0-flash-lite' | 'gemini-2.0-pro-exp-02-05' | 'gemini-2.0-flash-thinking-exp-01-21' | 'gemini-2.0-flash-exp' | 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image-preview' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-preview-04-17' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-2.5-pro-exp-03-25' | 'gemini-exp-1206' | 'gemma-3-12b-it' | 'gemma-3-27b-it' | (string & {});
15
+ type GoogleGenerativeAIModelId = 'gemini-1.5-flash' | 'gemini-1.5-flash-latest' | 'gemini-1.5-flash-001' | 'gemini-1.5-flash-002' | 'gemini-1.5-flash-8b' | 'gemini-1.5-flash-8b-latest' | 'gemini-1.5-flash-8b-001' | 'gemini-1.5-pro' | 'gemini-1.5-pro-latest' | 'gemini-1.5-pro-001' | 'gemini-1.5-pro-002' | 'gemini-2.0-flash' | 'gemini-2.0-flash-001' | 'gemini-2.0-flash-live-001' | 'gemini-2.0-flash-lite' | 'gemini-2.0-pro-exp-02-05' | 'gemini-2.0-flash-thinking-exp-01-21' | 'gemini-2.0-flash-exp' | 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image-preview' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-preview-04-17' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-pro-latest' | 'gemini-flash-latest' | 'gemini-flash-lite-latest' | 'gemini-2.5-pro-exp-03-25' | 'gemini-exp-1206' | 'gemma-3-12b-it' | 'gemma-3-27b-it' | (string & {});
16
16
  declare const googleGenerativeAIProviderOptions: z.ZodObject<{
17
17
  responseModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
18
18
  TEXT: "TEXT";
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { z } from 'zod/v4';
1
+ import * as z from 'zod/v4';
2
2
  import { ProviderV3, LanguageModelV3, ImageModelV3, EmbeddingModelV3 } from '@ai-sdk/provider';
3
3
  import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
4
4
  import { FetchFunction } from '@ai-sdk/provider-utils';
@@ -12,7 +12,7 @@ declare const googleErrorDataSchema: z.ZodObject<{
12
12
  }, z.core.$strip>;
13
13
  type GoogleErrorData = z.infer<typeof googleErrorDataSchema>;
14
14
 
15
- type GoogleGenerativeAIModelId = 'gemini-1.5-flash' | 'gemini-1.5-flash-latest' | 'gemini-1.5-flash-001' | 'gemini-1.5-flash-002' | 'gemini-1.5-flash-8b' | 'gemini-1.5-flash-8b-latest' | 'gemini-1.5-flash-8b-001' | 'gemini-1.5-pro' | 'gemini-1.5-pro-latest' | 'gemini-1.5-pro-001' | 'gemini-1.5-pro-002' | 'gemini-2.0-flash' | 'gemini-2.0-flash-001' | 'gemini-2.0-flash-live-001' | 'gemini-2.0-flash-lite' | 'gemini-2.0-pro-exp-02-05' | 'gemini-2.0-flash-thinking-exp-01-21' | 'gemini-2.0-flash-exp' | 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image-preview' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-preview-04-17' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-2.5-pro-exp-03-25' | 'gemini-exp-1206' | 'gemma-3-12b-it' | 'gemma-3-27b-it' | (string & {});
15
+ type GoogleGenerativeAIModelId = 'gemini-1.5-flash' | 'gemini-1.5-flash-latest' | 'gemini-1.5-flash-001' | 'gemini-1.5-flash-002' | 'gemini-1.5-flash-8b' | 'gemini-1.5-flash-8b-latest' | 'gemini-1.5-flash-8b-001' | 'gemini-1.5-pro' | 'gemini-1.5-pro-latest' | 'gemini-1.5-pro-001' | 'gemini-1.5-pro-002' | 'gemini-2.0-flash' | 'gemini-2.0-flash-001' | 'gemini-2.0-flash-live-001' | 'gemini-2.0-flash-lite' | 'gemini-2.0-pro-exp-02-05' | 'gemini-2.0-flash-thinking-exp-01-21' | 'gemini-2.0-flash-exp' | 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image-preview' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-preview-04-17' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-pro-latest' | 'gemini-flash-latest' | 'gemini-flash-lite-latest' | 'gemini-2.5-pro-exp-03-25' | 'gemini-exp-1206' | 'gemma-3-12b-it' | 'gemma-3-27b-it' | (string & {});
16
16
  declare const googleGenerativeAIProviderOptions: z.ZodObject<{
17
17
  responseModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
18
18
  TEXT: "TEXT";
package/dist/index.js CHANGED
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
 
20
30
  // src/index.ts
@@ -30,21 +40,21 @@ module.exports = __toCommonJS(src_exports);
30
40
  var import_provider_utils9 = require("@ai-sdk/provider-utils");
31
41
 
32
42
  // src/version.ts
33
- var VERSION = true ? "2.1.0-beta.9" : "0.0.0-test";
43
+ var VERSION = true ? "3.0.0-beta.15" : "0.0.0-test";
34
44
 
35
45
  // src/google-generative-ai-embedding-model.ts
36
46
  var import_provider = require("@ai-sdk/provider");
37
47
  var import_provider_utils2 = require("@ai-sdk/provider-utils");
38
- var import_v43 = require("zod/v4");
48
+ var z3 = __toESM(require("zod/v4"));
39
49
 
40
50
  // src/google-error.ts
41
51
  var import_provider_utils = require("@ai-sdk/provider-utils");
42
- var import_v4 = require("zod/v4");
43
- var googleErrorDataSchema = import_v4.z.object({
44
- error: import_v4.z.object({
45
- code: import_v4.z.number().nullable(),
46
- message: import_v4.z.string(),
47
- status: import_v4.z.string()
52
+ var z = __toESM(require("zod/v4"));
53
+ var googleErrorDataSchema = z.object({
54
+ error: z.object({
55
+ code: z.number().nullable(),
56
+ message: z.string(),
57
+ status: z.string()
48
58
  })
49
59
  });
50
60
  var googleFailedResponseHandler = (0, import_provider_utils.createJsonErrorResponseHandler)({
@@ -53,13 +63,13 @@ var googleFailedResponseHandler = (0, import_provider_utils.createJsonErrorRespo
53
63
  });
54
64
 
55
65
  // src/google-generative-ai-embedding-options.ts
56
- var import_v42 = require("zod/v4");
57
- var googleGenerativeAIEmbeddingProviderOptions = import_v42.z.object({
66
+ var z2 = __toESM(require("zod/v4"));
67
+ var googleGenerativeAIEmbeddingProviderOptions = z2.object({
58
68
  /**
59
69
  * Optional. Optional reduced dimension for the output embedding.
60
70
  * If set, excessive values in the output embedding are truncated from the end.
61
71
  */
62
- outputDimensionality: import_v42.z.number().optional(),
72
+ outputDimensionality: z2.number().optional(),
63
73
  /**
64
74
  * Optional. Specifies the task type for generating embeddings.
65
75
  * Supported task types:
@@ -72,7 +82,7 @@ var googleGenerativeAIEmbeddingProviderOptions = import_v42.z.object({
72
82
  * - FACT_VERIFICATION: Optimized for verifying factual information.
73
83
  * - CODE_RETRIEVAL_QUERY: Optimized for retrieving code blocks based on natural language queries.
74
84
  */
75
- taskType: import_v42.z.enum([
85
+ taskType: z2.enum([
76
86
  "SEMANTIC_SIMILARITY",
77
87
  "CLASSIFICATION",
78
88
  "CLUSTERING",
@@ -177,16 +187,16 @@ var GoogleGenerativeAIEmbeddingModel = class {
177
187
  };
178
188
  }
179
189
  };
180
- var googleGenerativeAITextEmbeddingResponseSchema = import_v43.z.object({
181
- embeddings: import_v43.z.array(import_v43.z.object({ values: import_v43.z.array(import_v43.z.number()) }))
190
+ var googleGenerativeAITextEmbeddingResponseSchema = z3.object({
191
+ embeddings: z3.array(z3.object({ values: z3.array(z3.number()) }))
182
192
  });
183
- var googleGenerativeAISingleEmbeddingResponseSchema = import_v43.z.object({
184
- embedding: import_v43.z.object({ values: import_v43.z.array(import_v43.z.number()) })
193
+ var googleGenerativeAISingleEmbeddingResponseSchema = z3.object({
194
+ embedding: z3.object({ values: z3.array(z3.number()) })
185
195
  });
186
196
 
187
197
  // src/google-generative-ai-language-model.ts
188
198
  var import_provider_utils6 = require("@ai-sdk/provider-utils");
189
- var import_v47 = require("zod/v4");
199
+ var z7 = __toESM(require("zod/v4"));
190
200
 
191
201
  // src/convert-json-schema-to-openapi-schema.ts
192
202
  function convertJSONSchemaToOpenAPISchema(jsonSchema) {
@@ -286,7 +296,7 @@ function isEmptyObjectSchema(jsonSchema) {
286
296
  var import_provider2 = require("@ai-sdk/provider");
287
297
  var import_provider_utils3 = require("@ai-sdk/provider-utils");
288
298
  function convertToGoogleGenerativeAIMessages(prompt, options) {
289
- var _a;
299
+ var _a, _b;
290
300
  const systemInstructionParts = [];
291
301
  const contents = [];
292
302
  let systemMessagesAllowed = true;
@@ -338,12 +348,12 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
338
348
  contents.push({
339
349
  role: "model",
340
350
  parts: content.map((part) => {
341
- var _a2, _b, _c, _d, _e, _f;
351
+ var _a2, _b2, _c, _d, _e, _f;
342
352
  switch (part.type) {
343
353
  case "text": {
344
354
  return part.text.length === 0 ? void 0 : {
345
355
  text: part.text,
346
- thoughtSignature: (_b = (_a2 = part.providerOptions) == null ? void 0 : _a2.google) == null ? void 0 : _b.thoughtSignature
356
+ thoughtSignature: (_b2 = (_a2 = part.providerOptions) == null ? void 0 : _a2.google) == null ? void 0 : _b2.thoughtSignature
347
357
  };
348
358
  }
349
359
  case "reasoning": {
@@ -428,7 +438,7 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
428
438
  name: part.toolName,
429
439
  response: {
430
440
  name: part.toolName,
431
- content: output.value
441
+ content: output.type === "execution-denied" ? (_b = output.reason) != null ? _b : "Tool execution denied." : output.value
432
442
  }
433
443
  }
434
444
  });
@@ -458,19 +468,19 @@ function getModelPath(modelId) {
458
468
  }
459
469
 
460
470
  // src/google-generative-ai-options.ts
461
- var import_v44 = require("zod/v4");
462
- var googleGenerativeAIProviderOptions = import_v44.z.object({
463
- responseModalities: import_v44.z.array(import_v44.z.enum(["TEXT", "IMAGE"])).optional(),
464
- thinkingConfig: import_v44.z.object({
465
- thinkingBudget: import_v44.z.number().optional(),
466
- includeThoughts: import_v44.z.boolean().optional()
471
+ var z4 = __toESM(require("zod/v4"));
472
+ var googleGenerativeAIProviderOptions = z4.object({
473
+ responseModalities: z4.array(z4.enum(["TEXT", "IMAGE"])).optional(),
474
+ thinkingConfig: z4.object({
475
+ thinkingBudget: z4.number().optional(),
476
+ includeThoughts: z4.boolean().optional()
467
477
  }).optional(),
468
478
  /**
469
479
  Optional.
470
480
  The name of the cached content used as context to serve the prediction.
471
481
  Format: cachedContents/{cachedContent}
472
482
  */
473
- cachedContent: import_v44.z.string().optional(),
483
+ cachedContent: z4.string().optional(),
474
484
  /**
475
485
  * Optional. Enable structured output. Default is true.
476
486
  *
@@ -479,13 +489,13 @@ var googleGenerativeAIProviderOptions = import_v44.z.object({
479
489
  * Google Generative AI uses. You can use this to disable
480
490
  * structured outputs if you need to.
481
491
  */
482
- structuredOutputs: import_v44.z.boolean().optional(),
492
+ structuredOutputs: z4.boolean().optional(),
483
493
  /**
484
494
  Optional. A list of unique safety settings for blocking unsafe content.
485
495
  */
486
- safetySettings: import_v44.z.array(
487
- import_v44.z.object({
488
- category: import_v44.z.enum([
496
+ safetySettings: z4.array(
497
+ z4.object({
498
+ category: z4.enum([
489
499
  "HARM_CATEGORY_UNSPECIFIED",
490
500
  "HARM_CATEGORY_HATE_SPEECH",
491
501
  "HARM_CATEGORY_DANGEROUS_CONTENT",
@@ -493,7 +503,7 @@ var googleGenerativeAIProviderOptions = import_v44.z.object({
493
503
  "HARM_CATEGORY_SEXUALLY_EXPLICIT",
494
504
  "HARM_CATEGORY_CIVIC_INTEGRITY"
495
505
  ]),
496
- threshold: import_v44.z.enum([
506
+ threshold: z4.enum([
497
507
  "HARM_BLOCK_THRESHOLD_UNSPECIFIED",
498
508
  "BLOCK_LOW_AND_ABOVE",
499
509
  "BLOCK_MEDIUM_AND_ABOVE",
@@ -503,7 +513,7 @@ var googleGenerativeAIProviderOptions = import_v44.z.object({
503
513
  ])
504
514
  })
505
515
  ).optional(),
506
- threshold: import_v44.z.enum([
516
+ threshold: z4.enum([
507
517
  "HARM_BLOCK_THRESHOLD_UNSPECIFIED",
508
518
  "BLOCK_LOW_AND_ABOVE",
509
519
  "BLOCK_MEDIUM_AND_ABOVE",
@@ -516,19 +526,19 @@ var googleGenerativeAIProviderOptions = import_v44.z.object({
516
526
  *
517
527
  * https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/audio-understanding
518
528
  */
519
- audioTimestamp: import_v44.z.boolean().optional(),
529
+ audioTimestamp: z4.boolean().optional(),
520
530
  /**
521
531
  * Optional. Defines labels used in billing reports. Available on Vertex AI only.
522
532
  *
523
533
  * https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/add-labels-to-api-calls
524
534
  */
525
- labels: import_v44.z.record(import_v44.z.string(), import_v44.z.string()).optional(),
535
+ labels: z4.record(z4.string(), z4.string()).optional(),
526
536
  /**
527
537
  * Optional. If specified, the media resolution specified will be used.
528
538
  *
529
539
  * https://ai.google.dev/api/generate-content#MediaResolution
530
540
  */
531
- mediaResolution: import_v44.z.enum([
541
+ mediaResolution: z4.enum([
532
542
  "MEDIA_RESOLUTION_UNSPECIFIED",
533
543
  "MEDIA_RESOLUTION_LOW",
534
544
  "MEDIA_RESOLUTION_MEDIUM",
@@ -546,7 +556,12 @@ function prepareTools({
546
556
  var _a;
547
557
  tools = (tools == null ? void 0 : tools.length) ? tools : void 0;
548
558
  const toolWarnings = [];
549
- const isGemini2 = modelId.includes("gemini-2");
559
+ const isLatest = [
560
+ "gemini-flash-latest",
561
+ "gemini-flash-lite-latest",
562
+ "gemini-pro-latest"
563
+ ].some((id) => id === modelId);
564
+ const isGemini2 = modelId.includes("gemini-2") || isLatest;
550
565
  const supportsDynamicRetrieval = modelId.includes("gemini-1.5-flash") && !modelId.includes("-8b");
551
566
  if (tools == null) {
552
567
  return { tools: void 0, toolConfig: void 0, toolWarnings };
@@ -707,60 +722,60 @@ function mapGoogleGenerativeAIFinishReason({
707
722
 
708
723
  // src/tool/google-search.ts
709
724
  var import_provider_utils4 = require("@ai-sdk/provider-utils");
710
- var import_v45 = require("zod/v4");
711
- var groundingChunkSchema = import_v45.z.object({
712
- web: import_v45.z.object({ uri: import_v45.z.string(), title: import_v45.z.string() }).nullish(),
713
- retrievedContext: import_v45.z.object({ uri: import_v45.z.string(), title: import_v45.z.string() }).nullish()
725
+ var z5 = __toESM(require("zod/v4"));
726
+ var groundingChunkSchema = z5.object({
727
+ web: z5.object({ uri: z5.string(), title: z5.string() }).nullish(),
728
+ retrievedContext: z5.object({ uri: z5.string(), title: z5.string() }).nullish()
714
729
  });
715
- var groundingMetadataSchema = import_v45.z.object({
716
- webSearchQueries: import_v45.z.array(import_v45.z.string()).nullish(),
717
- retrievalQueries: import_v45.z.array(import_v45.z.string()).nullish(),
718
- searchEntryPoint: import_v45.z.object({ renderedContent: import_v45.z.string() }).nullish(),
719
- groundingChunks: import_v45.z.array(groundingChunkSchema).nullish(),
720
- groundingSupports: import_v45.z.array(
721
- import_v45.z.object({
722
- segment: import_v45.z.object({
723
- startIndex: import_v45.z.number().nullish(),
724
- endIndex: import_v45.z.number().nullish(),
725
- text: import_v45.z.string().nullish()
730
+ var groundingMetadataSchema = z5.object({
731
+ webSearchQueries: z5.array(z5.string()).nullish(),
732
+ retrievalQueries: z5.array(z5.string()).nullish(),
733
+ searchEntryPoint: z5.object({ renderedContent: z5.string() }).nullish(),
734
+ groundingChunks: z5.array(groundingChunkSchema).nullish(),
735
+ groundingSupports: z5.array(
736
+ z5.object({
737
+ segment: z5.object({
738
+ startIndex: z5.number().nullish(),
739
+ endIndex: z5.number().nullish(),
740
+ text: z5.string().nullish()
726
741
  }),
727
- segment_text: import_v45.z.string().nullish(),
728
- groundingChunkIndices: import_v45.z.array(import_v45.z.number()).nullish(),
729
- supportChunkIndices: import_v45.z.array(import_v45.z.number()).nullish(),
730
- confidenceScores: import_v45.z.array(import_v45.z.number()).nullish(),
731
- confidenceScore: import_v45.z.array(import_v45.z.number()).nullish()
742
+ segment_text: z5.string().nullish(),
743
+ groundingChunkIndices: z5.array(z5.number()).nullish(),
744
+ supportChunkIndices: z5.array(z5.number()).nullish(),
745
+ confidenceScores: z5.array(z5.number()).nullish(),
746
+ confidenceScore: z5.array(z5.number()).nullish()
732
747
  })
733
748
  ).nullish(),
734
- retrievalMetadata: import_v45.z.union([
735
- import_v45.z.object({
736
- webDynamicRetrievalScore: import_v45.z.number()
749
+ retrievalMetadata: z5.union([
750
+ z5.object({
751
+ webDynamicRetrievalScore: z5.number()
737
752
  }),
738
- import_v45.z.object({})
753
+ z5.object({})
739
754
  ]).nullish()
740
755
  });
741
756
  var googleSearch = (0, import_provider_utils4.createProviderDefinedToolFactory)({
742
757
  id: "google.google_search",
743
758
  name: "google_search",
744
- inputSchema: import_v45.z.object({
745
- mode: import_v45.z.enum(["MODE_DYNAMIC", "MODE_UNSPECIFIED"]).default("MODE_UNSPECIFIED"),
746
- dynamicThreshold: import_v45.z.number().default(1)
759
+ inputSchema: z5.object({
760
+ mode: z5.enum(["MODE_DYNAMIC", "MODE_UNSPECIFIED"]).default("MODE_UNSPECIFIED"),
761
+ dynamicThreshold: z5.number().default(1)
747
762
  })
748
763
  });
749
764
 
750
765
  // src/tool/url-context.ts
751
766
  var import_provider_utils5 = require("@ai-sdk/provider-utils");
752
- var import_v46 = require("zod/v4");
753
- var urlMetadataSchema = import_v46.z.object({
754
- retrievedUrl: import_v46.z.string(),
755
- urlRetrievalStatus: import_v46.z.string()
767
+ var z6 = __toESM(require("zod/v4"));
768
+ var urlMetadataSchema = z6.object({
769
+ retrievedUrl: z6.string(),
770
+ urlRetrievalStatus: z6.string()
756
771
  });
757
- var urlContextMetadataSchema = import_v46.z.object({
758
- urlMetadata: import_v46.z.array(urlMetadataSchema)
772
+ var urlContextMetadataSchema = z6.object({
773
+ urlMetadata: z6.array(urlMetadataSchema)
759
774
  });
760
775
  var urlContext = (0, import_provider_utils5.createProviderDefinedToolFactory)({
761
776
  id: "google.url_context",
762
777
  name: "url_context",
763
- inputSchema: import_v46.z.object({})
778
+ inputSchema: z6.object({})
764
779
  });
765
780
 
766
781
  // src/google-generative-ai-language-model.ts
@@ -1258,100 +1273,100 @@ function extractSources({
1258
1273
  title: chunk.web.title
1259
1274
  }));
1260
1275
  }
1261
- var contentSchema = import_v47.z.object({
1262
- parts: import_v47.z.array(
1263
- import_v47.z.union([
1276
+ var contentSchema = z7.object({
1277
+ parts: z7.array(
1278
+ z7.union([
1264
1279
  // note: order matters since text can be fully empty
1265
- import_v47.z.object({
1266
- functionCall: import_v47.z.object({
1267
- name: import_v47.z.string(),
1268
- args: import_v47.z.unknown()
1280
+ z7.object({
1281
+ functionCall: z7.object({
1282
+ name: z7.string(),
1283
+ args: z7.unknown()
1269
1284
  }),
1270
- thoughtSignature: import_v47.z.string().nullish()
1285
+ thoughtSignature: z7.string().nullish()
1271
1286
  }),
1272
- import_v47.z.object({
1273
- inlineData: import_v47.z.object({
1274
- mimeType: import_v47.z.string(),
1275
- data: import_v47.z.string()
1287
+ z7.object({
1288
+ inlineData: z7.object({
1289
+ mimeType: z7.string(),
1290
+ data: z7.string()
1276
1291
  })
1277
1292
  }),
1278
- import_v47.z.object({
1279
- executableCode: import_v47.z.object({
1280
- language: import_v47.z.string(),
1281
- code: import_v47.z.string()
1293
+ z7.object({
1294
+ executableCode: z7.object({
1295
+ language: z7.string(),
1296
+ code: z7.string()
1282
1297
  }).nullish(),
1283
- codeExecutionResult: import_v47.z.object({
1284
- outcome: import_v47.z.string(),
1285
- output: import_v47.z.string()
1298
+ codeExecutionResult: z7.object({
1299
+ outcome: z7.string(),
1300
+ output: z7.string()
1286
1301
  }).nullish(),
1287
- text: import_v47.z.string().nullish(),
1288
- thought: import_v47.z.boolean().nullish(),
1289
- thoughtSignature: import_v47.z.string().nullish()
1302
+ text: z7.string().nullish(),
1303
+ thought: z7.boolean().nullish(),
1304
+ thoughtSignature: z7.string().nullish()
1290
1305
  })
1291
1306
  ])
1292
1307
  ).nullish()
1293
1308
  });
1294
- var safetyRatingSchema = import_v47.z.object({
1295
- category: import_v47.z.string().nullish(),
1296
- probability: import_v47.z.string().nullish(),
1297
- probabilityScore: import_v47.z.number().nullish(),
1298
- severity: import_v47.z.string().nullish(),
1299
- severityScore: import_v47.z.number().nullish(),
1300
- blocked: import_v47.z.boolean().nullish()
1309
+ var safetyRatingSchema = z7.object({
1310
+ category: z7.string().nullish(),
1311
+ probability: z7.string().nullish(),
1312
+ probabilityScore: z7.number().nullish(),
1313
+ severity: z7.string().nullish(),
1314
+ severityScore: z7.number().nullish(),
1315
+ blocked: z7.boolean().nullish()
1301
1316
  });
1302
- var usageSchema = import_v47.z.object({
1303
- cachedContentTokenCount: import_v47.z.number().nullish(),
1304
- thoughtsTokenCount: import_v47.z.number().nullish(),
1305
- promptTokenCount: import_v47.z.number().nullish(),
1306
- candidatesTokenCount: import_v47.z.number().nullish(),
1307
- totalTokenCount: import_v47.z.number().nullish()
1317
+ var usageSchema = z7.object({
1318
+ cachedContentTokenCount: z7.number().nullish(),
1319
+ thoughtsTokenCount: z7.number().nullish(),
1320
+ promptTokenCount: z7.number().nullish(),
1321
+ candidatesTokenCount: z7.number().nullish(),
1322
+ totalTokenCount: z7.number().nullish()
1308
1323
  });
1309
- var responseSchema = import_v47.z.object({
1310
- candidates: import_v47.z.array(
1311
- import_v47.z.object({
1312
- content: contentSchema.nullish().or(import_v47.z.object({}).strict()),
1313
- finishReason: import_v47.z.string().nullish(),
1314
- safetyRatings: import_v47.z.array(safetyRatingSchema).nullish(),
1324
+ var responseSchema = z7.object({
1325
+ candidates: z7.array(
1326
+ z7.object({
1327
+ content: contentSchema.nullish().or(z7.object({}).strict()),
1328
+ finishReason: z7.string().nullish(),
1329
+ safetyRatings: z7.array(safetyRatingSchema).nullish(),
1315
1330
  groundingMetadata: groundingMetadataSchema.nullish(),
1316
1331
  urlContextMetadata: urlContextMetadataSchema.nullish()
1317
1332
  })
1318
1333
  ),
1319
1334
  usageMetadata: usageSchema.nullish(),
1320
- promptFeedback: import_v47.z.object({
1321
- blockReason: import_v47.z.string().nullish(),
1322
- safetyRatings: import_v47.z.array(safetyRatingSchema).nullish()
1335
+ promptFeedback: z7.object({
1336
+ blockReason: z7.string().nullish(),
1337
+ safetyRatings: z7.array(safetyRatingSchema).nullish()
1323
1338
  }).nullish()
1324
1339
  });
1325
- var chunkSchema = import_v47.z.object({
1326
- candidates: import_v47.z.array(
1327
- import_v47.z.object({
1340
+ var chunkSchema = z7.object({
1341
+ candidates: z7.array(
1342
+ z7.object({
1328
1343
  content: contentSchema.nullish(),
1329
- finishReason: import_v47.z.string().nullish(),
1330
- safetyRatings: import_v47.z.array(safetyRatingSchema).nullish(),
1344
+ finishReason: z7.string().nullish(),
1345
+ safetyRatings: z7.array(safetyRatingSchema).nullish(),
1331
1346
  groundingMetadata: groundingMetadataSchema.nullish(),
1332
1347
  urlContextMetadata: urlContextMetadataSchema.nullish()
1333
1348
  })
1334
1349
  ).nullish(),
1335
1350
  usageMetadata: usageSchema.nullish(),
1336
- promptFeedback: import_v47.z.object({
1337
- blockReason: import_v47.z.string().nullish(),
1338
- safetyRatings: import_v47.z.array(safetyRatingSchema).nullish()
1351
+ promptFeedback: z7.object({
1352
+ blockReason: z7.string().nullish(),
1353
+ safetyRatings: z7.array(safetyRatingSchema).nullish()
1339
1354
  }).nullish()
1340
1355
  });
1341
1356
 
1342
1357
  // src/tool/code-execution.ts
1343
1358
  var import_provider_utils7 = require("@ai-sdk/provider-utils");
1344
- var import_v48 = require("zod/v4");
1359
+ var z8 = __toESM(require("zod/v4"));
1345
1360
  var codeExecution = (0, import_provider_utils7.createProviderDefinedToolFactoryWithOutputSchema)({
1346
1361
  id: "google.code_execution",
1347
1362
  name: "code_execution",
1348
- inputSchema: import_v48.z.object({
1349
- language: import_v48.z.string().describe("The programming language of the code."),
1350
- code: import_v48.z.string().describe("The code to be executed.")
1363
+ inputSchema: z8.object({
1364
+ language: z8.string().describe("The programming language of the code."),
1365
+ code: z8.string().describe("The code to be executed.")
1351
1366
  }),
1352
- outputSchema: import_v48.z.object({
1353
- outcome: import_v48.z.string().describe('The outcome of the execution (e.g., "OUTCOME_OK").'),
1354
- output: import_v48.z.string().describe("The output from the code execution.")
1367
+ outputSchema: z8.object({
1368
+ outcome: z8.string().describe('The outcome of the execution (e.g., "OUTCOME_OK").'),
1369
+ output: z8.string().describe("The output from the code execution.")
1355
1370
  })
1356
1371
  });
1357
1372
 
@@ -1382,7 +1397,7 @@ var googleTools = {
1382
1397
 
1383
1398
  // src/google-generative-ai-image-model.ts
1384
1399
  var import_provider_utils8 = require("@ai-sdk/provider-utils");
1385
- var import_v49 = require("zod/v4");
1400
+ var z9 = __toESM(require("zod/v4"));
1386
1401
  var GoogleGenerativeAIImageModel = class {
1387
1402
  constructor(modelId, settings, config) {
1388
1403
  this.modelId = modelId;
@@ -1474,12 +1489,12 @@ var GoogleGenerativeAIImageModel = class {
1474
1489
  };
1475
1490
  }
1476
1491
  };
1477
- var googleImageResponseSchema = import_v49.z.object({
1478
- predictions: import_v49.z.array(import_v49.z.object({ bytesBase64Encoded: import_v49.z.string() })).default([])
1492
+ var googleImageResponseSchema = z9.object({
1493
+ predictions: z9.array(z9.object({ bytesBase64Encoded: z9.string() })).default([])
1479
1494
  });
1480
- var googleImageProviderOptionsSchema = import_v49.z.object({
1481
- personGeneration: import_v49.z.enum(["dont_allow", "allow_adult", "allow_all"]).nullish(),
1482
- aspectRatio: import_v49.z.enum(["1:1", "3:4", "4:3", "9:16", "16:9"]).nullish()
1495
+ var googleImageProviderOptionsSchema = z9.object({
1496
+ personGeneration: z9.enum(["dont_allow", "allow_adult", "allow_all"]).nullish(),
1497
+ aspectRatio: z9.enum(["1:1", "3:4", "4:3", "9:16", "16:9"]).nullish()
1483
1498
  });
1484
1499
 
1485
1500
  // src/google-provider.ts