@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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @ai-sdk/google
2
2
 
3
+ ## 3.0.0-beta.62
4
+
5
+ ### Patch Changes
6
+
7
+ - 544d4e8: chore(specification): rename v3 provider defined tool to provider tool
8
+ - Updated dependencies [544d4e8]
9
+ - @ai-sdk/provider-utils@4.0.0-beta.40
10
+ - @ai-sdk/provider@3.0.0-beta.22
11
+
12
+ ## 3.0.0-beta.61
13
+
14
+ ### Patch Changes
15
+
16
+ - 954c356: feat(openai): allow custom names for provider-defined tools
17
+ - Updated dependencies [954c356]
18
+ - @ai-sdk/provider-utils@4.0.0-beta.39
19
+ - @ai-sdk/provider@3.0.0-beta.21
20
+
3
21
  ## 3.0.0-beta.60
4
22
 
5
23
  ### 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.ProviderDefinedToolFactory<{}, {
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.ProviderDefinedToolFactory<{}, {}>;
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.ProviderDefinedToolFactory<{}, {
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.ProviderDefinedToolFactoryWithOutputSchema<{
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.ProviderDefinedToolFactory<{}, {
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.ProviderDefinedToolFactory<{}, {
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.ProviderDefinedToolFactory<{}, {}>;
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.ProviderDefinedToolFactory<{}, {
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.ProviderDefinedToolFactoryWithOutputSchema<{
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.ProviderDefinedToolFactory<{}, {
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.60" : "0.0.0-test";
33
+ var VERSION = true ? "3.0.0-beta.62" : "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 hasProviderDefinedTools = tools.some(
605
- (tool) => tool.type === "provider-defined"
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 (hasProviderDefinedTools) {
611
+ if (hasProviderTools) {
614
612
  const googleTools2 = [];
615
- const providerDefinedTools = tools.filter(
616
- (tool) => tool.type === "provider-defined"
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-defined" && tool.id === "google.vertex_rag_store"
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,9 +1476,8 @@ 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.createProviderDefinedToolFactoryWithOutputSchema)({
1479
+ var codeExecution = (0, import_provider_utils7.createProviderToolFactoryWithOutputSchema)({
1484
1480
  id: "google.code_execution",
1485
- name: "code_execution",
1486
1481
  inputSchema: import_v46.z.object({
1487
1482
  language: import_v46.z.string().describe("The programming language of the code."),
1488
1483
  code: import_v46.z.string().describe("The code to be executed.")
@@ -1515,18 +1510,16 @@ var fileSearchArgsBaseSchema = import_v47.z.object({
1515
1510
  var fileSearchArgsSchema = (0, import_provider_utils8.lazySchema)(
1516
1511
  () => (0, import_provider_utils8.zodSchema)(fileSearchArgsBaseSchema)
1517
1512
  );
1518
- var fileSearch = (0, import_provider_utils8.createProviderDefinedToolFactory)({
1513
+ var fileSearch = (0, import_provider_utils8.createProviderToolFactory)({
1519
1514
  id: "google.file_search",
1520
- name: "file_search",
1521
1515
  inputSchema: fileSearchArgsSchema
1522
1516
  });
1523
1517
 
1524
1518
  // src/tool/google-search.ts
1525
1519
  var import_provider_utils9 = require("@ai-sdk/provider-utils");
1526
1520
  var import_v48 = require("zod/v4");
1527
- var googleSearch = (0, import_provider_utils9.createProviderDefinedToolFactory)({
1521
+ var googleSearch = (0, import_provider_utils9.createProviderToolFactory)({
1528
1522
  id: "google.google_search",
1529
- name: "google_search",
1530
1523
  inputSchema: (0, import_provider_utils9.lazySchema)(
1531
1524
  () => (0, import_provider_utils9.zodSchema)(
1532
1525
  import_v48.z.object({
@@ -1540,18 +1533,16 @@ var googleSearch = (0, import_provider_utils9.createProviderDefinedToolFactory)(
1540
1533
  // src/tool/url-context.ts
1541
1534
  var import_provider_utils10 = require("@ai-sdk/provider-utils");
1542
1535
  var import_v49 = require("zod/v4");
1543
- var urlContext = (0, import_provider_utils10.createProviderDefinedToolFactory)({
1536
+ var urlContext = (0, import_provider_utils10.createProviderToolFactory)({
1544
1537
  id: "google.url_context",
1545
- name: "url_context",
1546
1538
  inputSchema: (0, import_provider_utils10.lazySchema)(() => (0, import_provider_utils10.zodSchema)(import_v49.z.object({})))
1547
1539
  });
1548
1540
 
1549
1541
  // src/tool/vertex-rag-store.ts
1550
1542
  var import_provider_utils11 = require("@ai-sdk/provider-utils");
1551
1543
  var import_v410 = require("zod/v4");
1552
- var vertexRagStore = (0, import_provider_utils11.createProviderDefinedToolFactory)({
1544
+ var vertexRagStore = (0, import_provider_utils11.createProviderToolFactory)({
1553
1545
  id: "google.vertex_rag_store",
1554
- name: "vertex_rag_store",
1555
1546
  inputSchema: import_v410.z.object({
1556
1547
  ragCorpus: import_v410.z.string(),
1557
1548
  topK: import_v410.z.number().optional()