@ai-sdk/xai 2.0.50 → 2.0.51

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
@@ -1602,11 +1602,12 @@ var XaiResponsesLanguageModel = class {
1602
1602
  topP,
1603
1603
  stopSequences,
1604
1604
  seed,
1605
+ responseFormat,
1605
1606
  providerOptions,
1606
1607
  tools,
1607
1608
  toolChoice
1608
1609
  }) {
1609
- var _a, _b, _c, _d;
1610
+ var _a, _b, _c, _d, _e;
1610
1611
  const warnings = [];
1611
1612
  const options = (_a = await parseProviderOptions2({
1612
1613
  provider: "xai",
@@ -1649,6 +1650,17 @@ var XaiResponsesLanguageModel = class {
1649
1650
  temperature,
1650
1651
  top_p: topP,
1651
1652
  seed,
1653
+ ...(responseFormat == null ? void 0 : responseFormat.type) === "json" && {
1654
+ text: {
1655
+ format: responseFormat.schema != null ? {
1656
+ type: "json_schema",
1657
+ strict: true,
1658
+ name: (_e = responseFormat.name) != null ? _e : "response",
1659
+ description: responseFormat.description,
1660
+ schema: responseFormat.schema
1661
+ } : { type: "json_object" }
1662
+ }
1663
+ },
1652
1664
  ...options.reasoningEffort != null && {
1653
1665
  reasoning: { effort: options.reasoningEffort }
1654
1666
  },
@@ -2113,7 +2125,7 @@ var xaiTools = {
2113
2125
  };
2114
2126
 
2115
2127
  // src/version.ts
2116
- var VERSION = true ? "2.0.50" : "0.0.0-test";
2128
+ var VERSION = true ? "2.0.51" : "0.0.0-test";
2117
2129
 
2118
2130
  // src/xai-provider.ts
2119
2131
  var xaiErrorStructure = {