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/dist/index.mjs
CHANGED
@@ -1669,13 +1669,24 @@ function convertToCoreMessages(messages, options) {
|
|
1669
1669
|
break;
|
1670
1670
|
}
|
1671
1671
|
case "user": {
|
1672
|
-
|
1673
|
-
|
1674
|
-
|
1675
|
-
|
1676
|
-
|
1677
|
-
|
1678
|
-
|
1672
|
+
if (message.parts == null) {
|
1673
|
+
coreMessages.push({
|
1674
|
+
role: "user",
|
1675
|
+
content: experimental_attachments ? [
|
1676
|
+
{ type: "text", text: content },
|
1677
|
+
...attachmentsToParts(experimental_attachments)
|
1678
|
+
] : content
|
1679
|
+
});
|
1680
|
+
} else {
|
1681
|
+
const textParts = message.parts.filter((part) => part.type === "text").map((part) => ({
|
1682
|
+
type: "text",
|
1683
|
+
text: part.text
|
1684
|
+
}));
|
1685
|
+
coreMessages.push({
|
1686
|
+
role: "user",
|
1687
|
+
content: experimental_attachments ? [...textParts, ...attachmentsToParts(experimental_attachments)] : textParts
|
1688
|
+
});
|
1689
|
+
}
|
1679
1690
|
break;
|
1680
1691
|
}
|
1681
1692
|
case "assistant": {
|