@ai-sdk/xai 3.0.126 → 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 +7 -0
- package/dist/index.js +8 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/responses/xai-responses-api.ts +21 -17
- package/src/xai-chat-language-model.ts +27 -22
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
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
|
+
|
|
3
10
|
## 3.0.126
|
|
4
11
|
|
|
5
12
|
### 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.
|
|
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");
|