ai 4.3.6 → 4.3.7
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 +24 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
@@ -4008,23 +4008,36 @@ function toResponseMessages({
|
|
4008
4008
|
generateMessageId
|
4009
4009
|
}) {
|
4010
4010
|
const responseMessages = [];
|
4011
|
-
|
4012
|
-
|
4013
|
-
content
|
4011
|
+
const content = [];
|
4012
|
+
if (reasoning.length > 0) {
|
4013
|
+
content.push(
|
4014
4014
|
...reasoning.map(
|
4015
4015
|
(part) => part.type === "text" ? { ...part, type: "reasoning" } : { ...part, type: "redacted-reasoning" }
|
4016
|
-
)
|
4017
|
-
|
4016
|
+
)
|
4017
|
+
);
|
4018
|
+
}
|
4019
|
+
if (files.length > 0) {
|
4020
|
+
content.push(
|
4018
4021
|
...files.map((file) => ({
|
4019
4022
|
type: "file",
|
4020
4023
|
data: file.base64,
|
4021
4024
|
mimeType: file.mimeType
|
4022
|
-
}))
|
4023
|
-
|
4024
|
-
|
4025
|
-
|
4026
|
-
|
4027
|
-
}
|
4025
|
+
}))
|
4026
|
+
);
|
4027
|
+
}
|
4028
|
+
if (text2.length > 0) {
|
4029
|
+
content.push({ type: "text", text: text2 });
|
4030
|
+
}
|
4031
|
+
if (toolCalls.length > 0) {
|
4032
|
+
content.push(...toolCalls);
|
4033
|
+
}
|
4034
|
+
if (content.length > 0) {
|
4035
|
+
responseMessages.push({
|
4036
|
+
role: "assistant",
|
4037
|
+
content,
|
4038
|
+
id: messageId
|
4039
|
+
});
|
4040
|
+
}
|
4028
4041
|
if (toolResults.length > 0) {
|
4029
4042
|
responseMessages.push({
|
4030
4043
|
role: "tool",
|