@ai-sdk/google 3.0.0-beta.61 → 3.0.0-beta.63
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 +17 -0
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +12 -16
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -21
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +5 -5
- package/dist/internal/index.d.ts +5 -5
- package/dist/internal/index.js +11 -15
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +16 -20
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from "@ai-sdk/provider-utils";
|
|
8
8
|
|
|
9
9
|
// src/version.ts
|
|
10
|
-
var VERSION = true ? "3.0.0-beta.
|
|
10
|
+
var VERSION = true ? "3.0.0-beta.63" : "0.0.0-test";
|
|
11
11
|
|
|
12
12
|
// src/google-generative-ai-embedding-model.ts
|
|
13
13
|
import {
|
|
@@ -609,21 +609,17 @@ function prepareTools({
|
|
|
609
609
|
return { tools: void 0, toolConfig: void 0, toolWarnings };
|
|
610
610
|
}
|
|
611
611
|
const hasFunctionTools = tools.some((tool) => tool.type === "function");
|
|
612
|
-
const
|
|
613
|
-
|
|
614
|
-
);
|
|
615
|
-
if (hasFunctionTools && hasProviderDefinedTools) {
|
|
612
|
+
const hasProviderTools = tools.some((tool) => tool.type === "provider");
|
|
613
|
+
if (hasFunctionTools && hasProviderTools) {
|
|
616
614
|
toolWarnings.push({
|
|
617
615
|
type: "unsupported",
|
|
618
616
|
feature: `combination of function and provider-defined tools`
|
|
619
617
|
});
|
|
620
618
|
}
|
|
621
|
-
if (
|
|
619
|
+
if (hasProviderTools) {
|
|
622
620
|
const googleTools2 = [];
|
|
623
|
-
const
|
|
624
|
-
|
|
625
|
-
);
|
|
626
|
-
providerDefinedTools.forEach((tool) => {
|
|
621
|
+
const ProviderTools = tools.filter((tool) => tool.type === "provider");
|
|
622
|
+
ProviderTools.forEach((tool) => {
|
|
627
623
|
switch (tool.id) {
|
|
628
624
|
case "google.google_search":
|
|
629
625
|
if (isGemini2orNewer) {
|
|
@@ -839,7 +835,7 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
839
835
|
schema: googleGenerativeAIProviderOptions
|
|
840
836
|
});
|
|
841
837
|
if ((tools == null ? void 0 : tools.some(
|
|
842
|
-
(tool) => tool.type === "provider
|
|
838
|
+
(tool) => tool.type === "provider" && tool.id === "google.vertex_rag_store"
|
|
843
839
|
)) && !this.config.provider.startsWith("google.vertex.")) {
|
|
844
840
|
warnings.push({
|
|
845
841
|
type: "other",
|
|
@@ -1486,9 +1482,9 @@ var chunkSchema = lazySchema5(
|
|
|
1486
1482
|
);
|
|
1487
1483
|
|
|
1488
1484
|
// src/tool/code-execution.ts
|
|
1489
|
-
import {
|
|
1485
|
+
import { createProviderToolFactoryWithOutputSchema } from "@ai-sdk/provider-utils";
|
|
1490
1486
|
import { z as z6 } from "zod/v4";
|
|
1491
|
-
var codeExecution =
|
|
1487
|
+
var codeExecution = createProviderToolFactoryWithOutputSchema({
|
|
1492
1488
|
id: "google.code_execution",
|
|
1493
1489
|
inputSchema: z6.object({
|
|
1494
1490
|
language: z6.string().describe("The programming language of the code."),
|
|
@@ -1502,7 +1498,7 @@ var codeExecution = createProviderDefinedToolFactoryWithOutputSchema({
|
|
|
1502
1498
|
|
|
1503
1499
|
// src/tool/file-search.ts
|
|
1504
1500
|
import {
|
|
1505
|
-
|
|
1501
|
+
createProviderToolFactory,
|
|
1506
1502
|
lazySchema as lazySchema6,
|
|
1507
1503
|
zodSchema as zodSchema6
|
|
1508
1504
|
} from "@ai-sdk/provider-utils";
|
|
@@ -1526,19 +1522,19 @@ var fileSearchArgsBaseSchema = z7.object({
|
|
|
1526
1522
|
var fileSearchArgsSchema = lazySchema6(
|
|
1527
1523
|
() => zodSchema6(fileSearchArgsBaseSchema)
|
|
1528
1524
|
);
|
|
1529
|
-
var fileSearch =
|
|
1525
|
+
var fileSearch = createProviderToolFactory({
|
|
1530
1526
|
id: "google.file_search",
|
|
1531
1527
|
inputSchema: fileSearchArgsSchema
|
|
1532
1528
|
});
|
|
1533
1529
|
|
|
1534
1530
|
// src/tool/google-search.ts
|
|
1535
1531
|
import {
|
|
1536
|
-
|
|
1532
|
+
createProviderToolFactory as createProviderToolFactory2,
|
|
1537
1533
|
lazySchema as lazySchema7,
|
|
1538
1534
|
zodSchema as zodSchema7
|
|
1539
1535
|
} from "@ai-sdk/provider-utils";
|
|
1540
1536
|
import { z as z8 } from "zod/v4";
|
|
1541
|
-
var googleSearch =
|
|
1537
|
+
var googleSearch = createProviderToolFactory2({
|
|
1542
1538
|
id: "google.google_search",
|
|
1543
1539
|
inputSchema: lazySchema7(
|
|
1544
1540
|
() => zodSchema7(
|
|
@@ -1552,20 +1548,20 @@ var googleSearch = createProviderDefinedToolFactory2({
|
|
|
1552
1548
|
|
|
1553
1549
|
// src/tool/url-context.ts
|
|
1554
1550
|
import {
|
|
1555
|
-
|
|
1551
|
+
createProviderToolFactory as createProviderToolFactory3,
|
|
1556
1552
|
lazySchema as lazySchema8,
|
|
1557
1553
|
zodSchema as zodSchema8
|
|
1558
1554
|
} from "@ai-sdk/provider-utils";
|
|
1559
1555
|
import { z as z9 } from "zod/v4";
|
|
1560
|
-
var urlContext =
|
|
1556
|
+
var urlContext = createProviderToolFactory3({
|
|
1561
1557
|
id: "google.url_context",
|
|
1562
1558
|
inputSchema: lazySchema8(() => zodSchema8(z9.object({})))
|
|
1563
1559
|
});
|
|
1564
1560
|
|
|
1565
1561
|
// src/tool/vertex-rag-store.ts
|
|
1566
|
-
import {
|
|
1562
|
+
import { createProviderToolFactory as createProviderToolFactory4 } from "@ai-sdk/provider-utils";
|
|
1567
1563
|
import { z as z10 } from "zod/v4";
|
|
1568
|
-
var vertexRagStore =
|
|
1564
|
+
var vertexRagStore = createProviderToolFactory4({
|
|
1569
1565
|
id: "google.vertex_rag_store",
|
|
1570
1566
|
inputSchema: z10.object({
|
|
1571
1567
|
ragCorpus: z10.string(),
|