ai 4.0.0-canary.0 → 4.0.0-canary.2
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 +32 -0
- package/dist/index.d.mts +1 -122
- package/dist/index.d.ts +1 -122
- package/dist/index.js +1 -156
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -156
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -11
- package/rsc/dist/rsc-server.mjs +1 -119
- package/rsc/dist/rsc-server.mjs.map +1 -1
- package/prompts/dist/index.d.mts +0 -220
- package/prompts/dist/index.d.ts +0 -220
- package/prompts/dist/index.js +0 -178
- package/prompts/dist/index.js.map +0 -1
- package/prompts/dist/index.mjs +0 -146
- package/prompts/dist/index.mjs.map +0 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "ai",
|
3
|
-
"version": "4.0.0-canary.
|
3
|
+
"version": "4.0.0-canary.2",
|
4
4
|
"description": "AI SDK by Vercel - The AI Toolkit for TypeScript and JavaScript",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"sideEffects": false,
|
@@ -10,7 +10,6 @@
|
|
10
10
|
"files": [
|
11
11
|
"dist/**/*",
|
12
12
|
"react/dist/**/*",
|
13
|
-
"prompts/dist/**/*",
|
14
13
|
"rsc/dist/**/*",
|
15
14
|
"test/dist/**/*",
|
16
15
|
"CHANGELOG.md"
|
@@ -33,11 +32,6 @@
|
|
33
32
|
"react-server": "./rsc/dist/rsc-server.mjs",
|
34
33
|
"import": "./rsc/dist/rsc-client.mjs"
|
35
34
|
},
|
36
|
-
"./prompts": {
|
37
|
-
"types": "./prompts/dist/index.d.ts",
|
38
|
-
"import": "./prompts/dist/index.mjs",
|
39
|
-
"require": "./prompts/dist/index.js"
|
40
|
-
},
|
41
35
|
"./react": {
|
42
36
|
"types": "./react/dist/index.d.ts",
|
43
37
|
"react-server": "./react/dist/index.server.mjs",
|
@@ -46,10 +40,10 @@
|
|
46
40
|
}
|
47
41
|
},
|
48
42
|
"dependencies": {
|
49
|
-
"@ai-sdk/provider": "0.0.
|
50
|
-
"@ai-sdk/provider-utils": "
|
51
|
-
"@ai-sdk/react": "1.0.0-canary.
|
52
|
-
"@ai-sdk/ui-utils": "1.0.0-canary.
|
43
|
+
"@ai-sdk/provider": "1.0.0-canary.0",
|
44
|
+
"@ai-sdk/provider-utils": "2.0.0-canary.0",
|
45
|
+
"@ai-sdk/react": "1.0.0-canary.2",
|
46
|
+
"@ai-sdk/ui-utils": "1.0.0-canary.2",
|
53
47
|
"@opentelemetry/api": "1.9.0",
|
54
48
|
"eventsource-parser": "1.1.2",
|
55
49
|
"jsondiffpatch": "0.6.0",
|
package/rsc/dist/rsc-server.mjs
CHANGED
@@ -236,25 +236,6 @@ var DownloadError = class extends AISDKError {
|
|
236
236
|
static isInstance(error) {
|
237
237
|
return AISDKError.hasMarker(error, marker);
|
238
238
|
}
|
239
|
-
/**
|
240
|
-
* @deprecated use `isInstance` instead
|
241
|
-
*/
|
242
|
-
static isDownloadError(error) {
|
243
|
-
return error instanceof Error && error.name === name && typeof error.url === "string" && (error.statusCode == null || typeof error.statusCode === "number") && (error.statusText == null || typeof error.statusText === "string");
|
244
|
-
}
|
245
|
-
/**
|
246
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
247
|
-
*/
|
248
|
-
toJSON() {
|
249
|
-
return {
|
250
|
-
name: this.name,
|
251
|
-
message: this.message,
|
252
|
-
url: this.url,
|
253
|
-
statusCode: this.statusCode,
|
254
|
-
statusText: this.statusText,
|
255
|
-
cause: this.cause
|
256
|
-
};
|
257
|
-
}
|
258
239
|
};
|
259
240
|
_a = symbol;
|
260
241
|
|
@@ -327,24 +308,6 @@ var InvalidDataContentError = class extends AISDKError2 {
|
|
327
308
|
static isInstance(error) {
|
328
309
|
return AISDKError2.hasMarker(error, marker2);
|
329
310
|
}
|
330
|
-
/**
|
331
|
-
* @deprecated use `isInstance` instead
|
332
|
-
*/
|
333
|
-
static isInvalidDataContentError(error) {
|
334
|
-
return error instanceof Error && error.name === name2 && error.content != null;
|
335
|
-
}
|
336
|
-
/**
|
337
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
338
|
-
*/
|
339
|
-
toJSON() {
|
340
|
-
return {
|
341
|
-
name: this.name,
|
342
|
-
message: this.message,
|
343
|
-
stack: this.stack,
|
344
|
-
cause: this.cause,
|
345
|
-
content: this.content
|
346
|
-
};
|
347
|
-
}
|
348
311
|
};
|
349
312
|
_a2 = symbol2;
|
350
313
|
|
@@ -418,23 +381,6 @@ var InvalidMessageRoleError = class extends AISDKError3 {
|
|
418
381
|
static isInstance(error) {
|
419
382
|
return AISDKError3.hasMarker(error, marker3);
|
420
383
|
}
|
421
|
-
/**
|
422
|
-
* @deprecated use `isInstance` instead
|
423
|
-
*/
|
424
|
-
static isInvalidMessageRoleError(error) {
|
425
|
-
return error instanceof Error && error.name === name3 && typeof error.role === "string";
|
426
|
-
}
|
427
|
-
/**
|
428
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
429
|
-
*/
|
430
|
-
toJSON() {
|
431
|
-
return {
|
432
|
-
name: this.name,
|
433
|
-
message: this.message,
|
434
|
-
stack: this.stack,
|
435
|
-
role: this.role
|
436
|
-
};
|
437
|
-
}
|
438
384
|
};
|
439
385
|
_a3 = symbol3;
|
440
386
|
|
@@ -662,21 +608,6 @@ var InvalidArgumentError = class extends AISDKError4 {
|
|
662
608
|
static isInstance(error) {
|
663
609
|
return AISDKError4.hasMarker(error, marker4);
|
664
610
|
}
|
665
|
-
/**
|
666
|
-
* @deprecated use `isInstance` instead
|
667
|
-
*/
|
668
|
-
static isInvalidArgumentError(error) {
|
669
|
-
return error instanceof Error && error.name === name4 && typeof error.parameter === "string" && typeof error.value === "string";
|
670
|
-
}
|
671
|
-
toJSON() {
|
672
|
-
return {
|
673
|
-
name: this.name,
|
674
|
-
message: this.message,
|
675
|
-
stack: this.stack,
|
676
|
-
parameter: this.parameter,
|
677
|
-
value: this.value
|
678
|
-
};
|
679
|
-
}
|
680
611
|
};
|
681
612
|
_a4 = symbol4;
|
682
613
|
|
@@ -1288,19 +1219,6 @@ var InvalidToolArgumentsError = class extends AISDKError6 {
|
|
1288
1219
|
static isInvalidToolArgumentsError(error) {
|
1289
1220
|
return error instanceof Error && error.name === name6 && typeof error.toolName === "string" && typeof error.toolArgs === "string";
|
1290
1221
|
}
|
1291
|
-
/**
|
1292
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
1293
|
-
*/
|
1294
|
-
toJSON() {
|
1295
|
-
return {
|
1296
|
-
name: this.name,
|
1297
|
-
message: this.message,
|
1298
|
-
cause: this.cause,
|
1299
|
-
stack: this.stack,
|
1300
|
-
toolName: this.toolName,
|
1301
|
-
toolArgs: this.toolArgs
|
1302
|
-
};
|
1303
|
-
}
|
1304
1222
|
};
|
1305
1223
|
_a6 = symbol6;
|
1306
1224
|
|
@@ -1324,24 +1242,6 @@ var NoSuchToolError = class extends AISDKError7 {
|
|
1324
1242
|
static isInstance(error) {
|
1325
1243
|
return AISDKError7.hasMarker(error, marker7);
|
1326
1244
|
}
|
1327
|
-
/**
|
1328
|
-
* @deprecated use `isInstance` instead
|
1329
|
-
*/
|
1330
|
-
static isNoSuchToolError(error) {
|
1331
|
-
return error instanceof Error && error.name === name7 && "toolName" in error && error.toolName != void 0 && typeof error.name === "string";
|
1332
|
-
}
|
1333
|
-
/**
|
1334
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
1335
|
-
*/
|
1336
|
-
toJSON() {
|
1337
|
-
return {
|
1338
|
-
name: this.name,
|
1339
|
-
message: this.message,
|
1340
|
-
stack: this.stack,
|
1341
|
-
toolName: this.toolName,
|
1342
|
-
availableTools: this.availableTools
|
1343
|
-
};
|
1344
|
-
}
|
1345
1245
|
};
|
1346
1246
|
_a7 = symbol7;
|
1347
1247
|
|
@@ -1385,24 +1285,6 @@ var RetryError = class extends AISDKError8 {
|
|
1385
1285
|
static isInstance(error) {
|
1386
1286
|
return AISDKError8.hasMarker(error, marker8);
|
1387
1287
|
}
|
1388
|
-
/**
|
1389
|
-
* @deprecated use `isInstance` instead
|
1390
|
-
*/
|
1391
|
-
static isRetryError(error) {
|
1392
|
-
return error instanceof Error && error.name === name8 && typeof error.reason === "string" && Array.isArray(error.errors);
|
1393
|
-
}
|
1394
|
-
/**
|
1395
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
1396
|
-
*/
|
1397
|
-
toJSON() {
|
1398
|
-
return {
|
1399
|
-
name: this.name,
|
1400
|
-
message: this.message,
|
1401
|
-
reason: this.reason,
|
1402
|
-
lastError: this.lastError,
|
1403
|
-
errors: this.errors
|
1404
|
-
};
|
1405
|
-
}
|
1406
1288
|
};
|
1407
1289
|
_a8 = symbol8;
|
1408
1290
|
|
@@ -1440,7 +1322,7 @@ async function _retryWithExponentialBackoff(f, {
|
|
1440
1322
|
errors: newErrors
|
1441
1323
|
});
|
1442
1324
|
}
|
1443
|
-
if (error instanceof Error && APICallError.
|
1325
|
+
if (error instanceof Error && APICallError.isInstance(error) && error.isRetryable === true && tryNumber <= maxRetries) {
|
1444
1326
|
await delay(delayInMs);
|
1445
1327
|
return _retryWithExponentialBackoff(
|
1446
1328
|
f,
|