@ai-sdk/xai 3.0.0-beta.44 → 3.0.0-beta.45
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 +10 -0
- package/dist/index.js +18 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -24
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -277,7 +277,10 @@ function prepareTools({
|
|
|
277
277
|
const xaiTools2 = [];
|
|
278
278
|
for (const tool of tools) {
|
|
279
279
|
if (tool.type === "provider-defined") {
|
|
280
|
-
toolWarnings.push({
|
|
280
|
+
toolWarnings.push({
|
|
281
|
+
type: "unsupported",
|
|
282
|
+
feature: `provider-defined tool ${tool.name}`
|
|
283
|
+
});
|
|
281
284
|
} else {
|
|
282
285
|
xaiTools2.push({
|
|
283
286
|
type: "function",
|
|
@@ -353,28 +356,16 @@ var XaiChatLanguageModel = class {
|
|
|
353
356
|
schema: xaiProviderOptions
|
|
354
357
|
})) != null ? _a : {};
|
|
355
358
|
if (topK != null) {
|
|
356
|
-
warnings.push({
|
|
357
|
-
type: "unsupported-setting",
|
|
358
|
-
setting: "topK"
|
|
359
|
-
});
|
|
359
|
+
warnings.push({ type: "unsupported", feature: "topK" });
|
|
360
360
|
}
|
|
361
361
|
if (frequencyPenalty != null) {
|
|
362
|
-
warnings.push({
|
|
363
|
-
type: "unsupported-setting",
|
|
364
|
-
setting: "frequencyPenalty"
|
|
365
|
-
});
|
|
362
|
+
warnings.push({ type: "unsupported", feature: "frequencyPenalty" });
|
|
366
363
|
}
|
|
367
364
|
if (presencePenalty != null) {
|
|
368
|
-
warnings.push({
|
|
369
|
-
type: "unsupported-setting",
|
|
370
|
-
setting: "presencePenalty"
|
|
371
|
-
});
|
|
365
|
+
warnings.push({ type: "unsupported", feature: "presencePenalty" });
|
|
372
366
|
}
|
|
373
367
|
if (stopSequences != null) {
|
|
374
|
-
warnings.push({
|
|
375
|
-
type: "unsupported-setting",
|
|
376
|
-
setting: "stopSequences"
|
|
377
|
-
});
|
|
368
|
+
warnings.push({ type: "unsupported", feature: "stopSequences" });
|
|
378
369
|
}
|
|
379
370
|
const { messages, warnings: messageWarnings } = convertToXaiChatMessages(prompt);
|
|
380
371
|
warnings.push(...messageWarnings);
|
|
@@ -1374,7 +1365,10 @@ async function prepareResponsesTools({
|
|
|
1374
1365
|
break;
|
|
1375
1366
|
}
|
|
1376
1367
|
default: {
|
|
1377
|
-
toolWarnings.push({
|
|
1368
|
+
toolWarnings.push({
|
|
1369
|
+
type: "unsupported",
|
|
1370
|
+
feature: `provider-defined tool ${tool.name}`
|
|
1371
|
+
});
|
|
1378
1372
|
break;
|
|
1379
1373
|
}
|
|
1380
1374
|
}
|
|
@@ -1453,7 +1447,10 @@ async function prepareResponsesTools({
|
|
|
1453
1447
|
toolWarnings
|
|
1454
1448
|
};
|
|
1455
1449
|
default:
|
|
1456
|
-
toolWarnings.push({
|
|
1450
|
+
toolWarnings.push({
|
|
1451
|
+
type: "unsupported",
|
|
1452
|
+
feature: `provider-defined tool ${selectedTool.name}`
|
|
1453
|
+
});
|
|
1457
1454
|
return { tools: xaiTools2, toolChoice: void 0, toolWarnings };
|
|
1458
1455
|
}
|
|
1459
1456
|
}
|
|
@@ -1504,10 +1501,7 @@ var XaiResponsesLanguageModel = class {
|
|
|
1504
1501
|
schema: xaiResponsesProviderOptions
|
|
1505
1502
|
})) != null ? _a : {};
|
|
1506
1503
|
if (stopSequences != null) {
|
|
1507
|
-
warnings.push({
|
|
1508
|
-
type: "unsupported-setting",
|
|
1509
|
-
setting: "stopSequences"
|
|
1510
|
-
});
|
|
1504
|
+
warnings.push({ type: "unsupported", feature: "stopSequences" });
|
|
1511
1505
|
}
|
|
1512
1506
|
const webSearchToolName = (_b = tools == null ? void 0 : tools.find(
|
|
1513
1507
|
(tool) => tool.type === "provider-defined" && tool.id === "xai.web_search"
|
|
@@ -2000,7 +1994,7 @@ var xaiTools = {
|
|
|
2000
1994
|
};
|
|
2001
1995
|
|
|
2002
1996
|
// src/version.ts
|
|
2003
|
-
var VERSION = true ? "3.0.0-beta.
|
|
1997
|
+
var VERSION = true ? "3.0.0-beta.45" : "0.0.0-test";
|
|
2004
1998
|
|
|
2005
1999
|
// src/xai-provider.ts
|
|
2006
2000
|
var xaiErrorStructure = {
|