@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/dist/index.mjs CHANGED
@@ -1279,12 +1279,42 @@ async function convertToXaiResponsesInput({
1279
1279
  outputValue = JSON.stringify(output.value);
1280
1280
  break;
1281
1281
  case "content":
1282
- outputValue = output.value.map((item) => {
1283
- if (item.type === "text") {
1284
- return item.text;
1282
+ outputValue = [];
1283
+ for (const item of output.value) {
1284
+ switch (item.type) {
1285
+ case "text": {
1286
+ outputValue.push({
1287
+ type: "input_text",
1288
+ text: item.text
1289
+ });
1290
+ break;
1291
+ }
1292
+ case "image-data": {
1293
+ outputValue.push({
1294
+ type: "input_image",
1295
+ image_url: `data:${item.mediaType};base64,${item.data}`
1296
+ });
1297
+ break;
1298
+ }
1299
+ case "image-url": {
1300
+ outputValue.push({
1301
+ type: "input_image",
1302
+ image_url: item.url
1303
+ });
1304
+ break;
1305
+ }
1306
+ case "file-data":
1307
+ case "file-url":
1308
+ case "file-id":
1309
+ case "image-file-id":
1310
+ case "custom": {
1311
+ break;
1312
+ }
1313
+ default: {
1314
+ const _exhaustiveCheck = item;
1315
+ }
1285
1316
  }
1286
- return "";
1287
- }).join("");
1317
+ }
1288
1318
  break;
1289
1319
  default: {
1290
1320
  const _exhaustiveCheck = output;
@@ -2912,7 +2942,7 @@ var xaiTools = {
2912
2942
  };
2913
2943
 
2914
2944
  // src/version.ts
2915
- var VERSION = true ? "3.0.110" : "0.0.0-test";
2945
+ var VERSION = true ? "3.0.111" : "0.0.0-test";
2916
2946
 
2917
2947
  // src/xai-video-model.ts
2918
2948
  import {