@ai-sdk/xai 3.0.13 → 3.0.14

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
@@ -1635,11 +1635,12 @@ var XaiResponsesLanguageModel = class {
1635
1635
  topP,
1636
1636
  stopSequences,
1637
1637
  seed,
1638
+ responseFormat,
1638
1639
  providerOptions,
1639
1640
  tools,
1640
1641
  toolChoice
1641
1642
  }) {
1642
- var _a, _b, _c, _d;
1643
+ var _a, _b, _c, _d, _e;
1643
1644
  const warnings = [];
1644
1645
  const options = (_a = await parseProviderOptions2({
1645
1646
  provider: "xai",
@@ -1679,6 +1680,17 @@ var XaiResponsesLanguageModel = class {
1679
1680
  temperature,
1680
1681
  top_p: topP,
1681
1682
  seed,
1683
+ ...(responseFormat == null ? void 0 : responseFormat.type) === "json" && {
1684
+ text: {
1685
+ format: responseFormat.schema != null ? {
1686
+ type: "json_schema",
1687
+ strict: true,
1688
+ name: (_e = responseFormat.name) != null ? _e : "response",
1689
+ description: responseFormat.description,
1690
+ schema: responseFormat.schema
1691
+ } : { type: "json_object" }
1692
+ }
1693
+ },
1682
1694
  ...options.reasoningEffort != null && {
1683
1695
  reasoning: { effort: options.reasoningEffort }
1684
1696
  },
@@ -2135,7 +2147,7 @@ var xaiTools = {
2135
2147
  };
2136
2148
 
2137
2149
  // src/version.ts
2138
- var VERSION = true ? "3.0.13" : "0.0.0-test";
2150
+ var VERSION = true ? "3.0.14" : "0.0.0-test";
2139
2151
 
2140
2152
  // src/xai-provider.ts
2141
2153
  var xaiErrorStructure = {