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