@ai-sdk/xai 3.0.5 → 3.0.7

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.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 23179aa: fix (provider/xai): use correct format for function tools
8
+
9
+ ## 3.0.6
10
+
11
+ ### Patch Changes
12
+
13
+ - 77012ef: fix(xai): correct token counting for reasoning models to prevent negative text_output_tokens
14
+
3
15
  ## 3.0.5
4
16
 
5
17
  ### Patch Changes
package/dist/index.js CHANGED
@@ -166,8 +166,8 @@ function convertXaiChatUsage(usage) {
166
166
  cacheWrite: void 0
167
167
  },
168
168
  outputTokens: {
169
- total: usage.completion_tokens + reasoningTokens,
170
- text: usage.completion_tokens,
169
+ total: usage.completion_tokens,
170
+ text: usage.completion_tokens - reasoningTokens,
171
171
  reasoning: reasoningTokens
172
172
  },
173
173
  raw: usage
@@ -1433,11 +1433,9 @@ async function prepareResponsesTools({
1433
1433
  } else {
1434
1434
  xaiTools2.push({
1435
1435
  type: "function",
1436
- function: {
1437
- name: tool.name,
1438
- description: tool.description,
1439
- parameters: tool.inputSchema
1440
- }
1436
+ name: tool.name,
1437
+ description: tool.description,
1438
+ parameters: tool.inputSchema
1441
1439
  });
1442
1440
  }
1443
1441
  }
@@ -2046,7 +2044,7 @@ var xaiTools = {
2046
2044
  };
2047
2045
 
2048
2046
  // src/version.ts
2049
- var VERSION = true ? "3.0.5" : "0.0.0-test";
2047
+ var VERSION = true ? "3.0.7" : "0.0.0-test";
2050
2048
 
2051
2049
  // src/xai-provider.ts
2052
2050
  var xaiErrorStructure = {