@ai-sdk/xai 3.0.110 → 3.0.112

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,17 @@
1
1
  # @ai-sdk/xai
2
2
 
3
+ ## 3.0.112
4
+
5
+ ### Patch Changes
6
+
7
+ - e4f8b5b: Warn when xAI Responses models ignore unsupported sampling settings.
8
+
9
+ ## 3.0.111
10
+
11
+ ### Patch Changes
12
+
13
+ - 05ce9c0: fix(provider/xai): preserve images in Responses API tool results
14
+
3
15
  ## 3.0.110
4
16
 
5
17
  ### 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;
@@ -2120,6 +2150,9 @@ var XaiResponsesLanguageModel = class {
2120
2150
  maxOutputTokens,
2121
2151
  temperature,
2122
2152
  topP,
2153
+ topK,
2154
+ frequencyPenalty,
2155
+ presencePenalty,
2123
2156
  stopSequences,
2124
2157
  seed,
2125
2158
  responseFormat,
@@ -2134,6 +2167,15 @@ var XaiResponsesLanguageModel = class {
2134
2167
  providerOptions,
2135
2168
  schema: xaiLanguageModelResponsesOptions
2136
2169
  })) != null ? _a : {};
2170
+ if (topK != null) {
2171
+ warnings.push({ type: "unsupported", feature: "topK" });
2172
+ }
2173
+ if (frequencyPenalty != null) {
2174
+ warnings.push({ type: "unsupported", feature: "frequencyPenalty" });
2175
+ }
2176
+ if (presencePenalty != null) {
2177
+ warnings.push({ type: "unsupported", feature: "presencePenalty" });
2178
+ }
2137
2179
  if (stopSequences != null) {
2138
2180
  warnings.push({ type: "unsupported", feature: "stopSequences" });
2139
2181
  }
@@ -2891,7 +2933,7 @@ var xaiTools = {
2891
2933
  };
2892
2934
 
2893
2935
  // src/version.ts
2894
- var VERSION = true ? "3.0.110" : "0.0.0-test";
2936
+ var VERSION = true ? "3.0.112" : "0.0.0-test";
2895
2937
 
2896
2938
  // src/xai-video-model.ts
2897
2939
  var import_provider6 = require("@ai-sdk/provider");