@ai-sdk/xai 3.0.0-beta.46 → 3.0.0-beta.48

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/dist/index.mjs CHANGED
@@ -276,7 +276,7 @@ function prepareTools({
276
276
  }
277
277
  const xaiTools2 = [];
278
278
  for (const tool of tools) {
279
- if (tool.type === "provider-defined") {
279
+ if (tool.type === "provider") {
280
280
  toolWarnings.push({
281
281
  type: "unsupported",
282
282
  feature: `provider-defined tool ${tool.name}`
@@ -1211,7 +1211,7 @@ import { validateTypes } from "@ai-sdk/provider-utils";
1211
1211
 
1212
1212
  // src/tool/web-search.ts
1213
1213
  import {
1214
- createProviderDefinedToolFactoryWithOutputSchema,
1214
+ createProviderToolFactoryWithOutputSchema,
1215
1215
  lazySchema,
1216
1216
  zodSchema
1217
1217
  } from "@ai-sdk/provider-utils";
@@ -1239,9 +1239,8 @@ var webSearchOutputSchema = lazySchema(
1239
1239
  })
1240
1240
  )
1241
1241
  );
1242
- var webSearchToolFactory = createProviderDefinedToolFactoryWithOutputSchema({
1242
+ var webSearchToolFactory = createProviderToolFactoryWithOutputSchema({
1243
1243
  id: "xai.web_search",
1244
- name: "web_search",
1245
1244
  inputSchema: lazySchema(() => zodSchema(z6.object({}))),
1246
1245
  outputSchema: webSearchOutputSchema
1247
1246
  });
@@ -1249,7 +1248,7 @@ var webSearch = (args = {}) => webSearchToolFactory(args);
1249
1248
 
1250
1249
  // src/tool/x-search.ts
1251
1250
  import {
1252
- createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema2,
1251
+ createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema2,
1253
1252
  lazySchema as lazySchema2,
1254
1253
  zodSchema as zodSchema2
1255
1254
  } from "@ai-sdk/provider-utils";
@@ -1281,9 +1280,8 @@ var xSearchOutputSchema = lazySchema2(
1281
1280
  })
1282
1281
  )
1283
1282
  );
1284
- var xSearchToolFactory = createProviderDefinedToolFactoryWithOutputSchema2({
1283
+ var xSearchToolFactory = createProviderToolFactoryWithOutputSchema2({
1285
1284
  id: "xai.x_search",
1286
- name: "x_search",
1287
1285
  inputSchema: lazySchema2(() => zodSchema2(z7.object({}))),
1288
1286
  outputSchema: xSearchOutputSchema
1289
1287
  });
@@ -1303,7 +1301,7 @@ async function prepareResponsesTools({
1303
1301
  const toolByName = /* @__PURE__ */ new Map();
1304
1302
  for (const tool of normalizedTools) {
1305
1303
  toolByName.set(tool.name, tool);
1306
- if (tool.type === "provider-defined") {
1304
+ if (tool.type === "provider") {
1307
1305
  switch (tool.id) {
1308
1306
  case "xai.web_search": {
1309
1307
  const args = await validateTypes({
@@ -1402,7 +1400,7 @@ async function prepareResponsesTools({
1402
1400
  toolWarnings
1403
1401
  };
1404
1402
  }
1405
- if (selectedTool.type === "provider-defined") {
1403
+ if (selectedTool.type === "provider") {
1406
1404
  switch (selectedTool.id) {
1407
1405
  case "xai.web_search":
1408
1406
  return {
@@ -1504,13 +1502,13 @@ var XaiResponsesLanguageModel = class {
1504
1502
  warnings.push({ type: "unsupported", feature: "stopSequences" });
1505
1503
  }
1506
1504
  const webSearchToolName = (_b = tools == null ? void 0 : tools.find(
1507
- (tool) => tool.type === "provider-defined" && tool.id === "xai.web_search"
1505
+ (tool) => tool.type === "provider" && tool.id === "xai.web_search"
1508
1506
  )) == null ? void 0 : _b.name;
1509
1507
  const xSearchToolName = (_c = tools == null ? void 0 : tools.find(
1510
- (tool) => tool.type === "provider-defined" && tool.id === "xai.x_search"
1508
+ (tool) => tool.type === "provider" && tool.id === "xai.x_search"
1511
1509
  )) == null ? void 0 : _c.name;
1512
1510
  const codeExecutionToolName = (_d = tools == null ? void 0 : tools.find(
1513
- (tool) => tool.type === "provider-defined" && tool.id === "xai.code_execution"
1511
+ (tool) => tool.type === "provider" && tool.id === "xai.code_execution"
1514
1512
  )) == null ? void 0 : _d.name;
1515
1513
  const { input, inputWarnings } = await convertToXaiResponsesInput({
1516
1514
  prompt,
@@ -1939,46 +1937,43 @@ var XaiResponsesLanguageModel = class {
1939
1937
  };
1940
1938
 
1941
1939
  // src/tool/code-execution.ts
1942
- import { createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema3 } from "@ai-sdk/provider-utils";
1940
+ import { createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema3 } from "@ai-sdk/provider-utils";
1943
1941
  import { z as z8 } from "zod/v4";
1944
1942
  var codeExecutionOutputSchema = z8.object({
1945
1943
  output: z8.string().describe("the output of the code execution"),
1946
1944
  error: z8.string().optional().describe("any error that occurred")
1947
1945
  });
1948
- var codeExecutionToolFactory = createProviderDefinedToolFactoryWithOutputSchema3({
1946
+ var codeExecutionToolFactory = createProviderToolFactoryWithOutputSchema3({
1949
1947
  id: "xai.code_execution",
1950
- name: "code_execution",
1951
1948
  inputSchema: z8.object({}).describe("no input parameters"),
1952
1949
  outputSchema: codeExecutionOutputSchema
1953
1950
  });
1954
1951
  var codeExecution = (args = {}) => codeExecutionToolFactory(args);
1955
1952
 
1956
1953
  // src/tool/view-image.ts
1957
- import { createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema4 } from "@ai-sdk/provider-utils";
1954
+ import { createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema4 } from "@ai-sdk/provider-utils";
1958
1955
  import { z as z9 } from "zod/v4";
1959
1956
  var viewImageOutputSchema = z9.object({
1960
1957
  description: z9.string().describe("description of the image"),
1961
1958
  objects: z9.array(z9.string()).optional().describe("objects detected in the image")
1962
1959
  });
1963
- var viewImageToolFactory = createProviderDefinedToolFactoryWithOutputSchema4({
1960
+ var viewImageToolFactory = createProviderToolFactoryWithOutputSchema4({
1964
1961
  id: "xai.view_image",
1965
- name: "view_image",
1966
1962
  inputSchema: z9.object({}).describe("no input parameters"),
1967
1963
  outputSchema: viewImageOutputSchema
1968
1964
  });
1969
1965
  var viewImage = (args = {}) => viewImageToolFactory(args);
1970
1966
 
1971
1967
  // src/tool/view-x-video.ts
1972
- import { createProviderDefinedToolFactoryWithOutputSchema as createProviderDefinedToolFactoryWithOutputSchema5 } from "@ai-sdk/provider-utils";
1968
+ import { createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5 } from "@ai-sdk/provider-utils";
1973
1969
  import { z as z10 } from "zod/v4";
1974
1970
  var viewXVideoOutputSchema = z10.object({
1975
1971
  transcript: z10.string().optional().describe("transcript of the video"),
1976
1972
  description: z10.string().describe("description of the video content"),
1977
1973
  duration: z10.number().optional().describe("duration in seconds")
1978
1974
  });
1979
- var viewXVideoToolFactory = createProviderDefinedToolFactoryWithOutputSchema5({
1975
+ var viewXVideoToolFactory = createProviderToolFactoryWithOutputSchema5({
1980
1976
  id: "xai.view_x_video",
1981
- name: "view_x_video",
1982
1977
  inputSchema: z10.object({}).describe("no input parameters"),
1983
1978
  outputSchema: viewXVideoOutputSchema
1984
1979
  });
@@ -1994,7 +1989,7 @@ var xaiTools = {
1994
1989
  };
1995
1990
 
1996
1991
  // src/version.ts
1997
- var VERSION = true ? "3.0.0-beta.46" : "0.0.0-test";
1992
+ var VERSION = true ? "3.0.0-beta.48" : "0.0.0-test";
1998
1993
 
1999
1994
  // src/xai-provider.ts
2000
1995
  var xaiErrorStructure = {