@ai-sdk/google 3.0.0-beta.78 → 3.0.0-beta.81

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.
@@ -3,7 +3,7 @@ import { Resolvable, FetchFunction, InferSchema } from '@ai-sdk/provider-utils';
3
3
  import { LanguageModelV3 } from '@ai-sdk/provider';
4
4
  import { z } from 'zod/v4';
5
5
 
6
- 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-3-pro-preview' | 'gemini-3-pro-image-preview' | '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 & {});
6
+ 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-3-pro-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-flash-preview' | '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 & {});
7
7
 
8
8
  type GoogleGenerativeAIConfig = {
9
9
  provider: string;
@@ -192,6 +192,17 @@ declare const googleTools: {
192
192
  mode?: "MODE_DYNAMIC" | "MODE_UNSPECIFIED";
193
193
  dynamicThreshold?: number;
194
194
  }>;
195
+ /**
196
+ * Creates an Enterprise Web Search tool for grounding responses using a compliance-focused web index.
197
+ * Designed for highly-regulated industries (finance, healthcare, public sector).
198
+ * Does not log customer data and supports VPC service controls.
199
+ * Must have name "enterprise_web_search".
200
+ *
201
+ * @note Only available on Vertex AI. Requires Gemini 2.0 or newer.
202
+ *
203
+ * @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/web-grounding-enterprise
204
+ */
205
+ enterpriseWebSearch: _ai_sdk_provider_utils.ProviderToolFactory<{}, {}>;
195
206
  /**
196
207
  * Creates a Google Maps grounding tool that gives the model access to Google Maps data.
197
208
  * Must have name "google_maps".
@@ -3,7 +3,7 @@ import { Resolvable, FetchFunction, InferSchema } from '@ai-sdk/provider-utils';
3
3
  import { LanguageModelV3 } from '@ai-sdk/provider';
4
4
  import { z } from 'zod/v4';
5
5
 
6
- 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-3-pro-preview' | 'gemini-3-pro-image-preview' | '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 & {});
6
+ 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-3-pro-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-flash-preview' | '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 & {});
7
7
 
8
8
  type GoogleGenerativeAIConfig = {
9
9
  provider: string;
@@ -192,6 +192,17 @@ declare const googleTools: {
192
192
  mode?: "MODE_DYNAMIC" | "MODE_UNSPECIFIED";
193
193
  dynamicThreshold?: number;
194
194
  }>;
195
+ /**
196
+ * Creates an Enterprise Web Search tool for grounding responses using a compliance-focused web index.
197
+ * Designed for highly-regulated industries (finance, healthcare, public sector).
198
+ * Does not log customer data and supports VPC service controls.
199
+ * Must have name "enterprise_web_search".
200
+ *
201
+ * @note Only available on Vertex AI. Requires Gemini 2.0 or newer.
202
+ *
203
+ * @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/web-grounding-enterprise
204
+ */
205
+ enterpriseWebSearch: _ai_sdk_provider_utils.ProviderToolFactory<{}, {}>;
195
206
  /**
196
207
  * Creates a Google Maps grounding tool that gives the model access to Google Maps data.
197
208
  * Must have name "google_maps".
@@ -368,7 +368,7 @@ var googleGenerativeAIProviderOptions = (0, import_provider_utils3.lazySchema)(
368
368
  thinkingBudget: import_v42.z.number().optional(),
369
369
  includeThoughts: import_v42.z.boolean().optional(),
370
370
  // https://ai.google.dev/gemini-api/docs/gemini-3?thinking=high#thinking_level
371
- thinkingLevel: import_v42.z.enum(["low", "medium", "high"]).optional()
371
+ thinkingLevel: import_v42.z.enum(["minimal", "low", "medium", "high"]).optional()
372
372
  }).optional(),
373
373
  /**
374
374
  * Optional.
@@ -525,6 +525,17 @@ function prepareTools({
525
525
  googleTools2.push({ googleSearchRetrieval: {} });
526
526
  }
527
527
  break;
528
+ case "google.enterprise_web_search":
529
+ if (isGemini2orNewer) {
530
+ googleTools2.push({ enterpriseWebSearch: {} });
531
+ } else {
532
+ toolWarnings.push({
533
+ type: "unsupported",
534
+ feature: `provider-defined tool ${tool.id}`,
535
+ details: "Enterprise Web Search requires Gemini 2.0 or newer."
536
+ });
537
+ }
538
+ break;
528
539
  case "google.url_context":
529
540
  if (isGemini2orNewer) {
530
541
  googleTools2.push({ urlContext: {} });
@@ -1429,72 +1440,80 @@ var codeExecution = (0, import_provider_utils5.createProviderToolFactoryWithOutp
1429
1440
  })
1430
1441
  });
1431
1442
 
1432
- // src/tool/file-search.ts
1443
+ // src/tool/enterprise-web-search.ts
1433
1444
  var import_provider_utils6 = require("@ai-sdk/provider-utils");
1434
1445
  var import_v45 = require("zod/v4");
1435
- var fileSearchArgsBaseSchema = import_v45.z.object({
1446
+ var enterpriseWebSearch = (0, import_provider_utils6.createProviderToolFactory)({
1447
+ id: "google.enterprise_web_search",
1448
+ inputSchema: (0, import_provider_utils6.lazySchema)(() => (0, import_provider_utils6.zodSchema)(import_v45.z.object({})))
1449
+ });
1450
+
1451
+ // src/tool/file-search.ts
1452
+ var import_provider_utils7 = require("@ai-sdk/provider-utils");
1453
+ var import_v46 = require("zod/v4");
1454
+ var fileSearchArgsBaseSchema = import_v46.z.object({
1436
1455
  /** The names of the file_search_stores to retrieve from.
1437
1456
  * Example: `fileSearchStores/my-file-search-store-123`
1438
1457
  */
1439
- fileSearchStoreNames: import_v45.z.array(import_v45.z.string()).describe(
1458
+ fileSearchStoreNames: import_v46.z.array(import_v46.z.string()).describe(
1440
1459
  "The names of the file_search_stores to retrieve from. Example: `fileSearchStores/my-file-search-store-123`"
1441
1460
  ),
1442
1461
  /** The number of file search retrieval chunks to retrieve. */
1443
- topK: import_v45.z.number().int().positive().describe("The number of file search retrieval chunks to retrieve.").optional(),
1462
+ topK: import_v46.z.number().int().positive().describe("The number of file search retrieval chunks to retrieve.").optional(),
1444
1463
  /** Metadata filter to apply to the file search retrieval documents.
1445
1464
  * See https://google.aip.dev/160 for the syntax of the filter expression.
1446
1465
  */
1447
- metadataFilter: import_v45.z.string().describe(
1466
+ metadataFilter: import_v46.z.string().describe(
1448
1467
  "Metadata filter to apply to the file search retrieval documents. See https://google.aip.dev/160 for the syntax of the filter expression."
1449
1468
  ).optional()
1450
1469
  }).passthrough();
1451
- var fileSearchArgsSchema = (0, import_provider_utils6.lazySchema)(
1452
- () => (0, import_provider_utils6.zodSchema)(fileSearchArgsBaseSchema)
1470
+ var fileSearchArgsSchema = (0, import_provider_utils7.lazySchema)(
1471
+ () => (0, import_provider_utils7.zodSchema)(fileSearchArgsBaseSchema)
1453
1472
  );
1454
- var fileSearch = (0, import_provider_utils6.createProviderToolFactory)({
1473
+ var fileSearch = (0, import_provider_utils7.createProviderToolFactory)({
1455
1474
  id: "google.file_search",
1456
1475
  inputSchema: fileSearchArgsSchema
1457
1476
  });
1458
1477
 
1459
1478
  // src/tool/google-maps.ts
1460
- var import_provider_utils7 = require("@ai-sdk/provider-utils");
1461
- var import_v46 = require("zod/v4");
1462
- var googleMaps = (0, import_provider_utils7.createProviderToolFactory)({
1479
+ var import_provider_utils8 = require("@ai-sdk/provider-utils");
1480
+ var import_v47 = require("zod/v4");
1481
+ var googleMaps = (0, import_provider_utils8.createProviderToolFactory)({
1463
1482
  id: "google.google_maps",
1464
- inputSchema: (0, import_provider_utils7.lazySchema)(() => (0, import_provider_utils7.zodSchema)(import_v46.z.object({})))
1483
+ inputSchema: (0, import_provider_utils8.lazySchema)(() => (0, import_provider_utils8.zodSchema)(import_v47.z.object({})))
1465
1484
  });
1466
1485
 
1467
1486
  // src/tool/google-search.ts
1468
- var import_provider_utils8 = require("@ai-sdk/provider-utils");
1469
- var import_v47 = require("zod/v4");
1470
- var googleSearch = (0, import_provider_utils8.createProviderToolFactory)({
1487
+ var import_provider_utils9 = require("@ai-sdk/provider-utils");
1488
+ var import_v48 = require("zod/v4");
1489
+ var googleSearch = (0, import_provider_utils9.createProviderToolFactory)({
1471
1490
  id: "google.google_search",
1472
- inputSchema: (0, import_provider_utils8.lazySchema)(
1473
- () => (0, import_provider_utils8.zodSchema)(
1474
- import_v47.z.object({
1475
- mode: import_v47.z.enum(["MODE_DYNAMIC", "MODE_UNSPECIFIED"]).default("MODE_UNSPECIFIED"),
1476
- dynamicThreshold: import_v47.z.number().default(1)
1491
+ inputSchema: (0, import_provider_utils9.lazySchema)(
1492
+ () => (0, import_provider_utils9.zodSchema)(
1493
+ import_v48.z.object({
1494
+ mode: import_v48.z.enum(["MODE_DYNAMIC", "MODE_UNSPECIFIED"]).default("MODE_UNSPECIFIED"),
1495
+ dynamicThreshold: import_v48.z.number().default(1)
1477
1496
  })
1478
1497
  )
1479
1498
  )
1480
1499
  });
1481
1500
 
1482
1501
  // src/tool/url-context.ts
1483
- var import_provider_utils9 = require("@ai-sdk/provider-utils");
1484
- var import_v48 = require("zod/v4");
1485
- var urlContext = (0, import_provider_utils9.createProviderToolFactory)({
1502
+ var import_provider_utils10 = require("@ai-sdk/provider-utils");
1503
+ var import_v49 = require("zod/v4");
1504
+ var urlContext = (0, import_provider_utils10.createProviderToolFactory)({
1486
1505
  id: "google.url_context",
1487
- inputSchema: (0, import_provider_utils9.lazySchema)(() => (0, import_provider_utils9.zodSchema)(import_v48.z.object({})))
1506
+ inputSchema: (0, import_provider_utils10.lazySchema)(() => (0, import_provider_utils10.zodSchema)(import_v49.z.object({})))
1488
1507
  });
1489
1508
 
1490
1509
  // src/tool/vertex-rag-store.ts
1491
- var import_provider_utils10 = require("@ai-sdk/provider-utils");
1492
- var import_v49 = require("zod/v4");
1493
- var vertexRagStore = (0, import_provider_utils10.createProviderToolFactory)({
1510
+ var import_provider_utils11 = require("@ai-sdk/provider-utils");
1511
+ var import_v410 = require("zod/v4");
1512
+ var vertexRagStore = (0, import_provider_utils11.createProviderToolFactory)({
1494
1513
  id: "google.vertex_rag_store",
1495
- inputSchema: import_v49.z.object({
1496
- ragCorpus: import_v49.z.string(),
1497
- topK: import_v49.z.number().optional()
1514
+ inputSchema: import_v410.z.object({
1515
+ ragCorpus: import_v410.z.string(),
1516
+ topK: import_v410.z.number().optional()
1498
1517
  })
1499
1518
  });
1500
1519
 
@@ -1505,6 +1524,17 @@ var googleTools = {
1505
1524
  * Must have name "google_search".
1506
1525
  */
1507
1526
  googleSearch,
1527
+ /**
1528
+ * Creates an Enterprise Web Search tool for grounding responses using a compliance-focused web index.
1529
+ * Designed for highly-regulated industries (finance, healthcare, public sector).
1530
+ * Does not log customer data and supports VPC service controls.
1531
+ * Must have name "enterprise_web_search".
1532
+ *
1533
+ * @note Only available on Vertex AI. Requires Gemini 2.0 or newer.
1534
+ *
1535
+ * @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/web-grounding-enterprise
1536
+ */
1537
+ enterpriseWebSearch,
1508
1538
  /**
1509
1539
  * Creates a Google Maps grounding tool that gives the model access to Google Maps data.
1510
1540
  * Must have name "google_maps".