@ai-sdk/xai 3.0.125 → 3.0.127

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,20 @@
1
1
  # @ai-sdk/xai
2
2
 
3
+ ## 3.0.127
4
+
5
+ ### Patch Changes
6
+
7
+ - d44b071: Preserve complete xAI Responses usage objects in raw usage metadata.
8
+ - 47ae3e5: Preserve complete xAI Chat Completions usage objects in generated and streamed results.
9
+
10
+ ## 3.0.126
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [5642849]
15
+ - @ai-sdk/provider-utils@4.0.48
16
+ - @ai-sdk/openai-compatible@2.0.72
17
+
3
18
  ## 3.0.125
4
19
 
5
20
  ### Patch Changes
package/dist/index.js CHANGED
@@ -886,19 +886,20 @@ var xaiUsageSchema = import_v44.z.object({
886
886
  prompt_tokens: import_v44.z.number(),
887
887
  completion_tokens: import_v44.z.number(),
888
888
  total_tokens: import_v44.z.number(),
889
+ cost_in_usd_ticks: import_v44.z.number().nullish(),
889
890
  prompt_tokens_details: import_v44.z.object({
890
891
  text_tokens: import_v44.z.number().nullish(),
891
892
  audio_tokens: import_v44.z.number().nullish(),
892
893
  image_tokens: import_v44.z.number().nullish(),
893
894
  cached_tokens: import_v44.z.number().nullish()
894
- }).nullish(),
895
+ }).catchall(import_v44.z.json()).nullish(),
895
896
  completion_tokens_details: import_v44.z.object({
896
897
  reasoning_tokens: import_v44.z.number().nullish(),
897
898
  audio_tokens: import_v44.z.number().nullish(),
898
899
  accepted_prediction_tokens: import_v44.z.number().nullish(),
899
900
  rejected_prediction_tokens: import_v44.z.number().nullish()
900
- }).nullish()
901
- });
901
+ }).catchall(import_v44.z.json()).nullish()
902
+ }).catchall(import_v44.z.json());
902
903
  var xaiChatResponseSchema = import_v44.z.object({
903
904
  id: import_v44.z.string().nullish(),
904
905
  created: import_v44.z.number().nullish(),
@@ -1518,13 +1519,13 @@ var xaiResponsesUsageSchema = import_v47.z.object({
1518
1519
  total_tokens: import_v47.z.number().optional(),
1519
1520
  input_tokens_details: import_v47.z.object({
1520
1521
  cached_tokens: import_v47.z.number().optional()
1521
- }).optional(),
1522
+ }).catchall(import_v47.z.json()).optional(),
1522
1523
  output_tokens_details: import_v47.z.object({
1523
1524
  reasoning_tokens: import_v47.z.number().optional()
1524
- }).optional(),
1525
+ }).catchall(import_v47.z.json()).optional(),
1525
1526
  num_sources_used: import_v47.z.number().optional(),
1526
1527
  num_server_side_tools_used: import_v47.z.number().optional()
1527
- });
1528
+ }).catchall(import_v47.z.json());
1528
1529
  var xaiResponsesResponseSchema = import_v47.z.object({
1529
1530
  id: import_v47.z.string().nullish(),
1530
1531
  created_at: import_v47.z.number().nullish(),
@@ -2973,7 +2974,7 @@ var xaiTools = {
2973
2974
  };
2974
2975
 
2975
2976
  // src/version.ts
2976
- var VERSION = true ? "3.0.125" : "0.0.0-test";
2977
+ var VERSION = true ? "3.0.127" : "0.0.0-test";
2977
2978
 
2978
2979
  // src/xai-video-model.ts
2979
2980
  var import_provider6 = require("@ai-sdk/provider");