ai 4.2.6 → 4.2.8
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 +15 -0
- package/dist/index.js +19 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
- package/rsc/dist/rsc-server.mjs +18 -7
- package/rsc/dist/rsc-server.mjs.map +1 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "ai",
|
3
|
-
"version": "4.2.
|
3
|
+
"version": "4.2.8",
|
4
4
|
"description": "AI SDK by Vercel - The AI Toolkit for TypeScript and JavaScript",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"sideEffects": false,
|
@@ -48,8 +48,8 @@
|
|
48
48
|
"dependencies": {
|
49
49
|
"@ai-sdk/provider": "1.1.0",
|
50
50
|
"@ai-sdk/provider-utils": "2.2.1",
|
51
|
-
"@ai-sdk/react": "1.2.
|
52
|
-
"@ai-sdk/ui-utils": "1.2.
|
51
|
+
"@ai-sdk/react": "1.2.3",
|
52
|
+
"@ai-sdk/ui-utils": "1.2.2",
|
53
53
|
"@opentelemetry/api": "1.9.0",
|
54
54
|
"jsondiffpatch": "0.6.0"
|
55
55
|
},
|
@@ -112,6 +112,7 @@
|
|
112
112
|
"test:node": "vitest --config vitest.node.config.js --run",
|
113
113
|
"test:node:watch": "vitest --config vitest.node.config.js",
|
114
114
|
"test:node:core": "pnpm vitest --config vitest.node.config.js --run ./core/",
|
115
|
+
"test:node:core:watch": "pnpm vitest --config vitest.node.config.js ./core/",
|
115
116
|
"test:node:util": "pnpm vitest --config vitest.node.config.js --run ./util/",
|
116
117
|
"test:ui": "pnpm test:ui:react",
|
117
118
|
"test:ui:react": "vitest --config vitest.ui.react.config.js --run",
|
package/rsc/dist/rsc-server.mjs
CHANGED
@@ -1100,13 +1100,24 @@ function convertToCoreMessages(messages, options) {
|
|
1100
1100
|
break;
|
1101
1101
|
}
|
1102
1102
|
case "user": {
|
1103
|
-
|
1104
|
-
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1103
|
+
if (message.parts == null) {
|
1104
|
+
coreMessages.push({
|
1105
|
+
role: "user",
|
1106
|
+
content: experimental_attachments ? [
|
1107
|
+
{ type: "text", text: content },
|
1108
|
+
...attachmentsToParts(experimental_attachments)
|
1109
|
+
] : content
|
1110
|
+
});
|
1111
|
+
} else {
|
1112
|
+
const textParts = message.parts.filter((part) => part.type === "text").map((part) => ({
|
1113
|
+
type: "text",
|
1114
|
+
text: part.text
|
1115
|
+
}));
|
1116
|
+
coreMessages.push({
|
1117
|
+
role: "user",
|
1118
|
+
content: experimental_attachments ? [...textParts, ...attachmentsToParts(experimental_attachments)] : textParts
|
1119
|
+
});
|
1120
|
+
}
|
1110
1121
|
break;
|
1111
1122
|
}
|
1112
1123
|
case "assistant": {
|