@ai-sdk/google 3.0.0-beta.80 → 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.
- package/CHANGELOG.md +6 -0
- package/dist/index.d.mts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +81 -51
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +83 -49
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +11 -0
- package/dist/internal/index.d.ts +11 -0
- package/dist/internal/index.js +60 -30
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +70 -36
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -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".
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -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".
|
package/dist/internal/index.js
CHANGED
|
@@ -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/
|
|
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
|
|
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:
|
|
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:
|
|
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:
|
|
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,
|
|
1452
|
-
() => (0,
|
|
1470
|
+
var fileSearchArgsSchema = (0, import_provider_utils7.lazySchema)(
|
|
1471
|
+
() => (0, import_provider_utils7.zodSchema)(fileSearchArgsBaseSchema)
|
|
1453
1472
|
);
|
|
1454
|
-
var fileSearch = (0,
|
|
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
|
|
1461
|
-
var
|
|
1462
|
-
var googleMaps = (0,
|
|
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,
|
|
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
|
|
1469
|
-
var
|
|
1470
|
-
var googleSearch = (0,
|
|
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,
|
|
1473
|
-
() => (0,
|
|
1474
|
-
|
|
1475
|
-
mode:
|
|
1476
|
-
dynamicThreshold:
|
|
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
|
|
1484
|
-
var
|
|
1485
|
-
var urlContext = (0,
|
|
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,
|
|
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
|
|
1492
|
-
var
|
|
1493
|
-
var vertexRagStore = (0,
|
|
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:
|
|
1496
|
-
ragCorpus:
|
|
1497
|
-
topK:
|
|
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".
|