@ai-sdk/xai 2.0.81 → 2.0.83
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 +12 -0
- package/dist/index.js +39 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ai-sdk/xai
|
|
2
2
|
|
|
3
|
+
## 2.0.83
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 54beea0: Warn when xAI Responses models ignore unsupported sampling settings.
|
|
8
|
+
|
|
9
|
+
## 2.0.82
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 64a6152: fix(provider/xai): preserve images in Responses API tool results
|
|
14
|
+
|
|
3
15
|
## 2.0.81
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -1410,12 +1410,27 @@ async function convertToXaiResponsesInput({
|
|
|
1410
1410
|
outputValue = JSON.stringify(output.value);
|
|
1411
1411
|
break;
|
|
1412
1412
|
case "content":
|
|
1413
|
-
outputValue =
|
|
1414
|
-
|
|
1415
|
-
|
|
1413
|
+
outputValue = [];
|
|
1414
|
+
for (const item of output.value) {
|
|
1415
|
+
switch (item.type) {
|
|
1416
|
+
case "text": {
|
|
1417
|
+
outputValue.push({
|
|
1418
|
+
type: "input_text",
|
|
1419
|
+
text: item.text
|
|
1420
|
+
});
|
|
1421
|
+
break;
|
|
1422
|
+
}
|
|
1423
|
+
case "media": {
|
|
1424
|
+
if (item.mediaType.startsWith("image/")) {
|
|
1425
|
+
outputValue.push({
|
|
1426
|
+
type: "input_image",
|
|
1427
|
+
image_url: `data:${item.mediaType};base64,${item.data}`
|
|
1428
|
+
});
|
|
1429
|
+
}
|
|
1430
|
+
break;
|
|
1431
|
+
}
|
|
1416
1432
|
}
|
|
1417
|
-
|
|
1418
|
-
}).join("");
|
|
1433
|
+
}
|
|
1419
1434
|
break;
|
|
1420
1435
|
default: {
|
|
1421
1436
|
const _exhaustiveCheck = output;
|
|
@@ -1713,6 +1728,9 @@ var XaiResponsesLanguageModel = class {
|
|
|
1713
1728
|
maxOutputTokens,
|
|
1714
1729
|
temperature,
|
|
1715
1730
|
topP,
|
|
1731
|
+
topK,
|
|
1732
|
+
frequencyPenalty,
|
|
1733
|
+
presencePenalty,
|
|
1716
1734
|
stopSequences,
|
|
1717
1735
|
seed,
|
|
1718
1736
|
responseFormat,
|
|
@@ -1727,6 +1745,21 @@ var XaiResponsesLanguageModel = class {
|
|
|
1727
1745
|
providerOptions,
|
|
1728
1746
|
schema: xaiResponsesProviderOptions
|
|
1729
1747
|
})) != null ? _a : {};
|
|
1748
|
+
if (topK != null) {
|
|
1749
|
+
warnings.push({ type: "unsupported-setting", setting: "topK" });
|
|
1750
|
+
}
|
|
1751
|
+
if (frequencyPenalty != null) {
|
|
1752
|
+
warnings.push({
|
|
1753
|
+
type: "unsupported-setting",
|
|
1754
|
+
setting: "frequencyPenalty"
|
|
1755
|
+
});
|
|
1756
|
+
}
|
|
1757
|
+
if (presencePenalty != null) {
|
|
1758
|
+
warnings.push({
|
|
1759
|
+
type: "unsupported-setting",
|
|
1760
|
+
setting: "presencePenalty"
|
|
1761
|
+
});
|
|
1762
|
+
}
|
|
1730
1763
|
if (stopSequences != null) {
|
|
1731
1764
|
warnings.push({
|
|
1732
1765
|
type: "unsupported-setting",
|
|
@@ -2368,7 +2401,7 @@ var xaiTools = {
|
|
|
2368
2401
|
};
|
|
2369
2402
|
|
|
2370
2403
|
// src/version.ts
|
|
2371
|
-
var VERSION = true ? "2.0.
|
|
2404
|
+
var VERSION = true ? "2.0.83" : "0.0.0-test";
|
|
2372
2405
|
|
|
2373
2406
|
// src/xai-provider.ts
|
|
2374
2407
|
var xaiErrorStructure = {
|