@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.
- package/CHANGELOG.md +21 -0
- package/dist/index.d.mts +27 -2
- package/dist/index.d.ts +27 -2
- package/dist/index.js +84 -52
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +86 -50
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +12 -1
- package/dist/internal/index.d.ts +12 -1
- package/dist/internal/index.js +61 -31
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +71 -37
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/internal/index.mjs
CHANGED
|
@@ -355,7 +355,7 @@ var googleGenerativeAIProviderOptions = lazySchema2(
|
|
|
355
355
|
thinkingBudget: z2.number().optional(),
|
|
356
356
|
includeThoughts: z2.boolean().optional(),
|
|
357
357
|
// https://ai.google.dev/gemini-api/docs/gemini-3?thinking=high#thinking_level
|
|
358
|
-
thinkingLevel: z2.enum(["low", "medium", "high"]).optional()
|
|
358
|
+
thinkingLevel: z2.enum(["minimal", "low", "medium", "high"]).optional()
|
|
359
359
|
}).optional(),
|
|
360
360
|
/**
|
|
361
361
|
* Optional.
|
|
@@ -514,6 +514,17 @@ function prepareTools({
|
|
|
514
514
|
googleTools2.push({ googleSearchRetrieval: {} });
|
|
515
515
|
}
|
|
516
516
|
break;
|
|
517
|
+
case "google.enterprise_web_search":
|
|
518
|
+
if (isGemini2orNewer) {
|
|
519
|
+
googleTools2.push({ enterpriseWebSearch: {} });
|
|
520
|
+
} else {
|
|
521
|
+
toolWarnings.push({
|
|
522
|
+
type: "unsupported",
|
|
523
|
+
feature: `provider-defined tool ${tool.id}`,
|
|
524
|
+
details: "Enterprise Web Search requires Gemini 2.0 or newer."
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
break;
|
|
517
528
|
case "google.url_context":
|
|
518
529
|
if (isGemini2orNewer) {
|
|
519
530
|
googleTools2.push({ urlContext: {} });
|
|
@@ -1418,63 +1429,75 @@ var codeExecution = createProviderToolFactoryWithOutputSchema({
|
|
|
1418
1429
|
})
|
|
1419
1430
|
});
|
|
1420
1431
|
|
|
1421
|
-
// src/tool/
|
|
1432
|
+
// src/tool/enterprise-web-search.ts
|
|
1422
1433
|
import {
|
|
1423
1434
|
createProviderToolFactory,
|
|
1424
1435
|
lazySchema as lazySchema4,
|
|
1425
1436
|
zodSchema as zodSchema4
|
|
1426
1437
|
} from "@ai-sdk/provider-utils";
|
|
1427
1438
|
import { z as z5 } from "zod/v4";
|
|
1428
|
-
var
|
|
1439
|
+
var enterpriseWebSearch = createProviderToolFactory({
|
|
1440
|
+
id: "google.enterprise_web_search",
|
|
1441
|
+
inputSchema: lazySchema4(() => zodSchema4(z5.object({})))
|
|
1442
|
+
});
|
|
1443
|
+
|
|
1444
|
+
// src/tool/file-search.ts
|
|
1445
|
+
import {
|
|
1446
|
+
createProviderToolFactory as createProviderToolFactory2,
|
|
1447
|
+
lazySchema as lazySchema5,
|
|
1448
|
+
zodSchema as zodSchema5
|
|
1449
|
+
} from "@ai-sdk/provider-utils";
|
|
1450
|
+
import { z as z6 } from "zod/v4";
|
|
1451
|
+
var fileSearchArgsBaseSchema = z6.object({
|
|
1429
1452
|
/** The names of the file_search_stores to retrieve from.
|
|
1430
1453
|
* Example: `fileSearchStores/my-file-search-store-123`
|
|
1431
1454
|
*/
|
|
1432
|
-
fileSearchStoreNames:
|
|
1455
|
+
fileSearchStoreNames: z6.array(z6.string()).describe(
|
|
1433
1456
|
"The names of the file_search_stores to retrieve from. Example: `fileSearchStores/my-file-search-store-123`"
|
|
1434
1457
|
),
|
|
1435
1458
|
/** The number of file search retrieval chunks to retrieve. */
|
|
1436
|
-
topK:
|
|
1459
|
+
topK: z6.number().int().positive().describe("The number of file search retrieval chunks to retrieve.").optional(),
|
|
1437
1460
|
/** Metadata filter to apply to the file search retrieval documents.
|
|
1438
1461
|
* See https://google.aip.dev/160 for the syntax of the filter expression.
|
|
1439
1462
|
*/
|
|
1440
|
-
metadataFilter:
|
|
1463
|
+
metadataFilter: z6.string().describe(
|
|
1441
1464
|
"Metadata filter to apply to the file search retrieval documents. See https://google.aip.dev/160 for the syntax of the filter expression."
|
|
1442
1465
|
).optional()
|
|
1443
1466
|
}).passthrough();
|
|
1444
|
-
var fileSearchArgsSchema =
|
|
1445
|
-
() =>
|
|
1467
|
+
var fileSearchArgsSchema = lazySchema5(
|
|
1468
|
+
() => zodSchema5(fileSearchArgsBaseSchema)
|
|
1446
1469
|
);
|
|
1447
|
-
var fileSearch =
|
|
1470
|
+
var fileSearch = createProviderToolFactory2({
|
|
1448
1471
|
id: "google.file_search",
|
|
1449
1472
|
inputSchema: fileSearchArgsSchema
|
|
1450
1473
|
});
|
|
1451
1474
|
|
|
1452
1475
|
// src/tool/google-maps.ts
|
|
1453
1476
|
import {
|
|
1454
|
-
createProviderToolFactory as
|
|
1455
|
-
lazySchema as
|
|
1456
|
-
zodSchema as
|
|
1477
|
+
createProviderToolFactory as createProviderToolFactory3,
|
|
1478
|
+
lazySchema as lazySchema6,
|
|
1479
|
+
zodSchema as zodSchema6
|
|
1457
1480
|
} from "@ai-sdk/provider-utils";
|
|
1458
|
-
import { z as
|
|
1459
|
-
var googleMaps =
|
|
1481
|
+
import { z as z7 } from "zod/v4";
|
|
1482
|
+
var googleMaps = createProviderToolFactory3({
|
|
1460
1483
|
id: "google.google_maps",
|
|
1461
|
-
inputSchema:
|
|
1484
|
+
inputSchema: lazySchema6(() => zodSchema6(z7.object({})))
|
|
1462
1485
|
});
|
|
1463
1486
|
|
|
1464
1487
|
// src/tool/google-search.ts
|
|
1465
1488
|
import {
|
|
1466
|
-
createProviderToolFactory as
|
|
1467
|
-
lazySchema as
|
|
1468
|
-
zodSchema as
|
|
1489
|
+
createProviderToolFactory as createProviderToolFactory4,
|
|
1490
|
+
lazySchema as lazySchema7,
|
|
1491
|
+
zodSchema as zodSchema7
|
|
1469
1492
|
} from "@ai-sdk/provider-utils";
|
|
1470
|
-
import { z as
|
|
1471
|
-
var googleSearch =
|
|
1493
|
+
import { z as z8 } from "zod/v4";
|
|
1494
|
+
var googleSearch = createProviderToolFactory4({
|
|
1472
1495
|
id: "google.google_search",
|
|
1473
|
-
inputSchema:
|
|
1474
|
-
() =>
|
|
1475
|
-
|
|
1476
|
-
mode:
|
|
1477
|
-
dynamicThreshold:
|
|
1496
|
+
inputSchema: lazySchema7(
|
|
1497
|
+
() => zodSchema7(
|
|
1498
|
+
z8.object({
|
|
1499
|
+
mode: z8.enum(["MODE_DYNAMIC", "MODE_UNSPECIFIED"]).default("MODE_UNSPECIFIED"),
|
|
1500
|
+
dynamicThreshold: z8.number().default(1)
|
|
1478
1501
|
})
|
|
1479
1502
|
)
|
|
1480
1503
|
)
|
|
@@ -1482,24 +1505,24 @@ var googleSearch = createProviderToolFactory3({
|
|
|
1482
1505
|
|
|
1483
1506
|
// src/tool/url-context.ts
|
|
1484
1507
|
import {
|
|
1485
|
-
createProviderToolFactory as
|
|
1486
|
-
lazySchema as
|
|
1487
|
-
zodSchema as
|
|
1508
|
+
createProviderToolFactory as createProviderToolFactory5,
|
|
1509
|
+
lazySchema as lazySchema8,
|
|
1510
|
+
zodSchema as zodSchema8
|
|
1488
1511
|
} from "@ai-sdk/provider-utils";
|
|
1489
|
-
import { z as
|
|
1490
|
-
var urlContext =
|
|
1512
|
+
import { z as z9 } from "zod/v4";
|
|
1513
|
+
var urlContext = createProviderToolFactory5({
|
|
1491
1514
|
id: "google.url_context",
|
|
1492
|
-
inputSchema:
|
|
1515
|
+
inputSchema: lazySchema8(() => zodSchema8(z9.object({})))
|
|
1493
1516
|
});
|
|
1494
1517
|
|
|
1495
1518
|
// src/tool/vertex-rag-store.ts
|
|
1496
|
-
import { createProviderToolFactory as
|
|
1497
|
-
import { z as
|
|
1498
|
-
var vertexRagStore =
|
|
1519
|
+
import { createProviderToolFactory as createProviderToolFactory6 } from "@ai-sdk/provider-utils";
|
|
1520
|
+
import { z as z10 } from "zod/v4";
|
|
1521
|
+
var vertexRagStore = createProviderToolFactory6({
|
|
1499
1522
|
id: "google.vertex_rag_store",
|
|
1500
|
-
inputSchema:
|
|
1501
|
-
ragCorpus:
|
|
1502
|
-
topK:
|
|
1523
|
+
inputSchema: z10.object({
|
|
1524
|
+
ragCorpus: z10.string(),
|
|
1525
|
+
topK: z10.number().optional()
|
|
1503
1526
|
})
|
|
1504
1527
|
});
|
|
1505
1528
|
|
|
@@ -1510,6 +1533,17 @@ var googleTools = {
|
|
|
1510
1533
|
* Must have name "google_search".
|
|
1511
1534
|
*/
|
|
1512
1535
|
googleSearch,
|
|
1536
|
+
/**
|
|
1537
|
+
* Creates an Enterprise Web Search tool for grounding responses using a compliance-focused web index.
|
|
1538
|
+
* Designed for highly-regulated industries (finance, healthcare, public sector).
|
|
1539
|
+
* Does not log customer data and supports VPC service controls.
|
|
1540
|
+
* Must have name "enterprise_web_search".
|
|
1541
|
+
*
|
|
1542
|
+
* @note Only available on Vertex AI. Requires Gemini 2.0 or newer.
|
|
1543
|
+
*
|
|
1544
|
+
* @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/web-grounding-enterprise
|
|
1545
|
+
*/
|
|
1546
|
+
enterpriseWebSearch,
|
|
1513
1547
|
/**
|
|
1514
1548
|
* Creates a Google Maps grounding tool that gives the model access to Google Maps data.
|
|
1515
1549
|
* Must have name "google_maps".
|