@ai-sdk/xai 3.0.32 → 3.0.34
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 +18 -0
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -5
- package/src/responses/xai-responses-api.ts +1 -1
- package/src/responses/xai-responses-language-model.ts +6 -1
- package/src/convert-to-xai-chat-messages.test.ts +0 -243
- package/src/convert-xai-chat-usage.test.ts +0 -240
- package/src/responses/__fixtures__/xai-code-execution-tool.1.json +0 -68
- package/src/responses/__fixtures__/xai-text-streaming.1.chunks.txt +0 -698
- package/src/responses/__fixtures__/xai-text-with-reasoning-streaming-store-false.1.chunks.txt +0 -655
- package/src/responses/__fixtures__/xai-text-with-reasoning-streaming.1.chunks.txt +0 -679
- package/src/responses/__fixtures__/xai-web-search-tool.1.chunks.txt +0 -274
- package/src/responses/__fixtures__/xai-web-search-tool.1.json +0 -90
- package/src/responses/__fixtures__/xai-x-search-tool.1.json +0 -149
- package/src/responses/__fixtures__/xai-x-search-tool.chunks.txt +0 -1757
- package/src/responses/__snapshots__/xai-responses-language-model.test.ts.snap +0 -21929
- package/src/responses/convert-to-xai-responses-input.test.ts +0 -463
- package/src/responses/xai-responses-language-model.test.ts +0 -1803
- package/src/responses/xai-responses-prepare-tools.test.ts +0 -620
- package/src/xai-chat-language-model.test.ts +0 -1805
- package/src/xai-provider.test.ts +0 -167
package/dist/index.mjs
CHANGED
|
@@ -1170,7 +1170,7 @@ var xaiResponsesResponseSchema = z4.object({
|
|
|
1170
1170
|
model: z4.string().nullish(),
|
|
1171
1171
|
object: z4.literal("response"),
|
|
1172
1172
|
output: z4.array(outputItemSchema),
|
|
1173
|
-
usage: xaiResponsesUsageSchema,
|
|
1173
|
+
usage: xaiResponsesUsageSchema.nullish(),
|
|
1174
1174
|
status: z4.string()
|
|
1175
1175
|
});
|
|
1176
1176
|
var xaiResponsesChunkSchema = z4.union([
|
|
@@ -1974,7 +1974,10 @@ var XaiResponsesLanguageModel = class {
|
|
|
1974
1974
|
unified: mapXaiResponsesFinishReason(response.status),
|
|
1975
1975
|
raw: (_j = response.status) != null ? _j : void 0
|
|
1976
1976
|
},
|
|
1977
|
-
usage: convertXaiResponsesUsage(response.usage)
|
|
1977
|
+
usage: response.usage ? convertXaiResponsesUsage(response.usage) : {
|
|
1978
|
+
inputTokens: { total: 0, noCache: 0, cacheRead: 0, cacheWrite: 0 },
|
|
1979
|
+
outputTokens: { total: 0, text: 0, reasoning: 0 }
|
|
1980
|
+
},
|
|
1978
1981
|
request: { body },
|
|
1979
1982
|
response: {
|
|
1980
1983
|
...getResponseMetadata(response),
|
|
@@ -2336,7 +2339,7 @@ var xaiTools = {
|
|
|
2336
2339
|
};
|
|
2337
2340
|
|
|
2338
2341
|
// src/version.ts
|
|
2339
|
-
var VERSION = true ? "3.0.
|
|
2342
|
+
var VERSION = true ? "3.0.34" : "0.0.0-test";
|
|
2340
2343
|
|
|
2341
2344
|
// src/xai-provider.ts
|
|
2342
2345
|
var xaiErrorStructure = {
|