@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/dist/index.mjs
CHANGED
|
@@ -343,26 +343,6 @@ var xaiFailedResponseHandler = createJsonErrorResponseHandler({
|
|
|
343
343
|
import {
|
|
344
344
|
UnsupportedFunctionalityError as UnsupportedFunctionalityError2
|
|
345
345
|
} from "@ai-sdk/provider";
|
|
346
|
-
|
|
347
|
-
// src/remove-additional-properties.ts
|
|
348
|
-
function removeAdditionalPropertiesFalse(value) {
|
|
349
|
-
if (Array.isArray(value)) {
|
|
350
|
-
return value.map(removeAdditionalPropertiesFalse);
|
|
351
|
-
}
|
|
352
|
-
if (value == null || typeof value !== "object") {
|
|
353
|
-
return value;
|
|
354
|
-
}
|
|
355
|
-
const result = {};
|
|
356
|
-
for (const [key, propertyValue] of Object.entries(value)) {
|
|
357
|
-
if (key === "additionalProperties" && propertyValue === false) {
|
|
358
|
-
continue;
|
|
359
|
-
}
|
|
360
|
-
result[key] = removeAdditionalPropertiesFalse(propertyValue);
|
|
361
|
-
}
|
|
362
|
-
return result;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
// src/xai-prepare-tools.ts
|
|
366
346
|
function prepareTools({
|
|
367
347
|
tools,
|
|
368
348
|
toolChoice
|
|
@@ -385,7 +365,7 @@ function prepareTools({
|
|
|
385
365
|
function: {
|
|
386
366
|
name: tool.name,
|
|
387
367
|
description: tool.description,
|
|
388
|
-
parameters:
|
|
368
|
+
parameters: tool.inputSchema,
|
|
389
369
|
...tool.strict != null ? { strict: tool.strict } : {}
|
|
390
370
|
}
|
|
391
371
|
});
|
|
@@ -801,7 +781,7 @@ var XaiChatLanguageModel = class {
|
|
|
801
781
|
delta: delta.reasoning_content
|
|
802
782
|
});
|
|
803
783
|
}
|
|
804
|
-
if (delta.tool_calls != null) {
|
|
784
|
+
if (delta.tool_calls != null && delta.tool_calls.length > 0) {
|
|
805
785
|
if (activeReasoningBlockId != null && !contentBlocks[activeReasoningBlockId].ended) {
|
|
806
786
|
controller.enqueue({
|
|
807
787
|
type: "reasoning-end",
|
|
@@ -2162,7 +2142,7 @@ async function prepareResponsesTools({
|
|
|
2162
2142
|
type: "function",
|
|
2163
2143
|
name: tool.name,
|
|
2164
2144
|
description: tool.description,
|
|
2165
|
-
parameters:
|
|
2145
|
+
parameters: tool.inputSchema,
|
|
2166
2146
|
...tool.strict != null ? { strict: tool.strict } : {}
|
|
2167
2147
|
});
|
|
2168
2148
|
}
|
|
@@ -3064,7 +3044,7 @@ var xaiTools = {
|
|
|
3064
3044
|
};
|
|
3065
3045
|
|
|
3066
3046
|
// src/version.ts
|
|
3067
|
-
var VERSION = true ? "3.0.
|
|
3047
|
+
var VERSION = true ? "3.0.133" : "0.0.0-test";
|
|
3068
3048
|
|
|
3069
3049
|
// src/xai-video-model.ts
|
|
3070
3050
|
import {
|