ai 3.3.33 → 3.3.35
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 +22 -0
- package/dist/index.d.mts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +22 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +13 -8
- package/rsc/dist/rsc-server.mjs +10 -3
- package/rsc/dist/rsc-server.mjs.map +1 -1
- package/test/dist/index.d.mts +42 -0
- package/test/dist/index.d.ts +42 -0
- package/test/dist/index.js +98 -0
- package/test/dist/index.js.map +1 -0
- package/test/dist/index.mjs +69 -0
- package/test/dist/index.mjs.map +1 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "ai",
|
3
|
-
"version": "3.3.
|
3
|
+
"version": "3.3.35",
|
4
4
|
"description": "Vercel AI SDK - The AI Toolkit for TypeScript and JavaScript",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"sideEffects": false,
|
@@ -15,8 +15,7 @@
|
|
15
15
|
"solid/dist/**/*",
|
16
16
|
"prompts/dist/**/*",
|
17
17
|
"rsc/dist/**/*",
|
18
|
-
"
|
19
|
-
"mistral/dist/**/*",
|
18
|
+
"test/dist/**/*",
|
20
19
|
"CHANGELOG.md"
|
21
20
|
],
|
22
21
|
"exports": {
|
@@ -26,6 +25,12 @@
|
|
26
25
|
"import": "./dist/index.mjs",
|
27
26
|
"require": "./dist/index.js"
|
28
27
|
},
|
28
|
+
"./test": {
|
29
|
+
"types": "./test/dist/index.d.ts",
|
30
|
+
"import": "./test/dist/index.mjs",
|
31
|
+
"module": "./test/dist/index.mjs",
|
32
|
+
"require": "./test/dist/index.js"
|
33
|
+
},
|
29
34
|
"./rsc": {
|
30
35
|
"types": "./rsc/dist/index.d.ts",
|
31
36
|
"react-server": "./rsc/dist/rsc-server.mjs",
|
@@ -61,11 +66,11 @@
|
|
61
66
|
"dependencies": {
|
62
67
|
"@ai-sdk/provider": "0.0.23",
|
63
68
|
"@ai-sdk/provider-utils": "1.0.18",
|
64
|
-
"@ai-sdk/react": "0.0.
|
65
|
-
"@ai-sdk/solid": "0.0.
|
66
|
-
"@ai-sdk/svelte": "0.0.
|
67
|
-
"@ai-sdk/ui-utils": "0.0.
|
68
|
-
"@ai-sdk/vue": "0.0.
|
69
|
+
"@ai-sdk/react": "0.0.57",
|
70
|
+
"@ai-sdk/solid": "0.0.45",
|
71
|
+
"@ai-sdk/svelte": "0.0.47",
|
72
|
+
"@ai-sdk/ui-utils": "0.0.42",
|
73
|
+
"@ai-sdk/vue": "0.0.47",
|
69
74
|
"@opentelemetry/api": "1.9.0",
|
70
75
|
"eventsource-parser": "1.1.2",
|
71
76
|
"jsondiffpatch": "0.6.0",
|
package/rsc/dist/rsc-server.mjs
CHANGED
@@ -1320,6 +1320,7 @@ async function streamUI({
|
|
1320
1320
|
const ui = createStreamableUI(initial);
|
1321
1321
|
const textRender = text || defaultTextRenderer;
|
1322
1322
|
let finished;
|
1323
|
+
let finishEvent = null;
|
1323
1324
|
async function render2({
|
1324
1325
|
args,
|
1325
1326
|
renderer,
|
@@ -1438,13 +1439,13 @@ async function streamUI({
|
|
1438
1439
|
throw value.error;
|
1439
1440
|
}
|
1440
1441
|
case "finish": {
|
1441
|
-
|
1442
|
+
finishEvent = {
|
1442
1443
|
finishReason: value.finishReason,
|
1443
1444
|
usage: calculateLanguageModelUsage(value.usage),
|
1444
|
-
value: ui.value,
|
1445
1445
|
warnings: result.warnings,
|
1446
1446
|
rawResponse: result.rawResponse
|
1447
|
-
}
|
1447
|
+
};
|
1448
|
+
break;
|
1448
1449
|
}
|
1449
1450
|
}
|
1450
1451
|
}
|
@@ -1457,6 +1458,12 @@ async function streamUI({
|
|
1457
1458
|
});
|
1458
1459
|
}
|
1459
1460
|
await finished;
|
1461
|
+
if (finishEvent && onFinish) {
|
1462
|
+
await onFinish({
|
1463
|
+
...finishEvent,
|
1464
|
+
value: ui.value
|
1465
|
+
});
|
1466
|
+
}
|
1460
1467
|
} catch (error) {
|
1461
1468
|
ui.error(error);
|
1462
1469
|
}
|