@ai-sdk/xai 3.0.110 → 3.0.111

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,11 @@
1
1
  # @ai-sdk/xai
2
2
 
3
+ ## 3.0.111
4
+
5
+ ### Patch Changes
6
+
7
+ - 05ce9c0: fix(provider/xai): preserve images in Responses API tool results
8
+
3
9
  ## 3.0.110
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1276,12 +1276,42 @@ async function convertToXaiResponsesInput({
1276
1276
  outputValue = JSON.stringify(output.value);
1277
1277
  break;
1278
1278
  case "content":
1279
- outputValue = output.value.map((item) => {
1280
- if (item.type === "text") {
1281
- return item.text;
1279
+ outputValue = [];
1280
+ for (const item of output.value) {
1281
+ switch (item.type) {
1282
+ case "text": {
1283
+ outputValue.push({
1284
+ type: "input_text",
1285
+ text: item.text
1286
+ });
1287
+ break;
1288
+ }
1289
+ case "image-data": {
1290
+ outputValue.push({
1291
+ type: "input_image",
1292
+ image_url: `data:${item.mediaType};base64,${item.data}`
1293
+ });
1294
+ break;
1295
+ }
1296
+ case "image-url": {
1297
+ outputValue.push({
1298
+ type: "input_image",
1299
+ image_url: item.url
1300
+ });
1301
+ break;
1302
+ }
1303
+ case "file-data":
1304
+ case "file-url":
1305
+ case "file-id":
1306
+ case "image-file-id":
1307
+ case "custom": {
1308
+ break;
1309
+ }
1310
+ default: {
1311
+ const _exhaustiveCheck = item;
1312
+ }
1282
1313
  }
1283
- return "";
1284
- }).join("");
1314
+ }
1285
1315
  break;
1286
1316
  default: {
1287
1317
  const _exhaustiveCheck = output;
@@ -2891,7 +2921,7 @@ var xaiTools = {
2891
2921
  };
2892
2922
 
2893
2923
  // src/version.ts
2894
- var VERSION = true ? "3.0.110" : "0.0.0-test";
2924
+ var VERSION = true ? "3.0.111" : "0.0.0-test";
2895
2925
 
2896
2926
  // src/xai-video-model.ts
2897
2927
  var import_provider6 = require("@ai-sdk/provider");