@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/dist/index.mjs CHANGED
@@ -1407,12 +1407,27 @@ async function convertToXaiResponsesInput({
1407
1407
  outputValue = JSON.stringify(output.value);
1408
1408
  break;
1409
1409
  case "content":
1410
- outputValue = output.value.map((item) => {
1411
- if (item.type === "text") {
1412
- return item.text;
1410
+ outputValue = [];
1411
+ for (const item of output.value) {
1412
+ switch (item.type) {
1413
+ case "text": {
1414
+ outputValue.push({
1415
+ type: "input_text",
1416
+ text: item.text
1417
+ });
1418
+ break;
1419
+ }
1420
+ case "media": {
1421
+ if (item.mediaType.startsWith("image/")) {
1422
+ outputValue.push({
1423
+ type: "input_image",
1424
+ image_url: `data:${item.mediaType};base64,${item.data}`
1425
+ });
1426
+ }
1427
+ break;
1428
+ }
1413
1429
  }
1414
- return "";
1415
- }).join("");
1430
+ }
1416
1431
  break;
1417
1432
  default: {
1418
1433
  const _exhaustiveCheck = output;
@@ -1720,6 +1735,9 @@ var XaiResponsesLanguageModel = class {
1720
1735
  maxOutputTokens,
1721
1736
  temperature,
1722
1737
  topP,
1738
+ topK,
1739
+ frequencyPenalty,
1740
+ presencePenalty,
1723
1741
  stopSequences,
1724
1742
  seed,
1725
1743
  responseFormat,
@@ -1734,6 +1752,21 @@ var XaiResponsesLanguageModel = class {
1734
1752
  providerOptions,
1735
1753
  schema: xaiResponsesProviderOptions
1736
1754
  })) != null ? _a : {};
1755
+ if (topK != null) {
1756
+ warnings.push({ type: "unsupported-setting", setting: "topK" });
1757
+ }
1758
+ if (frequencyPenalty != null) {
1759
+ warnings.push({
1760
+ type: "unsupported-setting",
1761
+ setting: "frequencyPenalty"
1762
+ });
1763
+ }
1764
+ if (presencePenalty != null) {
1765
+ warnings.push({
1766
+ type: "unsupported-setting",
1767
+ setting: "presencePenalty"
1768
+ });
1769
+ }
1737
1770
  if (stopSequences != null) {
1738
1771
  warnings.push({
1739
1772
  type: "unsupported-setting",
@@ -2375,7 +2408,7 @@ var xaiTools = {
2375
2408
  };
2376
2409
 
2377
2410
  // src/version.ts
2378
- var VERSION = true ? "2.0.81" : "0.0.0-test";
2411
+ var VERSION = true ? "2.0.83" : "0.0.0-test";
2379
2412
 
2380
2413
  // src/xai-provider.ts
2381
2414
  var xaiErrorStructure = {