@ai-sdk/xai 3.0.15 → 3.0.16
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 +11 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1895,7 +1895,7 @@ var XaiResponsesLanguageModel = class {
|
|
|
1895
1895
|
controller.enqueue({ type: "stream-start", warnings });
|
|
1896
1896
|
},
|
|
1897
1897
|
transform(chunk, controller) {
|
|
1898
|
-
var _a2, _b, _c, _d, _e, _f, _g, _h
|
|
1898
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
1899
1899
|
if (options.includeRawChunks) {
|
|
1900
1900
|
controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
|
|
1901
1901
|
}
|
|
@@ -2010,8 +2010,10 @@ var XaiResponsesLanguageModel = class {
|
|
|
2010
2010
|
id: `reasoning-${part.id}`,
|
|
2011
2011
|
providerMetadata: {
|
|
2012
2012
|
xai: {
|
|
2013
|
-
|
|
2014
|
-
|
|
2013
|
+
...part.encrypted_content && {
|
|
2014
|
+
reasoningEncryptedContent: part.encrypted_content
|
|
2015
|
+
},
|
|
2016
|
+
...part.id && { itemId: part.id }
|
|
2015
2017
|
}
|
|
2016
2018
|
}
|
|
2017
2019
|
});
|
|
@@ -2031,15 +2033,15 @@ var XaiResponsesLanguageModel = class {
|
|
|
2031
2033
|
"x_semantic_search",
|
|
2032
2034
|
"x_thread_fetch"
|
|
2033
2035
|
];
|
|
2034
|
-
let toolName = (
|
|
2035
|
-
if (webSearchSubTools.includes((
|
|
2036
|
+
let toolName = (_c = part.name) != null ? _c : "";
|
|
2037
|
+
if (webSearchSubTools.includes((_d = part.name) != null ? _d : "") || part.type === "web_search_call") {
|
|
2036
2038
|
toolName = webSearchToolName != null ? webSearchToolName : "web_search";
|
|
2037
|
-
} else if (xSearchSubTools.includes((
|
|
2039
|
+
} else if (xSearchSubTools.includes((_e = part.name) != null ? _e : "") || part.type === "x_search_call") {
|
|
2038
2040
|
toolName = xSearchToolName != null ? xSearchToolName : "x_search";
|
|
2039
2041
|
} else if (part.name === "code_execution" || part.type === "code_interpreter_call" || part.type === "code_execution_call") {
|
|
2040
2042
|
toolName = codeExecutionToolName != null ? codeExecutionToolName : "code_execution";
|
|
2041
2043
|
}
|
|
2042
|
-
const toolInput = part.type === "custom_tool_call" ? (
|
|
2044
|
+
const toolInput = part.type === "custom_tool_call" ? (_f = part.input) != null ? _f : "" : (_g = part.arguments) != null ? _g : "";
|
|
2043
2045
|
const shouldEmit = part.type === "custom_tool_call" ? event.type === "response.output_item.done" : !seenToolCalls.has(part.id);
|
|
2044
2046
|
if (shouldEmit && !seenToolCalls.has(part.id)) {
|
|
2045
2047
|
seenToolCalls.add(part.id);
|
|
@@ -2092,7 +2094,7 @@ var XaiResponsesLanguageModel = class {
|
|
|
2092
2094
|
sourceType: "url",
|
|
2093
2095
|
id: self.config.generateId(),
|
|
2094
2096
|
url: annotation.url,
|
|
2095
|
-
title: (
|
|
2097
|
+
title: (_h = annotation.title) != null ? _h : annotation.url
|
|
2096
2098
|
});
|
|
2097
2099
|
}
|
|
2098
2100
|
}
|
|
@@ -2197,7 +2199,7 @@ var xaiTools = {
|
|
|
2197
2199
|
};
|
|
2198
2200
|
|
|
2199
2201
|
// src/version.ts
|
|
2200
|
-
var VERSION = true ? "3.0.
|
|
2202
|
+
var VERSION = true ? "3.0.16" : "0.0.0-test";
|
|
2201
2203
|
|
|
2202
2204
|
// src/xai-provider.ts
|
|
2203
2205
|
var xaiErrorStructure = {
|