@ai-sdk/xai 3.0.89 → 3.0.90
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 +6 -0
- package/dist/index.js +23 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/remove-additional-properties.ts +24 -0
- package/src/responses/xai-responses-prepare-tools.ts +2 -1
- package/src/xai-prepare-tools.ts +2 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -311,6 +311,26 @@ var xaiFailedResponseHandler = (0, import_provider_utils2.createJsonErrorRespons
|
|
|
311
311
|
|
|
312
312
|
// src/xai-prepare-tools.ts
|
|
313
313
|
var import_provider2 = require("@ai-sdk/provider");
|
|
314
|
+
|
|
315
|
+
// src/remove-additional-properties.ts
|
|
316
|
+
function removeAdditionalPropertiesFalse(value) {
|
|
317
|
+
if (Array.isArray(value)) {
|
|
318
|
+
return value.map(removeAdditionalPropertiesFalse);
|
|
319
|
+
}
|
|
320
|
+
if (value == null || typeof value !== "object") {
|
|
321
|
+
return value;
|
|
322
|
+
}
|
|
323
|
+
const result = {};
|
|
324
|
+
for (const [key, propertyValue] of Object.entries(value)) {
|
|
325
|
+
if (key === "additionalProperties" && propertyValue === false) {
|
|
326
|
+
continue;
|
|
327
|
+
}
|
|
328
|
+
result[key] = removeAdditionalPropertiesFalse(propertyValue);
|
|
329
|
+
}
|
|
330
|
+
return result;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
// src/xai-prepare-tools.ts
|
|
314
334
|
function prepareTools({
|
|
315
335
|
tools,
|
|
316
336
|
toolChoice
|
|
@@ -333,7 +353,7 @@ function prepareTools({
|
|
|
333
353
|
function: {
|
|
334
354
|
name: tool.name,
|
|
335
355
|
description: tool.description,
|
|
336
|
-
parameters: tool.inputSchema,
|
|
356
|
+
parameters: removeAdditionalPropertiesFalse(tool.inputSchema),
|
|
337
357
|
...tool.strict != null ? { strict: tool.strict } : {}
|
|
338
358
|
}
|
|
339
359
|
});
|
|
@@ -1970,7 +1990,7 @@ async function prepareResponsesTools({
|
|
|
1970
1990
|
type: "function",
|
|
1971
1991
|
name: tool.name,
|
|
1972
1992
|
description: tool.description,
|
|
1973
|
-
parameters: tool.inputSchema,
|
|
1993
|
+
parameters: removeAdditionalPropertiesFalse(tool.inputSchema),
|
|
1974
1994
|
...tool.strict != null ? { strict: tool.strict } : {}
|
|
1975
1995
|
});
|
|
1976
1996
|
}
|
|
@@ -2800,7 +2820,7 @@ var xaiTools = {
|
|
|
2800
2820
|
};
|
|
2801
2821
|
|
|
2802
2822
|
// src/version.ts
|
|
2803
|
-
var VERSION = true ? "3.0.
|
|
2823
|
+
var VERSION = true ? "3.0.90" : "0.0.0-test";
|
|
2804
2824
|
|
|
2805
2825
|
// src/xai-video-model.ts
|
|
2806
2826
|
var import_provider6 = require("@ai-sdk/provider");
|