@ai-sdk/google 3.0.0-beta.60 → 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.
@@ -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.ProviderDefinedToolFactory<{}, {
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.ProviderDefinedToolFactory<{}, {}>;
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.ProviderDefinedToolFactory<{}, {
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.ProviderDefinedToolFactoryWithOutputSchema<{
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.ProviderDefinedToolFactory<{}, {
225
+ vertexRagStore: _ai_sdk_provider_utils.ProviderToolFactory<{}, {
226
226
  ragCorpus: string;
227
227
  topK?: number;
228
228
  }>;
@@ -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.ProviderDefinedToolFactory<{}, {
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.ProviderDefinedToolFactory<{}, {}>;
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.ProviderDefinedToolFactory<{}, {
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.ProviderDefinedToolFactoryWithOutputSchema<{
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.ProviderDefinedToolFactory<{}, {
225
+ vertexRagStore: _ai_sdk_provider_utils.ProviderToolFactory<{}, {
226
226
  ragCorpus: string;
227
227
  topK?: number;
228
228
  }>;
@@ -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 hasProviderDefinedTools = tools.some(
450
- (tool) => tool.type === "provider-defined"
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 (hasProviderDefinedTools) {
456
+ if (hasProviderTools) {
459
457
  const googleTools2 = [];
460
- const providerDefinedTools = tools.filter(
461
- (tool) => tool.type === "provider-defined"
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-defined" && tool.id === "google.vertex_rag_store"
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,9 +1321,8 @@ 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.createProviderDefinedToolFactoryWithOutputSchema)({
1324
+ var codeExecution = (0, import_provider_utils5.createProviderToolFactoryWithOutputSchema)({
1329
1325
  id: "google.code_execution",
1330
- name: "code_execution",
1331
1326
  inputSchema: import_v44.z.object({
1332
1327
  language: import_v44.z.string().describe("The programming language of the code."),
1333
1328
  code: import_v44.z.string().describe("The code to be executed.")
@@ -1360,18 +1355,16 @@ var fileSearchArgsBaseSchema = import_v45.z.object({
1360
1355
  var fileSearchArgsSchema = (0, import_provider_utils6.lazySchema)(
1361
1356
  () => (0, import_provider_utils6.zodSchema)(fileSearchArgsBaseSchema)
1362
1357
  );
1363
- var fileSearch = (0, import_provider_utils6.createProviderDefinedToolFactory)({
1358
+ var fileSearch = (0, import_provider_utils6.createProviderToolFactory)({
1364
1359
  id: "google.file_search",
1365
- name: "file_search",
1366
1360
  inputSchema: fileSearchArgsSchema
1367
1361
  });
1368
1362
 
1369
1363
  // src/tool/google-search.ts
1370
1364
  var import_provider_utils7 = require("@ai-sdk/provider-utils");
1371
1365
  var import_v46 = require("zod/v4");
1372
- var googleSearch = (0, import_provider_utils7.createProviderDefinedToolFactory)({
1366
+ var googleSearch = (0, import_provider_utils7.createProviderToolFactory)({
1373
1367
  id: "google.google_search",
1374
- name: "google_search",
1375
1368
  inputSchema: (0, import_provider_utils7.lazySchema)(
1376
1369
  () => (0, import_provider_utils7.zodSchema)(
1377
1370
  import_v46.z.object({
@@ -1385,18 +1378,16 @@ var googleSearch = (0, import_provider_utils7.createProviderDefinedToolFactory)(
1385
1378
  // src/tool/url-context.ts
1386
1379
  var import_provider_utils8 = require("@ai-sdk/provider-utils");
1387
1380
  var import_v47 = require("zod/v4");
1388
- var urlContext = (0, import_provider_utils8.createProviderDefinedToolFactory)({
1381
+ var urlContext = (0, import_provider_utils8.createProviderToolFactory)({
1389
1382
  id: "google.url_context",
1390
- name: "url_context",
1391
1383
  inputSchema: (0, import_provider_utils8.lazySchema)(() => (0, import_provider_utils8.zodSchema)(import_v47.z.object({})))
1392
1384
  });
1393
1385
 
1394
1386
  // src/tool/vertex-rag-store.ts
1395
1387
  var import_provider_utils9 = require("@ai-sdk/provider-utils");
1396
1388
  var import_v48 = require("zod/v4");
1397
- var vertexRagStore = (0, import_provider_utils9.createProviderDefinedToolFactory)({
1389
+ var vertexRagStore = (0, import_provider_utils9.createProviderToolFactory)({
1398
1390
  id: "google.vertex_rag_store",
1399
- name: "vertex_rag_store",
1400
1391
  inputSchema: import_v48.z.object({
1401
1392
  ragCorpus: import_v48.z.string(),
1402
1393
  topK: import_v48.z.number().optional()