@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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @ai-sdk/google
|
|
2
2
|
|
|
3
|
+
## 3.0.0-beta.63
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [1bd7d32]
|
|
8
|
+
- @ai-sdk/provider-utils@4.0.0-beta.41
|
|
9
|
+
- @ai-sdk/provider@3.0.0-beta.23
|
|
10
|
+
|
|
11
|
+
## 3.0.0-beta.62
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 544d4e8: chore(specification): rename v3 provider defined tool to provider tool
|
|
16
|
+
- Updated dependencies [544d4e8]
|
|
17
|
+
- @ai-sdk/provider-utils@4.0.0-beta.40
|
|
18
|
+
- @ai-sdk/provider@3.0.0-beta.22
|
|
19
|
+
|
|
3
20
|
## 3.0.0-beta.61
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -174,7 +174,7 @@ declare const googleTools: {
|
|
|
174
174
|
* Creates a Google search tool that gives Google direct access to real-time web content.
|
|
175
175
|
* Must have name "google_search".
|
|
176
176
|
*/
|
|
177
|
-
googleSearch: _ai_sdk_provider_utils.
|
|
177
|
+
googleSearch: _ai_sdk_provider_utils.ProviderToolFactory<{}, {
|
|
178
178
|
mode?: "MODE_DYNAMIC" | "MODE_UNSPECIFIED";
|
|
179
179
|
dynamicThreshold?: number;
|
|
180
180
|
}>;
|
|
@@ -182,7 +182,7 @@ declare const googleTools: {
|
|
|
182
182
|
* Creates a URL context tool that gives Google direct access to real-time web content.
|
|
183
183
|
* Must have name "url_context".
|
|
184
184
|
*/
|
|
185
|
-
urlContext: _ai_sdk_provider_utils.
|
|
185
|
+
urlContext: _ai_sdk_provider_utils.ProviderToolFactory<{}, {}>;
|
|
186
186
|
/**
|
|
187
187
|
* Enables Retrieval Augmented Generation (RAG) via the Gemini File Search tool.
|
|
188
188
|
* Must have name "file_search".
|
|
@@ -193,7 +193,7 @@ declare const googleTools: {
|
|
|
193
193
|
*
|
|
194
194
|
* @see https://ai.google.dev/gemini-api/docs/file-search
|
|
195
195
|
*/
|
|
196
|
-
fileSearch: _ai_sdk_provider_utils.
|
|
196
|
+
fileSearch: _ai_sdk_provider_utils.ProviderToolFactory<{}, {
|
|
197
197
|
[x: string]: unknown;
|
|
198
198
|
fileSearchStoreNames: string[];
|
|
199
199
|
topK?: number | undefined;
|
|
@@ -209,7 +209,7 @@ declare const googleTools: {
|
|
|
209
209
|
* @see https://ai.google.dev/gemini-api/docs/code-execution (Google AI)
|
|
210
210
|
* @see https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/code-execution-api (Vertex AI)
|
|
211
211
|
*/
|
|
212
|
-
codeExecution: _ai_sdk_provider_utils.
|
|
212
|
+
codeExecution: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
|
|
213
213
|
language: string;
|
|
214
214
|
code: string;
|
|
215
215
|
}, {
|
|
@@ -220,7 +220,7 @@ declare const googleTools: {
|
|
|
220
220
|
* Creates a Vertex RAG Store tool that enables the model to perform RAG searches against a Vertex RAG Store.
|
|
221
221
|
* Must have name "vertex_rag_store".
|
|
222
222
|
*/
|
|
223
|
-
vertexRagStore: _ai_sdk_provider_utils.
|
|
223
|
+
vertexRagStore: _ai_sdk_provider_utils.ProviderToolFactory<{}, {
|
|
224
224
|
ragCorpus: string;
|
|
225
225
|
topK?: number;
|
|
226
226
|
}>;
|
package/dist/index.d.ts
CHANGED
|
@@ -174,7 +174,7 @@ declare const googleTools: {
|
|
|
174
174
|
* Creates a Google search tool that gives Google direct access to real-time web content.
|
|
175
175
|
* Must have name "google_search".
|
|
176
176
|
*/
|
|
177
|
-
googleSearch: _ai_sdk_provider_utils.
|
|
177
|
+
googleSearch: _ai_sdk_provider_utils.ProviderToolFactory<{}, {
|
|
178
178
|
mode?: "MODE_DYNAMIC" | "MODE_UNSPECIFIED";
|
|
179
179
|
dynamicThreshold?: number;
|
|
180
180
|
}>;
|
|
@@ -182,7 +182,7 @@ declare const googleTools: {
|
|
|
182
182
|
* Creates a URL context tool that gives Google direct access to real-time web content.
|
|
183
183
|
* Must have name "url_context".
|
|
184
184
|
*/
|
|
185
|
-
urlContext: _ai_sdk_provider_utils.
|
|
185
|
+
urlContext: _ai_sdk_provider_utils.ProviderToolFactory<{}, {}>;
|
|
186
186
|
/**
|
|
187
187
|
* Enables Retrieval Augmented Generation (RAG) via the Gemini File Search tool.
|
|
188
188
|
* Must have name "file_search".
|
|
@@ -193,7 +193,7 @@ declare const googleTools: {
|
|
|
193
193
|
*
|
|
194
194
|
* @see https://ai.google.dev/gemini-api/docs/file-search
|
|
195
195
|
*/
|
|
196
|
-
fileSearch: _ai_sdk_provider_utils.
|
|
196
|
+
fileSearch: _ai_sdk_provider_utils.ProviderToolFactory<{}, {
|
|
197
197
|
[x: string]: unknown;
|
|
198
198
|
fileSearchStoreNames: string[];
|
|
199
199
|
topK?: number | undefined;
|
|
@@ -209,7 +209,7 @@ declare const googleTools: {
|
|
|
209
209
|
* @see https://ai.google.dev/gemini-api/docs/code-execution (Google AI)
|
|
210
210
|
* @see https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/code-execution-api (Vertex AI)
|
|
211
211
|
*/
|
|
212
|
-
codeExecution: _ai_sdk_provider_utils.
|
|
212
|
+
codeExecution: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
|
|
213
213
|
language: string;
|
|
214
214
|
code: string;
|
|
215
215
|
}, {
|
|
@@ -220,7 +220,7 @@ declare const googleTools: {
|
|
|
220
220
|
* Creates a Vertex RAG Store tool that enables the model to perform RAG searches against a Vertex RAG Store.
|
|
221
221
|
* Must have name "vertex_rag_store".
|
|
222
222
|
*/
|
|
223
|
-
vertexRagStore: _ai_sdk_provider_utils.
|
|
223
|
+
vertexRagStore: _ai_sdk_provider_utils.ProviderToolFactory<{}, {
|
|
224
224
|
ragCorpus: string;
|
|
225
225
|
topK?: number;
|
|
226
226
|
}>;
|
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
30
30
|
var import_provider_utils13 = require("@ai-sdk/provider-utils");
|
|
31
31
|
|
|
32
32
|
// src/version.ts
|
|
33
|
-
var VERSION = true ? "3.0.0-beta.
|
|
33
|
+
var VERSION = true ? "3.0.0-beta.63" : "0.0.0-test";
|
|
34
34
|
|
|
35
35
|
// src/google-generative-ai-embedding-model.ts
|
|
36
36
|
var import_provider = require("@ai-sdk/provider");
|
|
@@ -601,21 +601,17 @@ function prepareTools({
|
|
|
601
601
|
return { tools: void 0, toolConfig: void 0, toolWarnings };
|
|
602
602
|
}
|
|
603
603
|
const hasFunctionTools = tools.some((tool) => tool.type === "function");
|
|
604
|
-
const
|
|
605
|
-
|
|
606
|
-
);
|
|
607
|
-
if (hasFunctionTools && hasProviderDefinedTools) {
|
|
604
|
+
const hasProviderTools = tools.some((tool) => tool.type === "provider");
|
|
605
|
+
if (hasFunctionTools && hasProviderTools) {
|
|
608
606
|
toolWarnings.push({
|
|
609
607
|
type: "unsupported",
|
|
610
608
|
feature: `combination of function and provider-defined tools`
|
|
611
609
|
});
|
|
612
610
|
}
|
|
613
|
-
if (
|
|
611
|
+
if (hasProviderTools) {
|
|
614
612
|
const googleTools2 = [];
|
|
615
|
-
const
|
|
616
|
-
|
|
617
|
-
);
|
|
618
|
-
providerDefinedTools.forEach((tool) => {
|
|
613
|
+
const ProviderTools = tools.filter((tool) => tool.type === "provider");
|
|
614
|
+
ProviderTools.forEach((tool) => {
|
|
619
615
|
switch (tool.id) {
|
|
620
616
|
case "google.google_search":
|
|
621
617
|
if (isGemini2orNewer) {
|
|
@@ -831,7 +827,7 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
831
827
|
schema: googleGenerativeAIProviderOptions
|
|
832
828
|
});
|
|
833
829
|
if ((tools == null ? void 0 : tools.some(
|
|
834
|
-
(tool) => tool.type === "provider
|
|
830
|
+
(tool) => tool.type === "provider" && tool.id === "google.vertex_rag_store"
|
|
835
831
|
)) && !this.config.provider.startsWith("google.vertex.")) {
|
|
836
832
|
warnings.push({
|
|
837
833
|
type: "other",
|
|
@@ -1480,7 +1476,7 @@ var chunkSchema = (0, import_provider_utils6.lazySchema)(
|
|
|
1480
1476
|
// src/tool/code-execution.ts
|
|
1481
1477
|
var import_provider_utils7 = require("@ai-sdk/provider-utils");
|
|
1482
1478
|
var import_v46 = require("zod/v4");
|
|
1483
|
-
var codeExecution = (0, import_provider_utils7.
|
|
1479
|
+
var codeExecution = (0, import_provider_utils7.createProviderToolFactoryWithOutputSchema)({
|
|
1484
1480
|
id: "google.code_execution",
|
|
1485
1481
|
inputSchema: import_v46.z.object({
|
|
1486
1482
|
language: import_v46.z.string().describe("The programming language of the code."),
|
|
@@ -1514,7 +1510,7 @@ var fileSearchArgsBaseSchema = import_v47.z.object({
|
|
|
1514
1510
|
var fileSearchArgsSchema = (0, import_provider_utils8.lazySchema)(
|
|
1515
1511
|
() => (0, import_provider_utils8.zodSchema)(fileSearchArgsBaseSchema)
|
|
1516
1512
|
);
|
|
1517
|
-
var fileSearch = (0, import_provider_utils8.
|
|
1513
|
+
var fileSearch = (0, import_provider_utils8.createProviderToolFactory)({
|
|
1518
1514
|
id: "google.file_search",
|
|
1519
1515
|
inputSchema: fileSearchArgsSchema
|
|
1520
1516
|
});
|
|
@@ -1522,7 +1518,7 @@ var fileSearch = (0, import_provider_utils8.createProviderDefinedToolFactory)({
|
|
|
1522
1518
|
// src/tool/google-search.ts
|
|
1523
1519
|
var import_provider_utils9 = require("@ai-sdk/provider-utils");
|
|
1524
1520
|
var import_v48 = require("zod/v4");
|
|
1525
|
-
var googleSearch = (0, import_provider_utils9.
|
|
1521
|
+
var googleSearch = (0, import_provider_utils9.createProviderToolFactory)({
|
|
1526
1522
|
id: "google.google_search",
|
|
1527
1523
|
inputSchema: (0, import_provider_utils9.lazySchema)(
|
|
1528
1524
|
() => (0, import_provider_utils9.zodSchema)(
|
|
@@ -1537,7 +1533,7 @@ var googleSearch = (0, import_provider_utils9.createProviderDefinedToolFactory)(
|
|
|
1537
1533
|
// src/tool/url-context.ts
|
|
1538
1534
|
var import_provider_utils10 = require("@ai-sdk/provider-utils");
|
|
1539
1535
|
var import_v49 = require("zod/v4");
|
|
1540
|
-
var urlContext = (0, import_provider_utils10.
|
|
1536
|
+
var urlContext = (0, import_provider_utils10.createProviderToolFactory)({
|
|
1541
1537
|
id: "google.url_context",
|
|
1542
1538
|
inputSchema: (0, import_provider_utils10.lazySchema)(() => (0, import_provider_utils10.zodSchema)(import_v49.z.object({})))
|
|
1543
1539
|
});
|
|
@@ -1545,7 +1541,7 @@ var urlContext = (0, import_provider_utils10.createProviderDefinedToolFactory)({
|
|
|
1545
1541
|
// src/tool/vertex-rag-store.ts
|
|
1546
1542
|
var import_provider_utils11 = require("@ai-sdk/provider-utils");
|
|
1547
1543
|
var import_v410 = require("zod/v4");
|
|
1548
|
-
var vertexRagStore = (0, import_provider_utils11.
|
|
1544
|
+
var vertexRagStore = (0, import_provider_utils11.createProviderToolFactory)({
|
|
1549
1545
|
id: "google.vertex_rag_store",
|
|
1550
1546
|
inputSchema: import_v410.z.object({
|
|
1551
1547
|
ragCorpus: import_v410.z.string(),
|