@ai-sdk/xai 3.0.5 → 3.0.6

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,11 @@
1
1
  # @ai-sdk/xai
2
2
 
3
+ ## 3.0.6
4
+
5
+ ### Patch Changes
6
+
7
+ - 77012ef: fix(xai): correct token counting for reasoning models to prevent negative text_output_tokens
8
+
3
9
  ## 3.0.5
4
10
 
5
11
  ### 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
@@ -2046,7 +2046,7 @@ var xaiTools = {
2046
2046
  };
2047
2047
 
2048
2048
  // src/version.ts
2049
- var VERSION = true ? "3.0.5" : "0.0.0-test";
2049
+ var VERSION = true ? "3.0.6" : "0.0.0-test";
2050
2050
 
2051
2051
  // src/xai-provider.ts
2052
2052
  var xaiErrorStructure = {