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/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
@@ -4077,23 +4077,36 @@ function toResponseMessages({
|
|
4077
4077
|
generateMessageId
|
4078
4078
|
}) {
|
4079
4079
|
const responseMessages = [];
|
4080
|
-
|
4081
|
-
|
4082
|
-
content
|
4080
|
+
const content = [];
|
4081
|
+
if (reasoning.length > 0) {
|
4082
|
+
content.push(
|
4083
4083
|
...reasoning.map(
|
4084
4084
|
(part) => part.type === "text" ? { ...part, type: "reasoning" } : { ...part, type: "redacted-reasoning" }
|
4085
|
-
)
|
4086
|
-
|
4085
|
+
)
|
4086
|
+
);
|
4087
|
+
}
|
4088
|
+
if (files.length > 0) {
|
4089
|
+
content.push(
|
4087
4090
|
...files.map((file) => ({
|
4088
4091
|
type: "file",
|
4089
4092
|
data: file.base64,
|
4090
4093
|
mimeType: file.mimeType
|
4091
|
-
}))
|
4092
|
-
|
4093
|
-
|
4094
|
-
|
4095
|
-
|
4096
|
-
}
|
4094
|
+
}))
|
4095
|
+
);
|
4096
|
+
}
|
4097
|
+
if (text2.length > 0) {
|
4098
|
+
content.push({ type: "text", text: text2 });
|
4099
|
+
}
|
4100
|
+
if (toolCalls.length > 0) {
|
4101
|
+
content.push(...toolCalls);
|
4102
|
+
}
|
4103
|
+
if (content.length > 0) {
|
4104
|
+
responseMessages.push({
|
4105
|
+
role: "assistant",
|
4106
|
+
content,
|
4107
|
+
id: messageId
|
4108
|
+
});
|
4109
|
+
}
|
4097
4110
|
if (toolResults.length > 0) {
|
4098
4111
|
responseMessages.push({
|
4099
4112
|
role: "tool",
|