ai 4.2.6 → 4.2.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 +18 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
- package/rsc/dist/rsc-server.mjs +18 -7
- package/rsc/dist/rsc-server.mjs.map +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
@@ -1744,13 +1744,24 @@ function convertToCoreMessages(messages, options) {
|
|
1744
1744
|
break;
|
1745
1745
|
}
|
1746
1746
|
case "user": {
|
1747
|
-
|
1748
|
-
|
1749
|
-
|
1750
|
-
|
1751
|
-
|
1752
|
-
|
1753
|
-
|
1747
|
+
if (message.parts == null) {
|
1748
|
+
coreMessages.push({
|
1749
|
+
role: "user",
|
1750
|
+
content: experimental_attachments ? [
|
1751
|
+
{ type: "text", text: content },
|
1752
|
+
...attachmentsToParts(experimental_attachments)
|
1753
|
+
] : content
|
1754
|
+
});
|
1755
|
+
} else {
|
1756
|
+
const textParts = message.parts.filter((part) => part.type === "text").map((part) => ({
|
1757
|
+
type: "text",
|
1758
|
+
text: part.text
|
1759
|
+
}));
|
1760
|
+
coreMessages.push({
|
1761
|
+
role: "user",
|
1762
|
+
content: experimental_attachments ? [...textParts, ...attachmentsToParts(experimental_attachments)] : textParts
|
1763
|
+
});
|
1764
|
+
}
|
1754
1765
|
break;
|
1755
1766
|
}
|
1756
1767
|
case "assistant": {
|