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/CHANGELOG.md
CHANGED
@@ -1,5 +1,37 @@
|
|
1
1
|
# ai
|
2
2
|
|
3
|
+
## 4.0.0-canary.2
|
4
|
+
|
5
|
+
### Major Changes
|
6
|
+
|
7
|
+
- b469a7e: chore: remove isXXXError methods
|
8
|
+
- c0ddc24: chore (ai): remove toJSON method from AI SDK errors
|
9
|
+
|
10
|
+
### Patch Changes
|
11
|
+
|
12
|
+
- Updated dependencies [e117b54]
|
13
|
+
- Updated dependencies [b469a7e]
|
14
|
+
- Updated dependencies [7814c4b]
|
15
|
+
- Updated dependencies [c0ddc24]
|
16
|
+
- Updated dependencies [db46ce5]
|
17
|
+
- @ai-sdk/react@1.0.0-canary.2
|
18
|
+
- @ai-sdk/provider-utils@2.0.0-canary.0
|
19
|
+
- @ai-sdk/provider@1.0.0-canary.0
|
20
|
+
- @ai-sdk/ui-utils@1.0.0-canary.2
|
21
|
+
|
22
|
+
## 4.0.0-canary.1
|
23
|
+
|
24
|
+
### Major Changes
|
25
|
+
|
26
|
+
- 8bf5756: chore: remove legacy function/tool calling
|
27
|
+
|
28
|
+
### Patch Changes
|
29
|
+
|
30
|
+
- 1c58337: chore (ai): remove 2.x prompt helpers
|
31
|
+
- Updated dependencies [8bf5756]
|
32
|
+
- @ai-sdk/ui-utils@1.0.0-canary.1
|
33
|
+
- @ai-sdk/react@1.0.0-canary.1
|
34
|
+
|
3
35
|
## 4.0.0-canary.0
|
4
36
|
|
5
37
|
### Major Changes
|
package/dist/index.d.mts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ToolInvocation, Attachment, Schema, DeepPartial, AssistantMessage, DataMessage, JSONValue as JSONValue$1 } from '@ai-sdk/ui-utils';
|
2
|
-
export { AssistantMessage, AssistantStatus, Attachment, ChatRequest, ChatRequestOptions, CreateMessage, DataMessage, DeepPartial,
|
2
|
+
export { AssistantMessage, AssistantStatus, Attachment, ChatRequest, ChatRequestOptions, CreateMessage, DataMessage, DeepPartial, IdGenerator, JSONValue, Message, RequestOptions, Schema, StreamPart, ToolInvocation, UseAssistantOptions, formatStreamPart, jsonSchema, parseStreamPart, processDataProtocolResponse, readDataStream } from '@ai-sdk/ui-utils';
|
3
3
|
import { AttributeValue, Tracer } from '@opentelemetry/api';
|
4
4
|
import { EmbeddingModelV1, EmbeddingModelV1Embedding, LanguageModelV1, LanguageModelV1FinishReason, LanguageModelV1LogProbs, LanguageModelV1CallWarning, LanguageModelV1ProviderMetadata, JSONValue, LanguageModelV1CallOptions, NoSuchModelError, AISDKError } from '@ai-sdk/provider';
|
5
5
|
export { AISDKError, APICallError, EmptyResponseBodyError, InvalidPromptError, InvalidResponseDataError, JSONParseError, LanguageModelV1, LanguageModelV1CallOptions, LanguageModelV1Prompt, LanguageModelV1StreamPart, LoadAPIKeyError, NoContentGeneratedError, NoSuchModelError, TypeValidationError, UnsupportedFunctionalityError } from '@ai-sdk/provider';
|
@@ -2187,22 +2187,6 @@ declare class NoSuchProviderError extends NoSuchModelError {
|
|
2187
2187
|
message?: string;
|
2188
2188
|
});
|
2189
2189
|
static isInstance(error: unknown): error is NoSuchProviderError;
|
2190
|
-
/**
|
2191
|
-
* @deprecated use `isInstance` instead
|
2192
|
-
*/
|
2193
|
-
static isNoSuchProviderError(error: unknown): error is NoSuchProviderError;
|
2194
|
-
/**
|
2195
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
2196
|
-
*/
|
2197
|
-
toJSON(): {
|
2198
|
-
name: string;
|
2199
|
-
message: string;
|
2200
|
-
stack: string | undefined;
|
2201
|
-
modelId: string;
|
2202
|
-
modelType: "languageModel" | "textEmbeddingModel";
|
2203
|
-
providerId: string;
|
2204
|
-
availableProviders: string[];
|
2205
|
-
};
|
2206
2190
|
}
|
2207
2191
|
|
2208
2192
|
/**
|
@@ -2293,17 +2277,6 @@ declare class InvalidArgumentError extends AISDKError {
|
|
2293
2277
|
message: string;
|
2294
2278
|
});
|
2295
2279
|
static isInstance(error: unknown): error is InvalidArgumentError;
|
2296
|
-
/**
|
2297
|
-
* @deprecated use `isInstance` instead
|
2298
|
-
*/
|
2299
|
-
static isInvalidArgumentError(error: unknown): error is InvalidArgumentError;
|
2300
|
-
toJSON(): {
|
2301
|
-
name: string;
|
2302
|
-
message: string;
|
2303
|
-
stack: string | undefined;
|
2304
|
-
parameter: string;
|
2305
|
-
value: unknown;
|
2306
|
-
};
|
2307
2280
|
}
|
2308
2281
|
|
2309
2282
|
declare const symbol$7: unique symbol;
|
@@ -2322,17 +2295,6 @@ declare class InvalidToolArgumentsError extends AISDKError {
|
|
2322
2295
|
* @deprecated use `isInstance` instead
|
2323
2296
|
*/
|
2324
2297
|
static isInvalidToolArgumentsError(error: unknown): error is InvalidToolArgumentsError;
|
2325
|
-
/**
|
2326
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
2327
|
-
*/
|
2328
|
-
toJSON(): {
|
2329
|
-
name: string;
|
2330
|
-
message: string;
|
2331
|
-
cause: unknown;
|
2332
|
-
stack: string | undefined;
|
2333
|
-
toolName: string;
|
2334
|
-
toolArgs: string;
|
2335
|
-
};
|
2336
2298
|
}
|
2337
2299
|
|
2338
2300
|
declare const symbol$6: unique symbol;
|
@@ -2346,20 +2308,6 @@ declare class NoSuchToolError extends AISDKError {
|
|
2346
2308
|
message?: string;
|
2347
2309
|
});
|
2348
2310
|
static isInstance(error: unknown): error is NoSuchToolError;
|
2349
|
-
/**
|
2350
|
-
* @deprecated use `isInstance` instead
|
2351
|
-
*/
|
2352
|
-
static isNoSuchToolError(error: unknown): error is NoSuchToolError;
|
2353
|
-
/**
|
2354
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
2355
|
-
*/
|
2356
|
-
toJSON(): {
|
2357
|
-
name: string;
|
2358
|
-
message: string;
|
2359
|
-
stack: string | undefined;
|
2360
|
-
toolName: string;
|
2361
|
-
availableTools: string[] | undefined;
|
2362
|
-
};
|
2363
2311
|
}
|
2364
2312
|
|
2365
2313
|
declare const symbol$5: unique symbol;
|
@@ -2372,19 +2320,6 @@ declare class NoObjectGeneratedError extends AISDKError {
|
|
2372
2320
|
message?: string;
|
2373
2321
|
});
|
2374
2322
|
static isInstance(error: unknown): error is NoObjectGeneratedError;
|
2375
|
-
/**
|
2376
|
-
* @deprecated Use isInstance instead.
|
2377
|
-
*/
|
2378
|
-
static isNoObjectGeneratedError(error: unknown): error is NoObjectGeneratedError;
|
2379
|
-
/**
|
2380
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
2381
|
-
*/
|
2382
|
-
toJSON(): {
|
2383
|
-
name: string;
|
2384
|
-
cause: unknown;
|
2385
|
-
message: string;
|
2386
|
-
stack: string | undefined;
|
2387
|
-
};
|
2388
2323
|
}
|
2389
2324
|
|
2390
2325
|
declare const symbol$4: unique symbol;
|
@@ -2397,20 +2332,6 @@ declare class InvalidDataContentError extends AISDKError {
|
|
2397
2332
|
message?: string;
|
2398
2333
|
});
|
2399
2334
|
static isInstance(error: unknown): error is InvalidDataContentError;
|
2400
|
-
/**
|
2401
|
-
* @deprecated use `isInstance` instead
|
2402
|
-
*/
|
2403
|
-
static isInvalidDataContentError(error: unknown): error is InvalidDataContentError;
|
2404
|
-
/**
|
2405
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
2406
|
-
*/
|
2407
|
-
toJSON(): {
|
2408
|
-
name: string;
|
2409
|
-
message: string;
|
2410
|
-
stack: string | undefined;
|
2411
|
-
cause: unknown;
|
2412
|
-
content: unknown;
|
2413
|
-
};
|
2414
2335
|
}
|
2415
2336
|
|
2416
2337
|
declare const symbol$3: unique symbol;
|
@@ -2422,19 +2343,6 @@ declare class InvalidMessageRoleError extends AISDKError {
|
|
2422
2343
|
message?: string;
|
2423
2344
|
});
|
2424
2345
|
static isInstance(error: unknown): error is InvalidMessageRoleError;
|
2425
|
-
/**
|
2426
|
-
* @deprecated use `isInstance` instead
|
2427
|
-
*/
|
2428
|
-
static isInvalidMessageRoleError(error: unknown): error is InvalidMessageRoleError;
|
2429
|
-
/**
|
2430
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
2431
|
-
*/
|
2432
|
-
toJSON(): {
|
2433
|
-
name: string;
|
2434
|
-
message: string;
|
2435
|
-
stack: string | undefined;
|
2436
|
-
role: string;
|
2437
|
-
};
|
2438
2346
|
}
|
2439
2347
|
|
2440
2348
|
declare const symbol$2: unique symbol;
|
@@ -2462,21 +2370,6 @@ declare class DownloadError extends AISDKError {
|
|
2462
2370
|
cause?: unknown;
|
2463
2371
|
});
|
2464
2372
|
static isInstance(error: unknown): error is DownloadError;
|
2465
|
-
/**
|
2466
|
-
* @deprecated use `isInstance` instead
|
2467
|
-
*/
|
2468
|
-
static isDownloadError(error: unknown): error is DownloadError;
|
2469
|
-
/**
|
2470
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
2471
|
-
*/
|
2472
|
-
toJSON(): {
|
2473
|
-
name: string;
|
2474
|
-
message: string;
|
2475
|
-
url: string;
|
2476
|
-
statusCode: number | undefined;
|
2477
|
-
statusText: string | undefined;
|
2478
|
-
cause: unknown;
|
2479
|
-
};
|
2480
2373
|
}
|
2481
2374
|
|
2482
2375
|
declare const symbol: unique symbol;
|
@@ -2492,20 +2385,6 @@ declare class RetryError extends AISDKError {
|
|
2492
2385
|
errors: Array<unknown>;
|
2493
2386
|
});
|
2494
2387
|
static isInstance(error: unknown): error is RetryError;
|
2495
|
-
/**
|
2496
|
-
* @deprecated use `isInstance` instead
|
2497
|
-
*/
|
2498
|
-
static isRetryError(error: unknown): error is RetryError;
|
2499
|
-
/**
|
2500
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
2501
|
-
*/
|
2502
|
-
toJSON(): {
|
2503
|
-
name: string;
|
2504
|
-
message: string;
|
2505
|
-
reason: RetryErrorReason;
|
2506
|
-
lastError: unknown;
|
2507
|
-
errors: unknown[];
|
2508
|
-
};
|
2509
2388
|
}
|
2510
2389
|
|
2511
2390
|
interface FunctionCallPayload {
|
package/dist/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ToolInvocation, Attachment, Schema, DeepPartial, AssistantMessage, DataMessage, JSONValue as JSONValue$1 } from '@ai-sdk/ui-utils';
|
2
|
-
export { AssistantMessage, AssistantStatus, Attachment, ChatRequest, ChatRequestOptions, CreateMessage, DataMessage, DeepPartial,
|
2
|
+
export { AssistantMessage, AssistantStatus, Attachment, ChatRequest, ChatRequestOptions, CreateMessage, DataMessage, DeepPartial, IdGenerator, JSONValue, Message, RequestOptions, Schema, StreamPart, ToolInvocation, UseAssistantOptions, formatStreamPart, jsonSchema, parseStreamPart, processDataProtocolResponse, readDataStream } from '@ai-sdk/ui-utils';
|
3
3
|
import { AttributeValue, Tracer } from '@opentelemetry/api';
|
4
4
|
import { EmbeddingModelV1, EmbeddingModelV1Embedding, LanguageModelV1, LanguageModelV1FinishReason, LanguageModelV1LogProbs, LanguageModelV1CallWarning, LanguageModelV1ProviderMetadata, JSONValue, LanguageModelV1CallOptions, NoSuchModelError, AISDKError } from '@ai-sdk/provider';
|
5
5
|
export { AISDKError, APICallError, EmptyResponseBodyError, InvalidPromptError, InvalidResponseDataError, JSONParseError, LanguageModelV1, LanguageModelV1CallOptions, LanguageModelV1Prompt, LanguageModelV1StreamPart, LoadAPIKeyError, NoContentGeneratedError, NoSuchModelError, TypeValidationError, UnsupportedFunctionalityError } from '@ai-sdk/provider';
|
@@ -2187,22 +2187,6 @@ declare class NoSuchProviderError extends NoSuchModelError {
|
|
2187
2187
|
message?: string;
|
2188
2188
|
});
|
2189
2189
|
static isInstance(error: unknown): error is NoSuchProviderError;
|
2190
|
-
/**
|
2191
|
-
* @deprecated use `isInstance` instead
|
2192
|
-
*/
|
2193
|
-
static isNoSuchProviderError(error: unknown): error is NoSuchProviderError;
|
2194
|
-
/**
|
2195
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
2196
|
-
*/
|
2197
|
-
toJSON(): {
|
2198
|
-
name: string;
|
2199
|
-
message: string;
|
2200
|
-
stack: string | undefined;
|
2201
|
-
modelId: string;
|
2202
|
-
modelType: "languageModel" | "textEmbeddingModel";
|
2203
|
-
providerId: string;
|
2204
|
-
availableProviders: string[];
|
2205
|
-
};
|
2206
2190
|
}
|
2207
2191
|
|
2208
2192
|
/**
|
@@ -2293,17 +2277,6 @@ declare class InvalidArgumentError extends AISDKError {
|
|
2293
2277
|
message: string;
|
2294
2278
|
});
|
2295
2279
|
static isInstance(error: unknown): error is InvalidArgumentError;
|
2296
|
-
/**
|
2297
|
-
* @deprecated use `isInstance` instead
|
2298
|
-
*/
|
2299
|
-
static isInvalidArgumentError(error: unknown): error is InvalidArgumentError;
|
2300
|
-
toJSON(): {
|
2301
|
-
name: string;
|
2302
|
-
message: string;
|
2303
|
-
stack: string | undefined;
|
2304
|
-
parameter: string;
|
2305
|
-
value: unknown;
|
2306
|
-
};
|
2307
2280
|
}
|
2308
2281
|
|
2309
2282
|
declare const symbol$7: unique symbol;
|
@@ -2322,17 +2295,6 @@ declare class InvalidToolArgumentsError extends AISDKError {
|
|
2322
2295
|
* @deprecated use `isInstance` instead
|
2323
2296
|
*/
|
2324
2297
|
static isInvalidToolArgumentsError(error: unknown): error is InvalidToolArgumentsError;
|
2325
|
-
/**
|
2326
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
2327
|
-
*/
|
2328
|
-
toJSON(): {
|
2329
|
-
name: string;
|
2330
|
-
message: string;
|
2331
|
-
cause: unknown;
|
2332
|
-
stack: string | undefined;
|
2333
|
-
toolName: string;
|
2334
|
-
toolArgs: string;
|
2335
|
-
};
|
2336
2298
|
}
|
2337
2299
|
|
2338
2300
|
declare const symbol$6: unique symbol;
|
@@ -2346,20 +2308,6 @@ declare class NoSuchToolError extends AISDKError {
|
|
2346
2308
|
message?: string;
|
2347
2309
|
});
|
2348
2310
|
static isInstance(error: unknown): error is NoSuchToolError;
|
2349
|
-
/**
|
2350
|
-
* @deprecated use `isInstance` instead
|
2351
|
-
*/
|
2352
|
-
static isNoSuchToolError(error: unknown): error is NoSuchToolError;
|
2353
|
-
/**
|
2354
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
2355
|
-
*/
|
2356
|
-
toJSON(): {
|
2357
|
-
name: string;
|
2358
|
-
message: string;
|
2359
|
-
stack: string | undefined;
|
2360
|
-
toolName: string;
|
2361
|
-
availableTools: string[] | undefined;
|
2362
|
-
};
|
2363
2311
|
}
|
2364
2312
|
|
2365
2313
|
declare const symbol$5: unique symbol;
|
@@ -2372,19 +2320,6 @@ declare class NoObjectGeneratedError extends AISDKError {
|
|
2372
2320
|
message?: string;
|
2373
2321
|
});
|
2374
2322
|
static isInstance(error: unknown): error is NoObjectGeneratedError;
|
2375
|
-
/**
|
2376
|
-
* @deprecated Use isInstance instead.
|
2377
|
-
*/
|
2378
|
-
static isNoObjectGeneratedError(error: unknown): error is NoObjectGeneratedError;
|
2379
|
-
/**
|
2380
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
2381
|
-
*/
|
2382
|
-
toJSON(): {
|
2383
|
-
name: string;
|
2384
|
-
cause: unknown;
|
2385
|
-
message: string;
|
2386
|
-
stack: string | undefined;
|
2387
|
-
};
|
2388
2323
|
}
|
2389
2324
|
|
2390
2325
|
declare const symbol$4: unique symbol;
|
@@ -2397,20 +2332,6 @@ declare class InvalidDataContentError extends AISDKError {
|
|
2397
2332
|
message?: string;
|
2398
2333
|
});
|
2399
2334
|
static isInstance(error: unknown): error is InvalidDataContentError;
|
2400
|
-
/**
|
2401
|
-
* @deprecated use `isInstance` instead
|
2402
|
-
*/
|
2403
|
-
static isInvalidDataContentError(error: unknown): error is InvalidDataContentError;
|
2404
|
-
/**
|
2405
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
2406
|
-
*/
|
2407
|
-
toJSON(): {
|
2408
|
-
name: string;
|
2409
|
-
message: string;
|
2410
|
-
stack: string | undefined;
|
2411
|
-
cause: unknown;
|
2412
|
-
content: unknown;
|
2413
|
-
};
|
2414
2335
|
}
|
2415
2336
|
|
2416
2337
|
declare const symbol$3: unique symbol;
|
@@ -2422,19 +2343,6 @@ declare class InvalidMessageRoleError extends AISDKError {
|
|
2422
2343
|
message?: string;
|
2423
2344
|
});
|
2424
2345
|
static isInstance(error: unknown): error is InvalidMessageRoleError;
|
2425
|
-
/**
|
2426
|
-
* @deprecated use `isInstance` instead
|
2427
|
-
*/
|
2428
|
-
static isInvalidMessageRoleError(error: unknown): error is InvalidMessageRoleError;
|
2429
|
-
/**
|
2430
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
2431
|
-
*/
|
2432
|
-
toJSON(): {
|
2433
|
-
name: string;
|
2434
|
-
message: string;
|
2435
|
-
stack: string | undefined;
|
2436
|
-
role: string;
|
2437
|
-
};
|
2438
2346
|
}
|
2439
2347
|
|
2440
2348
|
declare const symbol$2: unique symbol;
|
@@ -2462,21 +2370,6 @@ declare class DownloadError extends AISDKError {
|
|
2462
2370
|
cause?: unknown;
|
2463
2371
|
});
|
2464
2372
|
static isInstance(error: unknown): error is DownloadError;
|
2465
|
-
/**
|
2466
|
-
* @deprecated use `isInstance` instead
|
2467
|
-
*/
|
2468
|
-
static isDownloadError(error: unknown): error is DownloadError;
|
2469
|
-
/**
|
2470
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
2471
|
-
*/
|
2472
|
-
toJSON(): {
|
2473
|
-
name: string;
|
2474
|
-
message: string;
|
2475
|
-
url: string;
|
2476
|
-
statusCode: number | undefined;
|
2477
|
-
statusText: string | undefined;
|
2478
|
-
cause: unknown;
|
2479
|
-
};
|
2480
2373
|
}
|
2481
2374
|
|
2482
2375
|
declare const symbol: unique symbol;
|
@@ -2492,20 +2385,6 @@ declare class RetryError extends AISDKError {
|
|
2492
2385
|
errors: Array<unknown>;
|
2493
2386
|
});
|
2494
2387
|
static isInstance(error: unknown): error is RetryError;
|
2495
|
-
/**
|
2496
|
-
* @deprecated use `isInstance` instead
|
2497
|
-
*/
|
2498
|
-
static isRetryError(error: unknown): error is RetryError;
|
2499
|
-
/**
|
2500
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
2501
|
-
*/
|
2502
|
-
toJSON(): {
|
2503
|
-
name: string;
|
2504
|
-
message: string;
|
2505
|
-
reason: RetryErrorReason;
|
2506
|
-
lastError: unknown;
|
2507
|
-
errors: unknown[];
|
2508
|
-
};
|
2509
2388
|
}
|
2510
2389
|
|
2511
2390
|
interface FunctionCallPayload {
|
package/dist/index.js
CHANGED
@@ -116,24 +116,6 @@ var RetryError = class extends import_provider.AISDKError {
|
|
116
116
|
static isInstance(error) {
|
117
117
|
return import_provider.AISDKError.hasMarker(error, marker);
|
118
118
|
}
|
119
|
-
/**
|
120
|
-
* @deprecated use `isInstance` instead
|
121
|
-
*/
|
122
|
-
static isRetryError(error) {
|
123
|
-
return error instanceof Error && error.name === name && typeof error.reason === "string" && Array.isArray(error.errors);
|
124
|
-
}
|
125
|
-
/**
|
126
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
127
|
-
*/
|
128
|
-
toJSON() {
|
129
|
-
return {
|
130
|
-
name: this.name,
|
131
|
-
message: this.message,
|
132
|
-
reason: this.reason,
|
133
|
-
lastError: this.lastError,
|
134
|
-
errors: this.errors
|
135
|
-
};
|
136
|
-
}
|
137
119
|
};
|
138
120
|
_a = symbol;
|
139
121
|
|
@@ -171,7 +153,7 @@ async function _retryWithExponentialBackoff(f, {
|
|
171
153
|
errors: newErrors
|
172
154
|
});
|
173
155
|
}
|
174
|
-
if (error instanceof Error && import_provider2.APICallError.
|
156
|
+
if (error instanceof Error && import_provider2.APICallError.isInstance(error) && error.isRetryable === true && tryNumber <= maxRetries) {
|
175
157
|
await delay(delayInMs);
|
176
158
|
return _retryWithExponentialBackoff(
|
177
159
|
f,
|
@@ -686,25 +668,6 @@ var DownloadError = class extends import_provider3.AISDKError {
|
|
686
668
|
static isInstance(error) {
|
687
669
|
return import_provider3.AISDKError.hasMarker(error, marker2);
|
688
670
|
}
|
689
|
-
/**
|
690
|
-
* @deprecated use `isInstance` instead
|
691
|
-
*/
|
692
|
-
static isDownloadError(error) {
|
693
|
-
return error instanceof Error && error.name === name2 && typeof error.url === "string" && (error.statusCode == null || typeof error.statusCode === "number") && (error.statusText == null || typeof error.statusText === "string");
|
694
|
-
}
|
695
|
-
/**
|
696
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
697
|
-
*/
|
698
|
-
toJSON() {
|
699
|
-
return {
|
700
|
-
name: this.name,
|
701
|
-
message: this.message,
|
702
|
-
url: this.url,
|
703
|
-
statusCode: this.statusCode,
|
704
|
-
statusText: this.statusText,
|
705
|
-
cause: this.cause
|
706
|
-
};
|
707
|
-
}
|
708
671
|
};
|
709
672
|
_a2 = symbol2;
|
710
673
|
|
@@ -774,24 +737,6 @@ var InvalidDataContentError = class extends import_provider4.AISDKError {
|
|
774
737
|
static isInstance(error) {
|
775
738
|
return import_provider4.AISDKError.hasMarker(error, marker3);
|
776
739
|
}
|
777
|
-
/**
|
778
|
-
* @deprecated use `isInstance` instead
|
779
|
-
*/
|
780
|
-
static isInvalidDataContentError(error) {
|
781
|
-
return error instanceof Error && error.name === name3 && error.content != null;
|
782
|
-
}
|
783
|
-
/**
|
784
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
785
|
-
*/
|
786
|
-
toJSON() {
|
787
|
-
return {
|
788
|
-
name: this.name,
|
789
|
-
message: this.message,
|
790
|
-
stack: this.stack,
|
791
|
-
cause: this.cause,
|
792
|
-
content: this.content
|
793
|
-
};
|
794
|
-
}
|
795
740
|
};
|
796
741
|
_a3 = symbol3;
|
797
742
|
|
@@ -865,23 +810,6 @@ var InvalidMessageRoleError = class extends import_provider5.AISDKError {
|
|
865
810
|
static isInstance(error) {
|
866
811
|
return import_provider5.AISDKError.hasMarker(error, marker4);
|
867
812
|
}
|
868
|
-
/**
|
869
|
-
* @deprecated use `isInstance` instead
|
870
|
-
*/
|
871
|
-
static isInvalidMessageRoleError(error) {
|
872
|
-
return error instanceof Error && error.name === name4 && typeof error.role === "string";
|
873
|
-
}
|
874
|
-
/**
|
875
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
876
|
-
*/
|
877
|
-
toJSON() {
|
878
|
-
return {
|
879
|
-
name: this.name,
|
880
|
-
message: this.message,
|
881
|
-
stack: this.stack,
|
882
|
-
role: this.role
|
883
|
-
};
|
884
|
-
}
|
885
813
|
};
|
886
814
|
_a4 = symbol4;
|
887
815
|
|
@@ -1109,21 +1037,6 @@ var InvalidArgumentError = class extends import_provider6.AISDKError {
|
|
1109
1037
|
static isInstance(error) {
|
1110
1038
|
return import_provider6.AISDKError.hasMarker(error, marker5);
|
1111
1039
|
}
|
1112
|
-
/**
|
1113
|
-
* @deprecated use `isInstance` instead
|
1114
|
-
*/
|
1115
|
-
static isInvalidArgumentError(error) {
|
1116
|
-
return error instanceof Error && error.name === name5 && typeof error.parameter === "string" && typeof error.value === "string";
|
1117
|
-
}
|
1118
|
-
toJSON() {
|
1119
|
-
return {
|
1120
|
-
name: this.name,
|
1121
|
-
message: this.message,
|
1122
|
-
stack: this.stack,
|
1123
|
-
parameter: this.parameter,
|
1124
|
-
value: this.value
|
1125
|
-
};
|
1126
|
-
}
|
1127
1040
|
};
|
1128
1041
|
_a5 = symbol5;
|
1129
1042
|
|
@@ -1705,23 +1618,6 @@ var NoObjectGeneratedError = class extends import_provider9.AISDKError {
|
|
1705
1618
|
static isInstance(error) {
|
1706
1619
|
return import_provider9.AISDKError.hasMarker(error, marker7);
|
1707
1620
|
}
|
1708
|
-
/**
|
1709
|
-
* @deprecated Use isInstance instead.
|
1710
|
-
*/
|
1711
|
-
static isNoObjectGeneratedError(error) {
|
1712
|
-
return error instanceof Error && error.name === name7;
|
1713
|
-
}
|
1714
|
-
/**
|
1715
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
1716
|
-
*/
|
1717
|
-
toJSON() {
|
1718
|
-
return {
|
1719
|
-
name: this.name,
|
1720
|
-
cause: this.cause,
|
1721
|
-
message: this.message,
|
1722
|
-
stack: this.stack
|
1723
|
-
};
|
1724
|
-
}
|
1725
1621
|
};
|
1726
1622
|
_a7 = symbol7;
|
1727
1623
|
|
@@ -3122,19 +3018,6 @@ var InvalidToolArgumentsError = class extends import_provider11.AISDKError {
|
|
3122
3018
|
static isInvalidToolArgumentsError(error) {
|
3123
3019
|
return error instanceof Error && error.name === name8 && typeof error.toolName === "string" && typeof error.toolArgs === "string";
|
3124
3020
|
}
|
3125
|
-
/**
|
3126
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
3127
|
-
*/
|
3128
|
-
toJSON() {
|
3129
|
-
return {
|
3130
|
-
name: this.name,
|
3131
|
-
message: this.message,
|
3132
|
-
cause: this.cause,
|
3133
|
-
stack: this.stack,
|
3134
|
-
toolName: this.toolName,
|
3135
|
-
toolArgs: this.toolArgs
|
3136
|
-
};
|
3137
|
-
}
|
3138
3021
|
};
|
3139
3022
|
_a8 = symbol8;
|
3140
3023
|
|
@@ -3158,24 +3041,6 @@ var NoSuchToolError = class extends import_provider12.AISDKError {
|
|
3158
3041
|
static isInstance(error) {
|
3159
3042
|
return import_provider12.AISDKError.hasMarker(error, marker9);
|
3160
3043
|
}
|
3161
|
-
/**
|
3162
|
-
* @deprecated use `isInstance` instead
|
3163
|
-
*/
|
3164
|
-
static isNoSuchToolError(error) {
|
3165
|
-
return error instanceof Error && error.name === name9 && "toolName" in error && error.toolName != void 0 && typeof error.name === "string";
|
3166
|
-
}
|
3167
|
-
/**
|
3168
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
3169
|
-
*/
|
3170
|
-
toJSON() {
|
3171
|
-
return {
|
3172
|
-
name: this.name,
|
3173
|
-
message: this.message,
|
3174
|
-
stack: this.stack,
|
3175
|
-
toolName: this.toolName,
|
3176
|
-
availableTools: this.availableTools
|
3177
|
-
};
|
3178
|
-
}
|
3179
3044
|
};
|
3180
3045
|
_a9 = symbol9;
|
3181
3046
|
|
@@ -4995,26 +4860,6 @@ var NoSuchProviderError = class extends import_provider15.NoSuchModelError {
|
|
4995
4860
|
static isInstance(error) {
|
4996
4861
|
return import_provider15.AISDKError.hasMarker(error, marker10);
|
4997
4862
|
}
|
4998
|
-
/**
|
4999
|
-
* @deprecated use `isInstance` instead
|
5000
|
-
*/
|
5001
|
-
static isNoSuchProviderError(error) {
|
5002
|
-
return error instanceof Error && error.name === name10 && typeof error.providerId === "string" && Array.isArray(error.availableProviders);
|
5003
|
-
}
|
5004
|
-
/**
|
5005
|
-
* @deprecated Do not use this method. It will be removed in the next major version.
|
5006
|
-
*/
|
5007
|
-
toJSON() {
|
5008
|
-
return {
|
5009
|
-
name: this.name,
|
5010
|
-
message: this.message,
|
5011
|
-
stack: this.stack,
|
5012
|
-
modelId: this.modelId,
|
5013
|
-
modelType: this.modelType,
|
5014
|
-
providerId: this.providerId,
|
5015
|
-
availableProviders: this.availableProviders
|
5016
|
-
};
|
5017
|
-
}
|
5018
4863
|
};
|
5019
4864
|
_a10 = symbol10;
|
5020
4865
|
|