@ai-sdk/xai 4.0.58 → 4.0.59
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,15 @@
|
|
|
1
1
|
# @ai-sdk/xai
|
|
2
2
|
|
|
3
|
+
## 4.0.59
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6e405ae: fix(xai): preserve `additionalProperties: false` in tool schemas
|
|
8
|
+
- Updated dependencies [5c0054d]
|
|
9
|
+
- Updated dependencies [39535af]
|
|
10
|
+
- @ai-sdk/provider@4.0.15
|
|
11
|
+
- @ai-sdk/provider-utils@5.0.41
|
|
12
|
+
|
|
3
13
|
## 4.0.58
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -406,26 +406,6 @@ var xaiFailedResponseHandler = createJsonErrorResponseHandler({
|
|
|
406
406
|
import {
|
|
407
407
|
UnsupportedFunctionalityError as UnsupportedFunctionalityError2
|
|
408
408
|
} from "@ai-sdk/provider";
|
|
409
|
-
|
|
410
|
-
// src/remove-additional-properties.ts
|
|
411
|
-
function removeAdditionalPropertiesFalse(value) {
|
|
412
|
-
if (Array.isArray(value)) {
|
|
413
|
-
return value.map(removeAdditionalPropertiesFalse);
|
|
414
|
-
}
|
|
415
|
-
if (value == null || typeof value !== "object") {
|
|
416
|
-
return value;
|
|
417
|
-
}
|
|
418
|
-
const result = {};
|
|
419
|
-
for (const [key, propertyValue] of Object.entries(value)) {
|
|
420
|
-
if (key === "additionalProperties" && propertyValue === false) {
|
|
421
|
-
continue;
|
|
422
|
-
}
|
|
423
|
-
result[key] = removeAdditionalPropertiesFalse(propertyValue);
|
|
424
|
-
}
|
|
425
|
-
return result;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
// src/xai-prepare-tools.ts
|
|
429
409
|
function prepareTools({
|
|
430
410
|
tools,
|
|
431
411
|
toolChoice
|
|
@@ -448,7 +428,7 @@ function prepareTools({
|
|
|
448
428
|
function: {
|
|
449
429
|
name: tool.name,
|
|
450
430
|
description: tool.description,
|
|
451
|
-
parameters:
|
|
431
|
+
parameters: tool.inputSchema,
|
|
452
432
|
...tool.strict != null ? { strict: tool.strict } : {}
|
|
453
433
|
}
|
|
454
434
|
});
|
|
@@ -2417,7 +2397,7 @@ async function prepareResponsesTools({
|
|
|
2417
2397
|
type: "function",
|
|
2418
2398
|
name: tool.name,
|
|
2419
2399
|
description: tool.description,
|
|
2420
|
-
parameters:
|
|
2400
|
+
parameters: tool.inputSchema,
|
|
2421
2401
|
...tool.strict != null ? { strict: tool.strict } : {}
|
|
2422
2402
|
});
|
|
2423
2403
|
}
|
|
@@ -4562,7 +4542,7 @@ var xaiTools = {
|
|
|
4562
4542
|
};
|
|
4563
4543
|
|
|
4564
4544
|
// src/version.ts
|
|
4565
|
-
var VERSION = true ? "4.0.
|
|
4545
|
+
var VERSION = true ? "4.0.59" : "0.0.0-test";
|
|
4566
4546
|
|
|
4567
4547
|
// src/files/xai-files.ts
|
|
4568
4548
|
import {
|