@ai-sdk/google 2.0.16 → 2.0.18

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,23 @@
1
1
  # @ai-sdk/google
2
2
 
3
+ ## 2.0.18
4
+
5
+ ### Patch Changes
6
+
7
+ - 6f0644c: chore: use import \* from zod/v4
8
+ - Updated dependencies [6f0644c]
9
+ - Updated dependencies [6f0644c]
10
+ - @ai-sdk/provider-utils@3.0.11
11
+
12
+ ## 2.0.17
13
+
14
+ ### Patch Changes
15
+
16
+ - bc5ed71: chore: update zod peer depenedency version
17
+ - 356c1f2: chore (provider/google): Add preview modelIds for gemini 2.5 flash and lite
18
+ - Updated dependencies [bc5ed71]
19
+ - @ai-sdk/provider-utils@3.0.10
20
+
3
21
  ## 2.0.16
4
22
 
5
23
  ### 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 { ProviderV2, LanguageModelV2, ImageModelV2, EmbeddingModelV2 } 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-lite' | 'gemini-2.5-flash-image-preview' | 'gemini-2.5-pro-exp-03-25' | 'gemini-2.5-flash-preview-04-17' | '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-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 { ProviderV2, LanguageModelV2, ImageModelV2, EmbeddingModelV2 } 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-lite' | 'gemini-2.5-flash-image-preview' | 'gemini-2.5-pro-exp-03-25' | 'gemini-2.5-flash-preview-04-17' | '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-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.0.16" : "0.0.0-test";
43
+ var VERSION = true ? "2.0.18" : "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) {
@@ -211,12 +221,9 @@ function convertJSONSchemaToOpenAPISchema(jsonSchema) {
211
221
  enum: enumValues
212
222
  } = jsonSchema;
213
223
  const result = {};
214
- if (description)
215
- result.description = description;
216
- if (required)
217
- result.required = required;
218
- if (format)
219
- result.format = format;
224
+ if (description) result.description = description;
225
+ if (required) result.required = required;
226
+ if (format) result.format = format;
220
227
  if (constValue !== void 0) {
221
228
  result.enum = [constValue];
222
229
  }
@@ -461,19 +468,19 @@ function getModelPath(modelId) {
461
468
  }
462
469
 
463
470
  // src/google-generative-ai-options.ts
464
- var import_v44 = require("zod/v4");
465
- var googleGenerativeAIProviderOptions = import_v44.z.object({
466
- responseModalities: import_v44.z.array(import_v44.z.enum(["TEXT", "IMAGE"])).optional(),
467
- thinkingConfig: import_v44.z.object({
468
- thinkingBudget: import_v44.z.number().optional(),
469
- 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()
470
477
  }).optional(),
471
478
  /**
472
479
  Optional.
473
480
  The name of the cached content used as context to serve the prediction.
474
481
  Format: cachedContents/{cachedContent}
475
482
  */
476
- cachedContent: import_v44.z.string().optional(),
483
+ cachedContent: z4.string().optional(),
477
484
  /**
478
485
  * Optional. Enable structured output. Default is true.
479
486
  *
@@ -482,13 +489,13 @@ var googleGenerativeAIProviderOptions = import_v44.z.object({
482
489
  * Google Generative AI uses. You can use this to disable
483
490
  * structured outputs if you need to.
484
491
  */
485
- structuredOutputs: import_v44.z.boolean().optional(),
492
+ structuredOutputs: z4.boolean().optional(),
486
493
  /**
487
494
  Optional. A list of unique safety settings for blocking unsafe content.
488
495
  */
489
- safetySettings: import_v44.z.array(
490
- import_v44.z.object({
491
- category: import_v44.z.enum([
496
+ safetySettings: z4.array(
497
+ z4.object({
498
+ category: z4.enum([
492
499
  "HARM_CATEGORY_UNSPECIFIED",
493
500
  "HARM_CATEGORY_HATE_SPEECH",
494
501
  "HARM_CATEGORY_DANGEROUS_CONTENT",
@@ -496,7 +503,7 @@ var googleGenerativeAIProviderOptions = import_v44.z.object({
496
503
  "HARM_CATEGORY_SEXUALLY_EXPLICIT",
497
504
  "HARM_CATEGORY_CIVIC_INTEGRITY"
498
505
  ]),
499
- threshold: import_v44.z.enum([
506
+ threshold: z4.enum([
500
507
  "HARM_BLOCK_THRESHOLD_UNSPECIFIED",
501
508
  "BLOCK_LOW_AND_ABOVE",
502
509
  "BLOCK_MEDIUM_AND_ABOVE",
@@ -506,7 +513,7 @@ var googleGenerativeAIProviderOptions = import_v44.z.object({
506
513
  ])
507
514
  })
508
515
  ).optional(),
509
- threshold: import_v44.z.enum([
516
+ threshold: z4.enum([
510
517
  "HARM_BLOCK_THRESHOLD_UNSPECIFIED",
511
518
  "BLOCK_LOW_AND_ABOVE",
512
519
  "BLOCK_MEDIUM_AND_ABOVE",
@@ -519,13 +526,13 @@ var googleGenerativeAIProviderOptions = import_v44.z.object({
519
526
  *
520
527
  * https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/audio-understanding
521
528
  */
522
- audioTimestamp: import_v44.z.boolean().optional(),
529
+ audioTimestamp: z4.boolean().optional(),
523
530
  /**
524
531
  * Optional. Defines labels used in billing reports. Available on Vertex AI only.
525
532
  *
526
533
  * https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/add-labels-to-api-calls
527
534
  */
528
- labels: import_v44.z.record(import_v44.z.string(), import_v44.z.string()).optional()
535
+ labels: z4.record(z4.string(), z4.string()).optional()
529
536
  });
530
537
 
531
538
  // src/google-prepare-tools.ts
@@ -699,60 +706,60 @@ function mapGoogleGenerativeAIFinishReason({
699
706
 
700
707
  // src/tool/google-search.ts
701
708
  var import_provider_utils4 = require("@ai-sdk/provider-utils");
702
- var import_v45 = require("zod/v4");
703
- var groundingChunkSchema = import_v45.z.object({
704
- web: import_v45.z.object({ uri: import_v45.z.string(), title: import_v45.z.string() }).nullish(),
705
- retrievedContext: import_v45.z.object({ uri: import_v45.z.string(), title: import_v45.z.string() }).nullish()
709
+ var z5 = __toESM(require("zod/v4"));
710
+ var groundingChunkSchema = z5.object({
711
+ web: z5.object({ uri: z5.string(), title: z5.string() }).nullish(),
712
+ retrievedContext: z5.object({ uri: z5.string(), title: z5.string() }).nullish()
706
713
  });
707
- var groundingMetadataSchema = import_v45.z.object({
708
- webSearchQueries: import_v45.z.array(import_v45.z.string()).nullish(),
709
- retrievalQueries: import_v45.z.array(import_v45.z.string()).nullish(),
710
- searchEntryPoint: import_v45.z.object({ renderedContent: import_v45.z.string() }).nullish(),
711
- groundingChunks: import_v45.z.array(groundingChunkSchema).nullish(),
712
- groundingSupports: import_v45.z.array(
713
- import_v45.z.object({
714
- segment: import_v45.z.object({
715
- startIndex: import_v45.z.number().nullish(),
716
- endIndex: import_v45.z.number().nullish(),
717
- text: import_v45.z.string().nullish()
714
+ var groundingMetadataSchema = z5.object({
715
+ webSearchQueries: z5.array(z5.string()).nullish(),
716
+ retrievalQueries: z5.array(z5.string()).nullish(),
717
+ searchEntryPoint: z5.object({ renderedContent: z5.string() }).nullish(),
718
+ groundingChunks: z5.array(groundingChunkSchema).nullish(),
719
+ groundingSupports: z5.array(
720
+ z5.object({
721
+ segment: z5.object({
722
+ startIndex: z5.number().nullish(),
723
+ endIndex: z5.number().nullish(),
724
+ text: z5.string().nullish()
718
725
  }),
719
- segment_text: import_v45.z.string().nullish(),
720
- groundingChunkIndices: import_v45.z.array(import_v45.z.number()).nullish(),
721
- supportChunkIndices: import_v45.z.array(import_v45.z.number()).nullish(),
722
- confidenceScores: import_v45.z.array(import_v45.z.number()).nullish(),
723
- confidenceScore: import_v45.z.array(import_v45.z.number()).nullish()
726
+ segment_text: z5.string().nullish(),
727
+ groundingChunkIndices: z5.array(z5.number()).nullish(),
728
+ supportChunkIndices: z5.array(z5.number()).nullish(),
729
+ confidenceScores: z5.array(z5.number()).nullish(),
730
+ confidenceScore: z5.array(z5.number()).nullish()
724
731
  })
725
732
  ).nullish(),
726
- retrievalMetadata: import_v45.z.union([
727
- import_v45.z.object({
728
- webDynamicRetrievalScore: import_v45.z.number()
733
+ retrievalMetadata: z5.union([
734
+ z5.object({
735
+ webDynamicRetrievalScore: z5.number()
729
736
  }),
730
- import_v45.z.object({})
737
+ z5.object({})
731
738
  ]).nullish()
732
739
  });
733
740
  var googleSearch = (0, import_provider_utils4.createProviderDefinedToolFactory)({
734
741
  id: "google.google_search",
735
742
  name: "google_search",
736
- inputSchema: import_v45.z.object({
737
- mode: import_v45.z.enum(["MODE_DYNAMIC", "MODE_UNSPECIFIED"]).default("MODE_UNSPECIFIED"),
738
- dynamicThreshold: import_v45.z.number().default(1)
743
+ inputSchema: z5.object({
744
+ mode: z5.enum(["MODE_DYNAMIC", "MODE_UNSPECIFIED"]).default("MODE_UNSPECIFIED"),
745
+ dynamicThreshold: z5.number().default(1)
739
746
  })
740
747
  });
741
748
 
742
749
  // src/tool/url-context.ts
743
750
  var import_provider_utils5 = require("@ai-sdk/provider-utils");
744
- var import_v46 = require("zod/v4");
745
- var urlMetadataSchema = import_v46.z.object({
746
- retrievedUrl: import_v46.z.string(),
747
- urlRetrievalStatus: import_v46.z.string()
751
+ var z6 = __toESM(require("zod/v4"));
752
+ var urlMetadataSchema = z6.object({
753
+ retrievedUrl: z6.string(),
754
+ urlRetrievalStatus: z6.string()
748
755
  });
749
- var urlContextMetadataSchema = import_v46.z.object({
750
- urlMetadata: import_v46.z.array(urlMetadataSchema)
756
+ var urlContextMetadataSchema = z6.object({
757
+ urlMetadata: z6.array(urlMetadataSchema)
751
758
  });
752
759
  var urlContext = (0, import_provider_utils5.createProviderDefinedToolFactory)({
753
760
  id: "google.url_context",
754
761
  name: "url_context",
755
- inputSchema: import_v46.z.object({})
762
+ inputSchema: z6.object({})
756
763
  });
757
764
 
758
765
  // src/google-generative-ai-language-model.ts
@@ -1247,100 +1254,100 @@ function extractSources({
1247
1254
  title: chunk.web.title
1248
1255
  }));
1249
1256
  }
1250
- var contentSchema = import_v47.z.object({
1251
- parts: import_v47.z.array(
1252
- import_v47.z.union([
1257
+ var contentSchema = z7.object({
1258
+ parts: z7.array(
1259
+ z7.union([
1253
1260
  // note: order matters since text can be fully empty
1254
- import_v47.z.object({
1255
- functionCall: import_v47.z.object({
1256
- name: import_v47.z.string(),
1257
- args: import_v47.z.unknown()
1261
+ z7.object({
1262
+ functionCall: z7.object({
1263
+ name: z7.string(),
1264
+ args: z7.unknown()
1258
1265
  }),
1259
- thoughtSignature: import_v47.z.string().nullish()
1266
+ thoughtSignature: z7.string().nullish()
1260
1267
  }),
1261
- import_v47.z.object({
1262
- inlineData: import_v47.z.object({
1263
- mimeType: import_v47.z.string(),
1264
- data: import_v47.z.string()
1268
+ z7.object({
1269
+ inlineData: z7.object({
1270
+ mimeType: z7.string(),
1271
+ data: z7.string()
1265
1272
  })
1266
1273
  }),
1267
- import_v47.z.object({
1268
- executableCode: import_v47.z.object({
1269
- language: import_v47.z.string(),
1270
- code: import_v47.z.string()
1274
+ z7.object({
1275
+ executableCode: z7.object({
1276
+ language: z7.string(),
1277
+ code: z7.string()
1271
1278
  }).nullish(),
1272
- codeExecutionResult: import_v47.z.object({
1273
- outcome: import_v47.z.string(),
1274
- output: import_v47.z.string()
1279
+ codeExecutionResult: z7.object({
1280
+ outcome: z7.string(),
1281
+ output: z7.string()
1275
1282
  }).nullish(),
1276
- text: import_v47.z.string().nullish(),
1277
- thought: import_v47.z.boolean().nullish(),
1278
- thoughtSignature: import_v47.z.string().nullish()
1283
+ text: z7.string().nullish(),
1284
+ thought: z7.boolean().nullish(),
1285
+ thoughtSignature: z7.string().nullish()
1279
1286
  })
1280
1287
  ])
1281
1288
  ).nullish()
1282
1289
  });
1283
- var safetyRatingSchema = import_v47.z.object({
1284
- category: import_v47.z.string().nullish(),
1285
- probability: import_v47.z.string().nullish(),
1286
- probabilityScore: import_v47.z.number().nullish(),
1287
- severity: import_v47.z.string().nullish(),
1288
- severityScore: import_v47.z.number().nullish(),
1289
- blocked: import_v47.z.boolean().nullish()
1290
+ var safetyRatingSchema = z7.object({
1291
+ category: z7.string().nullish(),
1292
+ probability: z7.string().nullish(),
1293
+ probabilityScore: z7.number().nullish(),
1294
+ severity: z7.string().nullish(),
1295
+ severityScore: z7.number().nullish(),
1296
+ blocked: z7.boolean().nullish()
1290
1297
  });
1291
- var usageSchema = import_v47.z.object({
1292
- cachedContentTokenCount: import_v47.z.number().nullish(),
1293
- thoughtsTokenCount: import_v47.z.number().nullish(),
1294
- promptTokenCount: import_v47.z.number().nullish(),
1295
- candidatesTokenCount: import_v47.z.number().nullish(),
1296
- totalTokenCount: import_v47.z.number().nullish()
1298
+ var usageSchema = z7.object({
1299
+ cachedContentTokenCount: z7.number().nullish(),
1300
+ thoughtsTokenCount: z7.number().nullish(),
1301
+ promptTokenCount: z7.number().nullish(),
1302
+ candidatesTokenCount: z7.number().nullish(),
1303
+ totalTokenCount: z7.number().nullish()
1297
1304
  });
1298
- var responseSchema = import_v47.z.object({
1299
- candidates: import_v47.z.array(
1300
- import_v47.z.object({
1301
- content: contentSchema.nullish().or(import_v47.z.object({}).strict()),
1302
- finishReason: import_v47.z.string().nullish(),
1303
- safetyRatings: import_v47.z.array(safetyRatingSchema).nullish(),
1305
+ var responseSchema = z7.object({
1306
+ candidates: z7.array(
1307
+ z7.object({
1308
+ content: contentSchema.nullish().or(z7.object({}).strict()),
1309
+ finishReason: z7.string().nullish(),
1310
+ safetyRatings: z7.array(safetyRatingSchema).nullish(),
1304
1311
  groundingMetadata: groundingMetadataSchema.nullish(),
1305
1312
  urlContextMetadata: urlContextMetadataSchema.nullish()
1306
1313
  })
1307
1314
  ),
1308
1315
  usageMetadata: usageSchema.nullish(),
1309
- promptFeedback: import_v47.z.object({
1310
- blockReason: import_v47.z.string().nullish(),
1311
- safetyRatings: import_v47.z.array(safetyRatingSchema).nullish()
1316
+ promptFeedback: z7.object({
1317
+ blockReason: z7.string().nullish(),
1318
+ safetyRatings: z7.array(safetyRatingSchema).nullish()
1312
1319
  }).nullish()
1313
1320
  });
1314
- var chunkSchema = import_v47.z.object({
1315
- candidates: import_v47.z.array(
1316
- import_v47.z.object({
1321
+ var chunkSchema = z7.object({
1322
+ candidates: z7.array(
1323
+ z7.object({
1317
1324
  content: contentSchema.nullish(),
1318
- finishReason: import_v47.z.string().nullish(),
1319
- safetyRatings: import_v47.z.array(safetyRatingSchema).nullish(),
1325
+ finishReason: z7.string().nullish(),
1326
+ safetyRatings: z7.array(safetyRatingSchema).nullish(),
1320
1327
  groundingMetadata: groundingMetadataSchema.nullish(),
1321
1328
  urlContextMetadata: urlContextMetadataSchema.nullish()
1322
1329
  })
1323
1330
  ).nullish(),
1324
1331
  usageMetadata: usageSchema.nullish(),
1325
- promptFeedback: import_v47.z.object({
1326
- blockReason: import_v47.z.string().nullish(),
1327
- safetyRatings: import_v47.z.array(safetyRatingSchema).nullish()
1332
+ promptFeedback: z7.object({
1333
+ blockReason: z7.string().nullish(),
1334
+ safetyRatings: z7.array(safetyRatingSchema).nullish()
1328
1335
  }).nullish()
1329
1336
  });
1330
1337
 
1331
1338
  // src/tool/code-execution.ts
1332
1339
  var import_provider_utils7 = require("@ai-sdk/provider-utils");
1333
- var import_v48 = require("zod/v4");
1340
+ var z8 = __toESM(require("zod/v4"));
1334
1341
  var codeExecution = (0, import_provider_utils7.createProviderDefinedToolFactoryWithOutputSchema)({
1335
1342
  id: "google.code_execution",
1336
1343
  name: "code_execution",
1337
- inputSchema: import_v48.z.object({
1338
- language: import_v48.z.string().describe("The programming language of the code."),
1339
- code: import_v48.z.string().describe("The code to be executed.")
1344
+ inputSchema: z8.object({
1345
+ language: z8.string().describe("The programming language of the code."),
1346
+ code: z8.string().describe("The code to be executed.")
1340
1347
  }),
1341
- outputSchema: import_v48.z.object({
1342
- outcome: import_v48.z.string().describe('The outcome of the execution (e.g., "OUTCOME_OK").'),
1343
- output: import_v48.z.string().describe("The output from the code execution.")
1348
+ outputSchema: z8.object({
1349
+ outcome: z8.string().describe('The outcome of the execution (e.g., "OUTCOME_OK").'),
1350
+ output: z8.string().describe("The output from the code execution.")
1344
1351
  })
1345
1352
  });
1346
1353
 
@@ -1371,7 +1378,7 @@ var googleTools = {
1371
1378
 
1372
1379
  // src/google-generative-ai-image-model.ts
1373
1380
  var import_provider_utils8 = require("@ai-sdk/provider-utils");
1374
- var import_v49 = require("zod/v4");
1381
+ var z9 = __toESM(require("zod/v4"));
1375
1382
  var GoogleGenerativeAIImageModel = class {
1376
1383
  constructor(modelId, settings, config) {
1377
1384
  this.modelId = modelId;
@@ -1463,12 +1470,12 @@ var GoogleGenerativeAIImageModel = class {
1463
1470
  };
1464
1471
  }
1465
1472
  };
1466
- var googleImageResponseSchema = import_v49.z.object({
1467
- predictions: import_v49.z.array(import_v49.z.object({ bytesBase64Encoded: import_v49.z.string() })).default([])
1473
+ var googleImageResponseSchema = z9.object({
1474
+ predictions: z9.array(z9.object({ bytesBase64Encoded: z9.string() })).default([])
1468
1475
  });
1469
- var googleImageProviderOptionsSchema = import_v49.z.object({
1470
- personGeneration: import_v49.z.enum(["dont_allow", "allow_adult", "allow_all"]).nullish(),
1471
- aspectRatio: import_v49.z.enum(["1:1", "3:4", "4:3", "9:16", "16:9"]).nullish()
1476
+ var googleImageProviderOptionsSchema = z9.object({
1477
+ personGeneration: z9.enum(["dont_allow", "allow_adult", "allow_all"]).nullish(),
1478
+ aspectRatio: z9.enum(["1:1", "3:4", "4:3", "9:16", "16:9"]).nullish()
1472
1479
  });
1473
1480
 
1474
1481
  // src/google-provider.ts