@ai-sdk/google 3.0.0-beta.61 → 3.0.0-beta.62
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 +9 -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
|
@@ -176,7 +176,7 @@ declare const googleTools: {
|
|
|
176
176
|
* Creates a Google search tool that gives Google direct access to real-time web content.
|
|
177
177
|
* Must have name "google_search".
|
|
178
178
|
*/
|
|
179
|
-
googleSearch: _ai_sdk_provider_utils.
|
|
179
|
+
googleSearch: _ai_sdk_provider_utils.ProviderToolFactory<{}, {
|
|
180
180
|
mode?: "MODE_DYNAMIC" | "MODE_UNSPECIFIED";
|
|
181
181
|
dynamicThreshold?: number;
|
|
182
182
|
}>;
|
|
@@ -184,7 +184,7 @@ declare const googleTools: {
|
|
|
184
184
|
* Creates a URL context tool that gives Google direct access to real-time web content.
|
|
185
185
|
* Must have name "url_context".
|
|
186
186
|
*/
|
|
187
|
-
urlContext: _ai_sdk_provider_utils.
|
|
187
|
+
urlContext: _ai_sdk_provider_utils.ProviderToolFactory<{}, {}>;
|
|
188
188
|
/**
|
|
189
189
|
* Enables Retrieval Augmented Generation (RAG) via the Gemini File Search tool.
|
|
190
190
|
* Must have name "file_search".
|
|
@@ -195,7 +195,7 @@ declare const googleTools: {
|
|
|
195
195
|
*
|
|
196
196
|
* @see https://ai.google.dev/gemini-api/docs/file-search
|
|
197
197
|
*/
|
|
198
|
-
fileSearch: _ai_sdk_provider_utils.
|
|
198
|
+
fileSearch: _ai_sdk_provider_utils.ProviderToolFactory<{}, {
|
|
199
199
|
[x: string]: unknown;
|
|
200
200
|
fileSearchStoreNames: string[];
|
|
201
201
|
topK?: number | undefined;
|
|
@@ -211,7 +211,7 @@ declare const googleTools: {
|
|
|
211
211
|
* @see https://ai.google.dev/gemini-api/docs/code-execution (Google AI)
|
|
212
212
|
* @see https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/code-execution-api (Vertex AI)
|
|
213
213
|
*/
|
|
214
|
-
codeExecution: _ai_sdk_provider_utils.
|
|
214
|
+
codeExecution: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
|
|
215
215
|
language: string;
|
|
216
216
|
code: string;
|
|
217
217
|
}, {
|
|
@@ -222,7 +222,7 @@ declare const googleTools: {
|
|
|
222
222
|
* Creates a Vertex RAG Store tool that enables the model to perform RAG searches against a Vertex RAG Store.
|
|
223
223
|
* Must have name "vertex_rag_store".
|
|
224
224
|
*/
|
|
225
|
-
vertexRagStore: _ai_sdk_provider_utils.
|
|
225
|
+
vertexRagStore: _ai_sdk_provider_utils.ProviderToolFactory<{}, {
|
|
226
226
|
ragCorpus: string;
|
|
227
227
|
topK?: number;
|
|
228
228
|
}>;
|
package/dist/internal/index.d.ts
CHANGED
|
@@ -176,7 +176,7 @@ declare const googleTools: {
|
|
|
176
176
|
* Creates a Google search tool that gives Google direct access to real-time web content.
|
|
177
177
|
* Must have name "google_search".
|
|
178
178
|
*/
|
|
179
|
-
googleSearch: _ai_sdk_provider_utils.
|
|
179
|
+
googleSearch: _ai_sdk_provider_utils.ProviderToolFactory<{}, {
|
|
180
180
|
mode?: "MODE_DYNAMIC" | "MODE_UNSPECIFIED";
|
|
181
181
|
dynamicThreshold?: number;
|
|
182
182
|
}>;
|
|
@@ -184,7 +184,7 @@ declare const googleTools: {
|
|
|
184
184
|
* Creates a URL context tool that gives Google direct access to real-time web content.
|
|
185
185
|
* Must have name "url_context".
|
|
186
186
|
*/
|
|
187
|
-
urlContext: _ai_sdk_provider_utils.
|
|
187
|
+
urlContext: _ai_sdk_provider_utils.ProviderToolFactory<{}, {}>;
|
|
188
188
|
/**
|
|
189
189
|
* Enables Retrieval Augmented Generation (RAG) via the Gemini File Search tool.
|
|
190
190
|
* Must have name "file_search".
|
|
@@ -195,7 +195,7 @@ declare const googleTools: {
|
|
|
195
195
|
*
|
|
196
196
|
* @see https://ai.google.dev/gemini-api/docs/file-search
|
|
197
197
|
*/
|
|
198
|
-
fileSearch: _ai_sdk_provider_utils.
|
|
198
|
+
fileSearch: _ai_sdk_provider_utils.ProviderToolFactory<{}, {
|
|
199
199
|
[x: string]: unknown;
|
|
200
200
|
fileSearchStoreNames: string[];
|
|
201
201
|
topK?: number | undefined;
|
|
@@ -211,7 +211,7 @@ declare const googleTools: {
|
|
|
211
211
|
* @see https://ai.google.dev/gemini-api/docs/code-execution (Google AI)
|
|
212
212
|
* @see https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/code-execution-api (Vertex AI)
|
|
213
213
|
*/
|
|
214
|
-
codeExecution: _ai_sdk_provider_utils.
|
|
214
|
+
codeExecution: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{
|
|
215
215
|
language: string;
|
|
216
216
|
code: string;
|
|
217
217
|
}, {
|
|
@@ -222,7 +222,7 @@ declare const googleTools: {
|
|
|
222
222
|
* Creates a Vertex RAG Store tool that enables the model to perform RAG searches against a Vertex RAG Store.
|
|
223
223
|
* Must have name "vertex_rag_store".
|
|
224
224
|
*/
|
|
225
|
-
vertexRagStore: _ai_sdk_provider_utils.
|
|
225
|
+
vertexRagStore: _ai_sdk_provider_utils.ProviderToolFactory<{}, {
|
|
226
226
|
ragCorpus: string;
|
|
227
227
|
topK?: number;
|
|
228
228
|
}>;
|
package/dist/internal/index.js
CHANGED
|
@@ -446,21 +446,17 @@ function prepareTools({
|
|
|
446
446
|
return { tools: void 0, toolConfig: void 0, toolWarnings };
|
|
447
447
|
}
|
|
448
448
|
const hasFunctionTools = tools.some((tool) => tool.type === "function");
|
|
449
|
-
const
|
|
450
|
-
|
|
451
|
-
);
|
|
452
|
-
if (hasFunctionTools && hasProviderDefinedTools) {
|
|
449
|
+
const hasProviderTools = tools.some((tool) => tool.type === "provider");
|
|
450
|
+
if (hasFunctionTools && hasProviderTools) {
|
|
453
451
|
toolWarnings.push({
|
|
454
452
|
type: "unsupported",
|
|
455
453
|
feature: `combination of function and provider-defined tools`
|
|
456
454
|
});
|
|
457
455
|
}
|
|
458
|
-
if (
|
|
456
|
+
if (hasProviderTools) {
|
|
459
457
|
const googleTools2 = [];
|
|
460
|
-
const
|
|
461
|
-
|
|
462
|
-
);
|
|
463
|
-
providerDefinedTools.forEach((tool) => {
|
|
458
|
+
const ProviderTools = tools.filter((tool) => tool.type === "provider");
|
|
459
|
+
ProviderTools.forEach((tool) => {
|
|
464
460
|
switch (tool.id) {
|
|
465
461
|
case "google.google_search":
|
|
466
462
|
if (isGemini2orNewer) {
|
|
@@ -676,7 +672,7 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
676
672
|
schema: googleGenerativeAIProviderOptions
|
|
677
673
|
});
|
|
678
674
|
if ((tools == null ? void 0 : tools.some(
|
|
679
|
-
(tool) => tool.type === "provider
|
|
675
|
+
(tool) => tool.type === "provider" && tool.id === "google.vertex_rag_store"
|
|
680
676
|
)) && !this.config.provider.startsWith("google.vertex.")) {
|
|
681
677
|
warnings.push({
|
|
682
678
|
type: "other",
|
|
@@ -1325,7 +1321,7 @@ var chunkSchema = (0, import_provider_utils4.lazySchema)(
|
|
|
1325
1321
|
// src/tool/code-execution.ts
|
|
1326
1322
|
var import_provider_utils5 = require("@ai-sdk/provider-utils");
|
|
1327
1323
|
var import_v44 = require("zod/v4");
|
|
1328
|
-
var codeExecution = (0, import_provider_utils5.
|
|
1324
|
+
var codeExecution = (0, import_provider_utils5.createProviderToolFactoryWithOutputSchema)({
|
|
1329
1325
|
id: "google.code_execution",
|
|
1330
1326
|
inputSchema: import_v44.z.object({
|
|
1331
1327
|
language: import_v44.z.string().describe("The programming language of the code."),
|
|
@@ -1359,7 +1355,7 @@ var fileSearchArgsBaseSchema = import_v45.z.object({
|
|
|
1359
1355
|
var fileSearchArgsSchema = (0, import_provider_utils6.lazySchema)(
|
|
1360
1356
|
() => (0, import_provider_utils6.zodSchema)(fileSearchArgsBaseSchema)
|
|
1361
1357
|
);
|
|
1362
|
-
var fileSearch = (0, import_provider_utils6.
|
|
1358
|
+
var fileSearch = (0, import_provider_utils6.createProviderToolFactory)({
|
|
1363
1359
|
id: "google.file_search",
|
|
1364
1360
|
inputSchema: fileSearchArgsSchema
|
|
1365
1361
|
});
|
|
@@ -1367,7 +1363,7 @@ var fileSearch = (0, import_provider_utils6.createProviderDefinedToolFactory)({
|
|
|
1367
1363
|
// src/tool/google-search.ts
|
|
1368
1364
|
var import_provider_utils7 = require("@ai-sdk/provider-utils");
|
|
1369
1365
|
var import_v46 = require("zod/v4");
|
|
1370
|
-
var googleSearch = (0, import_provider_utils7.
|
|
1366
|
+
var googleSearch = (0, import_provider_utils7.createProviderToolFactory)({
|
|
1371
1367
|
id: "google.google_search",
|
|
1372
1368
|
inputSchema: (0, import_provider_utils7.lazySchema)(
|
|
1373
1369
|
() => (0, import_provider_utils7.zodSchema)(
|
|
@@ -1382,7 +1378,7 @@ var googleSearch = (0, import_provider_utils7.createProviderDefinedToolFactory)(
|
|
|
1382
1378
|
// src/tool/url-context.ts
|
|
1383
1379
|
var import_provider_utils8 = require("@ai-sdk/provider-utils");
|
|
1384
1380
|
var import_v47 = require("zod/v4");
|
|
1385
|
-
var urlContext = (0, import_provider_utils8.
|
|
1381
|
+
var urlContext = (0, import_provider_utils8.createProviderToolFactory)({
|
|
1386
1382
|
id: "google.url_context",
|
|
1387
1383
|
inputSchema: (0, import_provider_utils8.lazySchema)(() => (0, import_provider_utils8.zodSchema)(import_v47.z.object({})))
|
|
1388
1384
|
});
|
|
@@ -1390,7 +1386,7 @@ var urlContext = (0, import_provider_utils8.createProviderDefinedToolFactory)({
|
|
|
1390
1386
|
// src/tool/vertex-rag-store.ts
|
|
1391
1387
|
var import_provider_utils9 = require("@ai-sdk/provider-utils");
|
|
1392
1388
|
var import_v48 = require("zod/v4");
|
|
1393
|
-
var vertexRagStore = (0, import_provider_utils9.
|
|
1389
|
+
var vertexRagStore = (0, import_provider_utils9.createProviderToolFactory)({
|
|
1394
1390
|
id: "google.vertex_rag_store",
|
|
1395
1391
|
inputSchema: import_v48.z.object({
|
|
1396
1392
|
ragCorpus: import_v48.z.string(),
|