@ai-sdk/xai 3.0.131 → 3.0.133
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 +12 -0
- package/dist/index.js +4 -24
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -24
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/responses/xai-responses-prepare-tools.ts +1 -2
- package/src/xai-chat-language-model.ts +1 -1
- package/src/xai-prepare-tools.ts +1 -2
- package/src/remove-additional-properties.ts +0 -24
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ai-sdk/xai
|
|
2
2
|
|
|
3
|
+
## 3.0.133
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8825c65: fix(xai): preserve `additionalProperties: false` in tool schemas
|
|
8
|
+
|
|
9
|
+
## 3.0.132
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 4bd2599: fix(deepseek): preserve reasoning streams across empty tool-call deltas
|
|
14
|
+
|
|
3
15
|
## 3.0.131
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -357,26 +357,6 @@ var xaiFailedResponseHandler = (0, import_provider_utils2.createJsonErrorRespons
|
|
|
357
357
|
|
|
358
358
|
// src/xai-prepare-tools.ts
|
|
359
359
|
var import_provider2 = require("@ai-sdk/provider");
|
|
360
|
-
|
|
361
|
-
// src/remove-additional-properties.ts
|
|
362
|
-
function removeAdditionalPropertiesFalse(value) {
|
|
363
|
-
if (Array.isArray(value)) {
|
|
364
|
-
return value.map(removeAdditionalPropertiesFalse);
|
|
365
|
-
}
|
|
366
|
-
if (value == null || typeof value !== "object") {
|
|
367
|
-
return value;
|
|
368
|
-
}
|
|
369
|
-
const result = {};
|
|
370
|
-
for (const [key, propertyValue] of Object.entries(value)) {
|
|
371
|
-
if (key === "additionalProperties" && propertyValue === false) {
|
|
372
|
-
continue;
|
|
373
|
-
}
|
|
374
|
-
result[key] = removeAdditionalPropertiesFalse(propertyValue);
|
|
375
|
-
}
|
|
376
|
-
return result;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
// src/xai-prepare-tools.ts
|
|
380
360
|
function prepareTools({
|
|
381
361
|
tools,
|
|
382
362
|
toolChoice
|
|
@@ -399,7 +379,7 @@ function prepareTools({
|
|
|
399
379
|
function: {
|
|
400
380
|
name: tool.name,
|
|
401
381
|
description: tool.description,
|
|
402
|
-
parameters:
|
|
382
|
+
parameters: tool.inputSchema,
|
|
403
383
|
...tool.strict != null ? { strict: tool.strict } : {}
|
|
404
384
|
}
|
|
405
385
|
});
|
|
@@ -815,7 +795,7 @@ var XaiChatLanguageModel = class {
|
|
|
815
795
|
delta: delta.reasoning_content
|
|
816
796
|
});
|
|
817
797
|
}
|
|
818
|
-
if (delta.tool_calls != null) {
|
|
798
|
+
if (delta.tool_calls != null && delta.tool_calls.length > 0) {
|
|
819
799
|
if (activeReasoningBlockId != null && !contentBlocks[activeReasoningBlockId].ended) {
|
|
820
800
|
controller.enqueue({
|
|
821
801
|
type: "reasoning-end",
|
|
@@ -2141,7 +2121,7 @@ async function prepareResponsesTools({
|
|
|
2141
2121
|
type: "function",
|
|
2142
2122
|
name: tool.name,
|
|
2143
2123
|
description: tool.description,
|
|
2144
|
-
parameters:
|
|
2124
|
+
parameters: tool.inputSchema,
|
|
2145
2125
|
...tool.strict != null ? { strict: tool.strict } : {}
|
|
2146
2126
|
});
|
|
2147
2127
|
}
|
|
@@ -3043,7 +3023,7 @@ var xaiTools = {
|
|
|
3043
3023
|
};
|
|
3044
3024
|
|
|
3045
3025
|
// src/version.ts
|
|
3046
|
-
var VERSION = true ? "3.0.
|
|
3026
|
+
var VERSION = true ? "3.0.133" : "0.0.0-test";
|
|
3047
3027
|
|
|
3048
3028
|
// src/xai-video-model.ts
|
|
3049
3029
|
var import_provider6 = require("@ai-sdk/provider");
|