@ai-sdk/provider 0.0.0-85f9a635-20240518005312

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/dist/index.js ADDED
@@ -0,0 +1,509 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ APICallError: () => APICallError,
24
+ EmptyResponseBodyError: () => EmptyResponseBodyError,
25
+ InvalidArgumentError: () => InvalidArgumentError,
26
+ InvalidDataContentError: () => InvalidDataContentError,
27
+ InvalidPromptError: () => InvalidPromptError,
28
+ InvalidResponseDataError: () => InvalidResponseDataError,
29
+ InvalidToolArgumentsError: () => InvalidToolArgumentsError,
30
+ JSONParseError: () => JSONParseError,
31
+ LoadAPIKeyError: () => LoadAPIKeyError,
32
+ NoObjectGeneratedError: () => NoObjectGeneratedError,
33
+ NoSuchToolError: () => NoSuchToolError,
34
+ RetryError: () => RetryError,
35
+ TooManyEmbeddingValuesForCallError: () => TooManyEmbeddingValuesForCallError,
36
+ ToolCallParseError: () => ToolCallParseError,
37
+ TypeValidationError: () => TypeValidationError,
38
+ UnsupportedFunctionalityError: () => UnsupportedFunctionalityError,
39
+ UnsupportedJSONSchemaError: () => UnsupportedJSONSchemaError
40
+ });
41
+ module.exports = __toCommonJS(src_exports);
42
+
43
+ // src/errors/api-call-error.ts
44
+ var APICallError = class extends Error {
45
+ constructor({
46
+ message,
47
+ url,
48
+ requestBodyValues,
49
+ statusCode,
50
+ responseHeaders,
51
+ responseBody,
52
+ cause,
53
+ isRetryable = statusCode != null && (statusCode === 408 || // request timeout
54
+ statusCode === 409 || // conflict
55
+ statusCode === 429 || // too many requests
56
+ statusCode >= 500),
57
+ // server error
58
+ data
59
+ }) {
60
+ super(message);
61
+ this.name = "AI_APICallError";
62
+ this.url = url;
63
+ this.requestBodyValues = requestBodyValues;
64
+ this.statusCode = statusCode;
65
+ this.responseHeaders = responseHeaders;
66
+ this.responseBody = responseBody;
67
+ this.cause = cause;
68
+ this.isRetryable = isRetryable;
69
+ this.data = data;
70
+ }
71
+ static isAPICallError(error) {
72
+ return error instanceof Error && error.name === "AI_APICallError" && typeof error.url === "string" && typeof error.requestBodyValues === "object" && (error.statusCode == null || typeof error.statusCode === "number") && (error.responseHeaders == null || typeof error.responseHeaders === "object") && (error.responseBody == null || typeof error.responseBody === "string") && (error.cause == null || typeof error.cause === "object") && typeof error.isRetryable === "boolean" && (error.data == null || typeof error.data === "object");
73
+ }
74
+ toJSON() {
75
+ return {
76
+ name: this.name,
77
+ message: this.message,
78
+ url: this.url,
79
+ requestBodyValues: this.requestBodyValues,
80
+ statusCode: this.statusCode,
81
+ responseHeaders: this.responseHeaders,
82
+ responseBody: this.responseBody,
83
+ cause: this.cause,
84
+ isRetryable: this.isRetryable,
85
+ data: this.data
86
+ };
87
+ }
88
+ };
89
+
90
+ // src/errors/empty-response-body-error.ts
91
+ var EmptyResponseBodyError = class extends Error {
92
+ constructor({ message = "Empty response body" } = {}) {
93
+ super(message);
94
+ this.name = "AI_EmptyResponseBodyError";
95
+ }
96
+ static isEmptyResponseBodyError(error) {
97
+ return error instanceof Error && error.name === "AI_EmptyResponseBodyError";
98
+ }
99
+ toJSON() {
100
+ return {
101
+ name: this.name,
102
+ message: this.message,
103
+ stack: this.stack
104
+ };
105
+ }
106
+ };
107
+
108
+ // src/errors/invalid-argument-error.ts
109
+ var InvalidArgumentError = class extends Error {
110
+ constructor({
111
+ parameter,
112
+ value,
113
+ message
114
+ }) {
115
+ super(`Invalid argument for parameter ${parameter}: ${message}`);
116
+ this.name = "AI_InvalidArgumentError";
117
+ this.parameter = parameter;
118
+ this.value = value;
119
+ }
120
+ static isInvalidArgumentError(error) {
121
+ return error instanceof Error && error.name === "AI_InvalidArgumentError" && typeof error.parameter === "string" && typeof error.value === "string";
122
+ }
123
+ toJSON() {
124
+ return {
125
+ name: this.name,
126
+ message: this.message,
127
+ stack: this.stack,
128
+ parameter: this.parameter,
129
+ value: this.value
130
+ };
131
+ }
132
+ };
133
+
134
+ // src/errors/invalid-data-content-error.ts
135
+ var InvalidDataContentError = class extends Error {
136
+ constructor({
137
+ content,
138
+ cause,
139
+ message = `Invalid data content. Expected a base64 string, Uint8Array, ArrayBuffer, or Buffer, but got ${typeof content}.`
140
+ }) {
141
+ super(message);
142
+ this.name = "AI_InvalidDataContentError";
143
+ this.cause = cause;
144
+ this.content = content;
145
+ }
146
+ static isInvalidDataContentError(error) {
147
+ return error instanceof Error && error.name === "AI_InvalidDataContentError" && error.content != null;
148
+ }
149
+ toJSON() {
150
+ return {
151
+ name: this.name,
152
+ message: this.message,
153
+ stack: this.stack,
154
+ cause: this.cause,
155
+ content: this.content
156
+ };
157
+ }
158
+ };
159
+
160
+ // src/errors/invalid-prompt-error.ts
161
+ var InvalidPromptError = class extends Error {
162
+ constructor({ prompt: prompt2, message }) {
163
+ super(`Invalid prompt: ${message}`);
164
+ this.name = "AI_InvalidPromptError";
165
+ this.prompt = prompt2;
166
+ }
167
+ static isInvalidPromptError(error) {
168
+ return error instanceof Error && error.name === "AI_InvalidPromptError" && prompt != null;
169
+ }
170
+ toJSON() {
171
+ return {
172
+ name: this.name,
173
+ message: this.message,
174
+ stack: this.stack,
175
+ prompt: this.prompt
176
+ };
177
+ }
178
+ };
179
+
180
+ // src/errors/invalid-response-data-error.ts
181
+ var InvalidResponseDataError = class extends Error {
182
+ constructor({
183
+ data,
184
+ message = `Invalid response data: ${JSON.stringify(data)}.`
185
+ }) {
186
+ super(message);
187
+ this.name = "AI_InvalidResponseDataError";
188
+ this.data = data;
189
+ }
190
+ static isInvalidResponseDataError(error) {
191
+ return error instanceof Error && error.name === "AI_InvalidResponseDataError" && error.data != null;
192
+ }
193
+ toJSON() {
194
+ return {
195
+ name: this.name,
196
+ message: this.message,
197
+ stack: this.stack,
198
+ data: this.data
199
+ };
200
+ }
201
+ };
202
+
203
+ // src/errors/get-error-message.ts
204
+ function getErrorMessage(error) {
205
+ if (error == null) {
206
+ return "unknown error";
207
+ }
208
+ if (typeof error === "string") {
209
+ return error;
210
+ }
211
+ if (error instanceof Error) {
212
+ return error.message;
213
+ }
214
+ return JSON.stringify(error);
215
+ }
216
+
217
+ // src/errors/invalid-tool-arguments-error.ts
218
+ var InvalidToolArgumentsError = class extends Error {
219
+ constructor({
220
+ toolArgs,
221
+ toolName,
222
+ cause,
223
+ message = `Invalid arguments for tool ${toolName}: ${getErrorMessage(
224
+ cause
225
+ )}`
226
+ }) {
227
+ super(message);
228
+ this.name = "AI_InvalidToolArgumentsError";
229
+ this.toolArgs = toolArgs;
230
+ this.toolName = toolName;
231
+ this.cause = cause;
232
+ }
233
+ static isInvalidToolArgumentsError(error) {
234
+ return error instanceof Error && error.name === "AI_InvalidToolArgumentsError" && typeof error.toolName === "string" && typeof error.toolArgs === "string";
235
+ }
236
+ toJSON() {
237
+ return {
238
+ name: this.name,
239
+ message: this.message,
240
+ cause: this.cause,
241
+ stack: this.stack,
242
+ toolName: this.toolName,
243
+ toolArgs: this.toolArgs
244
+ };
245
+ }
246
+ };
247
+
248
+ // src/errors/json-parse-error.ts
249
+ var JSONParseError = class extends Error {
250
+ constructor({ text, cause }) {
251
+ super(
252
+ `JSON parsing failed: Text: ${text}.
253
+ Error message: ${getErrorMessage(cause)}`
254
+ );
255
+ this.name = "AI_JSONParseError";
256
+ this.cause = cause;
257
+ this.text = text;
258
+ }
259
+ static isJSONParseError(error) {
260
+ return error instanceof Error && error.name === "AI_JSONParseError" && typeof error.text === "string" && typeof error.cause === "string";
261
+ }
262
+ toJSON() {
263
+ return {
264
+ name: this.name,
265
+ message: this.message,
266
+ cause: this.cause,
267
+ stack: this.stack,
268
+ valueText: this.text
269
+ };
270
+ }
271
+ };
272
+
273
+ // src/errors/load-api-key-error.ts
274
+ var LoadAPIKeyError = class extends Error {
275
+ constructor({ message }) {
276
+ super(message);
277
+ this.name = "AI_LoadAPIKeyError";
278
+ }
279
+ static isLoadAPIKeyError(error) {
280
+ return error instanceof Error && error.name === "AI_LoadAPIKeyError";
281
+ }
282
+ toJSON() {
283
+ return {
284
+ name: this.name,
285
+ message: this.message
286
+ };
287
+ }
288
+ };
289
+
290
+ // src/errors/no-object-generated-error.ts
291
+ var NoObjectGeneratedError = class extends Error {
292
+ constructor() {
293
+ super(`No object generated.`);
294
+ this.name = "AI_NoObjectGeneratedError";
295
+ }
296
+ static isNoTextGeneratedError(error) {
297
+ return error instanceof Error && error.name === "AI_NoObjectGeneratedError";
298
+ }
299
+ toJSON() {
300
+ return {
301
+ name: this.name,
302
+ cause: this.cause,
303
+ message: this.message,
304
+ stack: this.stack
305
+ };
306
+ }
307
+ };
308
+
309
+ // src/errors/no-such-tool-error.ts
310
+ var NoSuchToolError = class extends Error {
311
+ constructor({
312
+ toolName,
313
+ availableTools = void 0,
314
+ message = `Model tried to call unavailable tool '${toolName}'. ${availableTools === void 0 ? "No tools are available." : `Available tools: ${availableTools.join(", ")}.`}`
315
+ }) {
316
+ super(message);
317
+ this.name = "AI_NoSuchToolError";
318
+ this.toolName = toolName;
319
+ this.availableTools = availableTools;
320
+ }
321
+ static isNoSuchToolError(error) {
322
+ return error instanceof Error && error.name === "AI_NoSuchToolError" && "toolName" in error && error.toolName != void 0 && typeof error.name === "string";
323
+ }
324
+ toJSON() {
325
+ return {
326
+ name: this.name,
327
+ message: this.message,
328
+ stack: this.stack,
329
+ toolName: this.toolName,
330
+ availableTools: this.availableTools
331
+ };
332
+ }
333
+ };
334
+
335
+ // src/errors/retry-error.ts
336
+ var RetryError = class extends Error {
337
+ constructor({
338
+ message,
339
+ reason,
340
+ errors
341
+ }) {
342
+ super(message);
343
+ this.name = "AI_RetryError";
344
+ this.reason = reason;
345
+ this.errors = errors;
346
+ this.lastError = errors[errors.length - 1];
347
+ }
348
+ static isRetryError(error) {
349
+ return error instanceof Error && error.name === "AI_RetryError" && typeof error.reason === "string" && Array.isArray(error.errors);
350
+ }
351
+ toJSON() {
352
+ return {
353
+ name: this.name,
354
+ message: this.message,
355
+ reason: this.reason,
356
+ lastError: this.lastError,
357
+ errors: this.errors
358
+ };
359
+ }
360
+ };
361
+
362
+ // src/errors/too-many-embedding-values-for-call-error.ts
363
+ var TooManyEmbeddingValuesForCallError = class extends Error {
364
+ constructor(options) {
365
+ super(
366
+ `Too many values for a single embedding call. The ${options.provider} model "${options.modelId}" can only embed up to ${options.maxEmbeddingsPerCall} values per call, but ${options.values.length} values were provided.`
367
+ );
368
+ this.name = "AI_TooManyEmbeddingValuesForCallError";
369
+ this.provider = options.provider;
370
+ this.modelId = options.modelId;
371
+ this.maxEmbeddingsPerCall = options.maxEmbeddingsPerCall;
372
+ this.values = options.values;
373
+ }
374
+ static isInvalidPromptError(error) {
375
+ return error instanceof Error && error.name === "AI_TooManyEmbeddingValuesForCallError" && "provider" in error && typeof error.provider === "string" && "modelId" in error && typeof error.modelId === "string" && "maxEmbeddingsPerCall" in error && typeof error.maxEmbeddingsPerCall === "number" && "values" in error && Array.isArray(error.values);
376
+ }
377
+ toJSON() {
378
+ return {
379
+ name: this.name,
380
+ message: this.message,
381
+ stack: this.stack,
382
+ provider: this.provider,
383
+ modelId: this.modelId,
384
+ maxEmbeddingsPerCall: this.maxEmbeddingsPerCall,
385
+ values: this.values
386
+ };
387
+ }
388
+ };
389
+
390
+ // src/errors/tool-call-parse-error.ts
391
+ var ToolCallParseError = class extends Error {
392
+ constructor({
393
+ cause,
394
+ text,
395
+ tools,
396
+ message = `Failed to parse tool calls: ${getErrorMessage(cause)}`
397
+ }) {
398
+ super(message);
399
+ this.name = "AI_ToolCallParseError";
400
+ this.cause = cause;
401
+ this.text = text;
402
+ this.tools = tools;
403
+ }
404
+ static isToolCallParseError(error) {
405
+ return error instanceof Error && error.name === "AI_ToolCallParseError" && "cause" in error && error.cause != void 0 && "text" in error && error.text != void 0 && typeof error.text === "string" && "tools" in error && error.tools != void 0;
406
+ }
407
+ toJSON() {
408
+ return {
409
+ name: this.name,
410
+ message: this.message,
411
+ stack: this.stack,
412
+ cause: this.cause,
413
+ text: this.text,
414
+ tools: this.tools
415
+ };
416
+ }
417
+ };
418
+
419
+ // src/errors/type-validation-error.ts
420
+ var TypeValidationError = class extends Error {
421
+ constructor({ value, cause }) {
422
+ super(
423
+ `Type validation failed: Value: ${JSON.stringify(value)}.
424
+ Error message: ${getErrorMessage(cause)}`
425
+ );
426
+ this.name = "AI_TypeValidationError";
427
+ this.cause = cause;
428
+ this.value = value;
429
+ }
430
+ static isTypeValidationError(error) {
431
+ return error instanceof Error && error.name === "AI_TypeValidationError" && typeof error.value === "string" && typeof error.cause === "string";
432
+ }
433
+ toJSON() {
434
+ return {
435
+ name: this.name,
436
+ message: this.message,
437
+ cause: this.cause,
438
+ stack: this.stack,
439
+ value: this.value
440
+ };
441
+ }
442
+ };
443
+
444
+ // src/errors/unsupported-functionality-error.ts
445
+ var UnsupportedFunctionalityError = class extends Error {
446
+ constructor({ functionality }) {
447
+ super(`'${functionality}' functionality not supported.`);
448
+ this.name = "AI_UnsupportedFunctionalityError";
449
+ this.functionality = functionality;
450
+ }
451
+ static isUnsupportedFunctionalityError(error) {
452
+ return error instanceof Error && error.name === "AI_UnsupportedFunctionalityError" && typeof error.functionality === "string";
453
+ }
454
+ toJSON() {
455
+ return {
456
+ name: this.name,
457
+ message: this.message,
458
+ stack: this.stack,
459
+ functionality: this.functionality
460
+ };
461
+ }
462
+ };
463
+
464
+ // src/errors/unsupported-json-schema-error.ts
465
+ var UnsupportedJSONSchemaError = class extends Error {
466
+ constructor({
467
+ schema,
468
+ reason,
469
+ message = `Unsupported JSON schema: ${reason}`
470
+ }) {
471
+ super(message);
472
+ this.name = "AI_UnsupportedJSONSchemaError";
473
+ this.reason = reason;
474
+ this.schema = schema;
475
+ }
476
+ static isUnsupportedJSONSchemaError(error) {
477
+ return error instanceof Error && error.name === "AI_UnsupportedJSONSchemaError" && "reason" in error && error.reason != void 0 && "schema" in error && error.schema !== void 0;
478
+ }
479
+ toJSON() {
480
+ return {
481
+ name: this.name,
482
+ message: this.message,
483
+ stack: this.stack,
484
+ reason: this.reason,
485
+ schema: this.schema
486
+ };
487
+ }
488
+ };
489
+ // Annotate the CommonJS export names for ESM import in node:
490
+ 0 && (module.exports = {
491
+ APICallError,
492
+ EmptyResponseBodyError,
493
+ InvalidArgumentError,
494
+ InvalidDataContentError,
495
+ InvalidPromptError,
496
+ InvalidResponseDataError,
497
+ InvalidToolArgumentsError,
498
+ JSONParseError,
499
+ LoadAPIKeyError,
500
+ NoObjectGeneratedError,
501
+ NoSuchToolError,
502
+ RetryError,
503
+ TooManyEmbeddingValuesForCallError,
504
+ ToolCallParseError,
505
+ TypeValidationError,
506
+ UnsupportedFunctionalityError,
507
+ UnsupportedJSONSchemaError
508
+ });
509
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/errors/api-call-error.ts","../src/errors/empty-response-body-error.ts","../src/errors/invalid-argument-error.ts","../src/errors/invalid-data-content-error.ts","../src/errors/invalid-prompt-error.ts","../src/errors/invalid-response-data-error.ts","../src/errors/get-error-message.ts","../src/errors/invalid-tool-arguments-error.ts","../src/errors/json-parse-error.ts","../src/errors/load-api-key-error.ts","../src/errors/no-object-generated-error.ts","../src/errors/no-such-tool-error.ts","../src/errors/retry-error.ts","../src/errors/too-many-embedding-values-for-call-error.ts","../src/errors/tool-call-parse-error.ts","../src/errors/type-validation-error.ts","../src/errors/unsupported-functionality-error.ts","../src/errors/unsupported-json-schema-error.ts"],"sourcesContent":["export * from './embedding-model/index';\nexport * from './errors/index';\nexport * from './language-model/index';\n","export class APICallError extends Error {\n readonly url: string;\n readonly requestBodyValues: unknown;\n readonly statusCode?: number;\n\n readonly responseHeaders?: Record<string, string>;\n readonly responseBody?: string;\n\n readonly cause?: unknown;\n readonly isRetryable: boolean;\n readonly data?: unknown;\n\n constructor({\n message,\n url,\n requestBodyValues,\n statusCode,\n responseHeaders,\n responseBody,\n cause,\n isRetryable = statusCode != null &&\n (statusCode === 408 || // request timeout\n statusCode === 409 || // conflict\n statusCode === 429 || // too many requests\n statusCode >= 500), // server error\n data,\n }: {\n message: string;\n url: string;\n requestBodyValues: unknown;\n statusCode?: number;\n responseHeaders?: Record<string, string>;\n responseBody?: string;\n cause?: unknown;\n isRetryable?: boolean;\n data?: unknown;\n }) {\n super(message);\n\n this.name = 'AI_APICallError';\n\n this.url = url;\n this.requestBodyValues = requestBodyValues;\n this.statusCode = statusCode;\n this.responseHeaders = responseHeaders;\n this.responseBody = responseBody;\n this.cause = cause;\n this.isRetryable = isRetryable;\n this.data = data;\n }\n\n static isAPICallError(error: unknown): error is APICallError {\n return (\n error instanceof Error &&\n error.name === 'AI_APICallError' &&\n typeof (error as APICallError).url === 'string' &&\n typeof (error as APICallError).requestBodyValues === 'object' &&\n ((error as APICallError).statusCode == null ||\n typeof (error as APICallError).statusCode === 'number') &&\n ((error as APICallError).responseHeaders == null ||\n typeof (error as APICallError).responseHeaders === 'object') &&\n ((error as APICallError).responseBody == null ||\n typeof (error as APICallError).responseBody === 'string') &&\n ((error as APICallError).cause == null ||\n typeof (error as APICallError).cause === 'object') &&\n typeof (error as APICallError).isRetryable === 'boolean' &&\n ((error as APICallError).data == null ||\n typeof (error as APICallError).data === 'object')\n );\n }\n\n toJSON() {\n return {\n name: this.name,\n message: this.message,\n url: this.url,\n requestBodyValues: this.requestBodyValues,\n statusCode: this.statusCode,\n responseHeaders: this.responseHeaders,\n responseBody: this.responseBody,\n cause: this.cause,\n isRetryable: this.isRetryable,\n data: this.data,\n };\n }\n}\n","export class EmptyResponseBodyError extends Error {\n constructor({ message = 'Empty response body' }: { message?: string } = {}) {\n super(message);\n\n this.name = 'AI_EmptyResponseBodyError';\n }\n\n static isEmptyResponseBodyError(\n error: unknown,\n ): error is EmptyResponseBodyError {\n return error instanceof Error && error.name === 'AI_EmptyResponseBodyError';\n }\n\n toJSON() {\n return {\n name: this.name,\n message: this.message,\n stack: this.stack,\n };\n }\n}\n","export class InvalidArgumentError extends Error {\n readonly parameter: string;\n readonly value: unknown;\n\n constructor({\n parameter,\n value,\n message,\n }: {\n parameter: string;\n value: unknown;\n message: string;\n }) {\n super(`Invalid argument for parameter ${parameter}: ${message}`);\n\n this.name = 'AI_InvalidArgumentError';\n\n this.parameter = parameter;\n this.value = value;\n }\n\n static isInvalidArgumentError(error: unknown): error is InvalidArgumentError {\n return (\n error instanceof Error &&\n error.name === 'AI_InvalidArgumentError' &&\n typeof (error as InvalidArgumentError).parameter === 'string' &&\n typeof (error as InvalidArgumentError).value === 'string'\n );\n }\n\n toJSON() {\n return {\n name: this.name,\n message: this.message,\n stack: this.stack,\n\n parameter: this.parameter,\n value: this.value,\n };\n }\n}\n","export class InvalidDataContentError extends Error {\n readonly content: unknown;\n readonly cause?: unknown;\n\n constructor({\n content,\n cause,\n message = `Invalid data content. Expected a base64 string, Uint8Array, ArrayBuffer, or Buffer, but got ${typeof content}.`,\n }: {\n content: unknown;\n cause?: unknown;\n message?: string;\n }) {\n super(message);\n\n this.name = 'AI_InvalidDataContentError';\n\n this.cause = cause;\n this.content = content;\n }\n\n static isInvalidDataContentError(\n error: unknown,\n ): error is InvalidDataContentError {\n return (\n error instanceof Error &&\n error.name === 'AI_InvalidDataContentError' &&\n (error as InvalidDataContentError).content != null\n );\n }\n\n toJSON() {\n return {\n name: this.name,\n message: this.message,\n stack: this.stack,\n cause: this.cause,\n content: this.content,\n };\n }\n}\n","export class InvalidPromptError extends Error {\n readonly prompt: unknown;\n\n constructor({ prompt, message }: { prompt: unknown; message: string }) {\n super(`Invalid prompt: ${message}`);\n\n this.name = 'AI_InvalidPromptError';\n\n this.prompt = prompt;\n }\n\n static isInvalidPromptError(error: unknown): error is InvalidPromptError {\n return (\n error instanceof Error &&\n error.name === 'AI_InvalidPromptError' &&\n prompt != null\n );\n }\n\n toJSON() {\n return {\n name: this.name,\n message: this.message,\n stack: this.stack,\n\n prompt: this.prompt,\n };\n }\n}\n","/**\nServer returned a response with invalid data content. This should be thrown by providers when they\ncannot parse the response from the API.\n */\nexport class InvalidResponseDataError extends Error {\n readonly data: unknown;\n\n constructor({\n data,\n message = `Invalid response data: ${JSON.stringify(data)}.`,\n }: {\n data: unknown;\n message?: string;\n }) {\n super(message);\n\n this.name = 'AI_InvalidResponseDataError';\n\n this.data = data;\n }\n\n static isInvalidResponseDataError(\n error: unknown,\n ): error is InvalidResponseDataError {\n return (\n error instanceof Error &&\n error.name === 'AI_InvalidResponseDataError' &&\n (error as InvalidResponseDataError).data != null\n );\n }\n\n toJSON() {\n return {\n name: this.name,\n message: this.message,\n stack: this.stack,\n\n data: this.data,\n };\n }\n}\n","export function getErrorMessage(error: unknown | undefined) {\n if (error == null) {\n return 'unknown error';\n }\n\n if (typeof error === 'string') {\n return error;\n }\n\n if (error instanceof Error) {\n return error.message;\n }\n\n return JSON.stringify(error);\n}\n","import { getErrorMessage } from './get-error-message';\n\nexport class InvalidToolArgumentsError extends Error {\n readonly toolName: string;\n readonly toolArgs: string;\n readonly cause: unknown;\n\n constructor({\n toolArgs,\n toolName,\n cause,\n message = `Invalid arguments for tool ${toolName}: ${getErrorMessage(\n cause,\n )}`,\n }: {\n message?: string;\n toolArgs: string;\n toolName: string;\n cause: unknown;\n }) {\n super(message);\n\n this.name = 'AI_InvalidToolArgumentsError';\n\n this.toolArgs = toolArgs;\n this.toolName = toolName;\n this.cause = cause;\n }\n\n static isInvalidToolArgumentsError(\n error: unknown,\n ): error is InvalidToolArgumentsError {\n return (\n error instanceof Error &&\n error.name === 'AI_InvalidToolArgumentsError' &&\n typeof (error as InvalidToolArgumentsError).toolName === 'string' &&\n typeof (error as InvalidToolArgumentsError).toolArgs === 'string'\n );\n }\n\n toJSON() {\n return {\n name: this.name,\n message: this.message,\n cause: this.cause,\n stack: this.stack,\n\n toolName: this.toolName,\n toolArgs: this.toolArgs,\n };\n }\n}\n","import { getErrorMessage } from './get-error-message';\n\nexport class JSONParseError extends Error {\n // note: property order determines debugging output\n readonly text: string;\n readonly cause: unknown;\n\n constructor({ text, cause }: { text: string; cause: unknown }) {\n super(\n `JSON parsing failed: ` +\n `Text: ${text}.\\n` +\n `Error message: ${getErrorMessage(cause)}`,\n );\n\n this.name = 'AI_JSONParseError';\n\n this.cause = cause;\n this.text = text;\n }\n\n static isJSONParseError(error: unknown): error is JSONParseError {\n return (\n error instanceof Error &&\n error.name === 'AI_JSONParseError' &&\n typeof (error as JSONParseError).text === 'string' &&\n typeof (error as JSONParseError).cause === 'string'\n );\n }\n\n toJSON() {\n return {\n name: this.name,\n message: this.message,\n cause: this.cause,\n stack: this.stack,\n\n valueText: this.text,\n };\n }\n}\n","export class LoadAPIKeyError extends Error {\n constructor({ message }: { message: string }) {\n super(message);\n\n this.name = 'AI_LoadAPIKeyError';\n }\n\n static isLoadAPIKeyError(error: unknown): error is LoadAPIKeyError {\n return error instanceof Error && error.name === 'AI_LoadAPIKeyError';\n }\n\n toJSON() {\n return {\n name: this.name,\n message: this.message,\n };\n }\n}\n","export class NoObjectGeneratedError extends Error {\n readonly cause: unknown;\n\n constructor() {\n super(`No object generated.`);\n\n this.name = 'AI_NoObjectGeneratedError';\n }\n\n static isNoTextGeneratedError(\n error: unknown,\n ): error is NoObjectGeneratedError {\n return error instanceof Error && error.name === 'AI_NoObjectGeneratedError';\n }\n\n toJSON() {\n return {\n name: this.name,\n cause: this.cause,\n message: this.message,\n stack: this.stack,\n };\n }\n}\n","export class NoSuchToolError extends Error {\n readonly toolName: string;\n readonly availableTools: string[] | undefined;\n\n constructor({\n toolName,\n availableTools = undefined,\n message = `Model tried to call unavailable tool '${toolName}'. ${\n availableTools === undefined\n ? 'No tools are available.'\n : `Available tools: ${availableTools.join(', ')}.`\n }`,\n }: {\n toolName: string;\n availableTools?: string[] | undefined;\n message?: string;\n }) {\n super(message);\n\n this.name = 'AI_NoSuchToolError';\n\n this.toolName = toolName;\n this.availableTools = availableTools;\n }\n\n static isNoSuchToolError(error: unknown): error is NoSuchToolError {\n return (\n error instanceof Error &&\n error.name === 'AI_NoSuchToolError' &&\n 'toolName' in error &&\n error.toolName != undefined &&\n typeof error.name === 'string'\n );\n }\n\n toJSON() {\n return {\n name: this.name,\n message: this.message,\n stack: this.stack,\n\n toolName: this.toolName,\n availableTools: this.availableTools,\n };\n }\n}\n","export type RetryErrorReason =\n | 'maxRetriesExceeded'\n | 'errorNotRetryable'\n | 'abort';\n\nexport class RetryError extends Error {\n // note: property order determines debugging output\n readonly reason: RetryErrorReason;\n readonly lastError: unknown;\n readonly errors: Array<unknown>;\n\n constructor({\n message,\n reason,\n errors,\n }: {\n message: string;\n reason: RetryErrorReason;\n errors: Array<unknown>;\n }) {\n super(message);\n\n this.name = 'AI_RetryError';\n this.reason = reason;\n this.errors = errors;\n\n // separate our last error to make debugging via log easier:\n this.lastError = errors[errors.length - 1];\n }\n\n static isRetryError(error: unknown): error is RetryError {\n return (\n error instanceof Error &&\n error.name === 'AI_RetryError' &&\n typeof (error as RetryError).reason === 'string' &&\n Array.isArray((error as RetryError).errors)\n );\n }\n\n toJSON() {\n return {\n name: this.name,\n message: this.message,\n reason: this.reason,\n lastError: this.lastError,\n errors: this.errors,\n };\n }\n}\n","export class TooManyEmbeddingValuesForCallError extends Error {\n readonly provider: string;\n readonly modelId: string;\n readonly maxEmbeddingsPerCall: number;\n readonly values: Array<unknown>;\n\n constructor(options: {\n provider: string;\n modelId: string;\n maxEmbeddingsPerCall: number;\n values: Array<unknown>;\n }) {\n super(\n `Too many values for a single embedding call. ` +\n `The ${options.provider} model \"${options.modelId}\" can only embed up to ` +\n `${options.maxEmbeddingsPerCall} values per call, but ${options.values.length} values were provided.`,\n );\n\n this.name = 'AI_TooManyEmbeddingValuesForCallError';\n\n this.provider = options.provider;\n this.modelId = options.modelId;\n this.maxEmbeddingsPerCall = options.maxEmbeddingsPerCall;\n this.values = options.values;\n }\n\n static isInvalidPromptError(\n error: unknown,\n ): error is TooManyEmbeddingValuesForCallError {\n return (\n error instanceof Error &&\n error.name === 'AI_TooManyEmbeddingValuesForCallError' &&\n 'provider' in error &&\n typeof error.provider === 'string' &&\n 'modelId' in error &&\n typeof error.modelId === 'string' &&\n 'maxEmbeddingsPerCall' in error &&\n typeof error.maxEmbeddingsPerCall === 'number' &&\n 'values' in error &&\n Array.isArray(error.values)\n );\n }\n\n toJSON() {\n return {\n name: this.name,\n message: this.message,\n stack: this.stack,\n\n provider: this.provider,\n modelId: this.modelId,\n maxEmbeddingsPerCall: this.maxEmbeddingsPerCall,\n values: this.values,\n };\n }\n}\n","import { LanguageModelV1FunctionTool } from '../language-model/v1/language-model-v1-function-tool';\nimport { getErrorMessage } from './get-error-message';\n\nexport class ToolCallParseError extends Error {\n readonly cause: unknown;\n readonly text: string;\n readonly tools: LanguageModelV1FunctionTool[];\n\n constructor({\n cause,\n text,\n tools,\n message = `Failed to parse tool calls: ${getErrorMessage(cause)}`,\n }: {\n cause: unknown;\n text: string;\n tools: LanguageModelV1FunctionTool[];\n message?: string;\n }) {\n super(message);\n\n this.name = 'AI_ToolCallParseError';\n\n this.cause = cause;\n this.text = text;\n this.tools = tools;\n }\n\n static isToolCallParseError(error: unknown): error is ToolCallParseError {\n return (\n error instanceof Error &&\n error.name === 'AI_ToolCallParseError' &&\n 'cause' in error &&\n error.cause != undefined &&\n 'text' in error &&\n error.text != undefined &&\n typeof error.text === 'string' &&\n 'tools' in error &&\n error.tools != undefined\n );\n }\n\n toJSON() {\n return {\n name: this.name,\n message: this.message,\n stack: this.stack,\n\n cause: this.cause,\n text: this.text,\n tools: this.tools,\n };\n }\n}\n","import { getErrorMessage } from './get-error-message';\n\nexport class TypeValidationError extends Error {\n readonly value: unknown;\n readonly cause: unknown;\n\n constructor({ value, cause }: { value: unknown; cause: unknown }) {\n super(\n `Type validation failed: ` +\n `Value: ${JSON.stringify(value)}.\\n` +\n `Error message: ${getErrorMessage(cause)}`,\n );\n\n this.name = 'AI_TypeValidationError';\n\n this.cause = cause;\n this.value = value;\n }\n\n static isTypeValidationError(error: unknown): error is TypeValidationError {\n return (\n error instanceof Error &&\n error.name === 'AI_TypeValidationError' &&\n typeof (error as TypeValidationError).value === 'string' &&\n typeof (error as TypeValidationError).cause === 'string'\n );\n }\n\n toJSON() {\n return {\n name: this.name,\n message: this.message,\n cause: this.cause,\n stack: this.stack,\n\n value: this.value,\n };\n }\n}\n","export class UnsupportedFunctionalityError extends Error {\n readonly functionality: string;\n\n constructor({ functionality }: { functionality: string }) {\n super(`'${functionality}' functionality not supported.`);\n\n this.name = 'AI_UnsupportedFunctionalityError';\n\n this.functionality = functionality;\n }\n\n static isUnsupportedFunctionalityError(\n error: unknown,\n ): error is UnsupportedFunctionalityError {\n return (\n error instanceof Error &&\n error.name === 'AI_UnsupportedFunctionalityError' &&\n typeof (error as UnsupportedFunctionalityError).functionality === 'string'\n );\n }\n\n toJSON() {\n return {\n name: this.name,\n message: this.message,\n stack: this.stack,\n\n functionality: this.functionality,\n };\n }\n}\n","export class UnsupportedJSONSchemaError extends Error {\n readonly reason: string;\n readonly schema: unknown;\n\n constructor({\n schema,\n reason,\n message = `Unsupported JSON schema: ${reason}`,\n }: {\n schema: unknown;\n reason: string;\n message?: string;\n }) {\n super(message);\n\n this.name = 'AI_UnsupportedJSONSchemaError';\n\n this.reason = reason;\n this.schema = schema;\n }\n\n static isUnsupportedJSONSchemaError(\n error: unknown,\n ): error is UnsupportedJSONSchemaError {\n return (\n error instanceof Error &&\n error.name === 'AI_UnsupportedJSONSchemaError' &&\n 'reason' in error &&\n error.reason != undefined &&\n 'schema' in error &&\n error.schema !== undefined\n );\n }\n\n toJSON() {\n return {\n name: this.name,\n message: this.message,\n stack: this.stack,\n\n reason: this.reason,\n schema: this.schema,\n };\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,eAAN,cAA2B,MAAM;AAAA,EAYtC,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc,cAAc,SACzB,eAAe;AAAA,IACd,eAAe;AAAA,IACf,eAAe;AAAA,IACf,cAAc;AAAA;AAAA,IAClB;AAAA,EACF,GAUG;AACD,UAAM,OAAO;AAEb,SAAK,OAAO;AAEZ,SAAK,MAAM;AACX,SAAK,oBAAoB;AACzB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,eAAe;AACpB,SAAK,QAAQ;AACb,SAAK,cAAc;AACnB,SAAK,OAAO;AAAA,EACd;AAAA,EAEA,OAAO,eAAe,OAAuC;AAC3D,WACE,iBAAiB,SACjB,MAAM,SAAS,qBACf,OAAQ,MAAuB,QAAQ,YACvC,OAAQ,MAAuB,sBAAsB,aACnD,MAAuB,cAAc,QACrC,OAAQ,MAAuB,eAAe,cAC9C,MAAuB,mBAAmB,QAC1C,OAAQ,MAAuB,oBAAoB,cACnD,MAAuB,gBAAgB,QACvC,OAAQ,MAAuB,iBAAiB,cAChD,MAAuB,SAAS,QAChC,OAAQ,MAAuB,UAAU,aAC3C,OAAQ,MAAuB,gBAAgB,cAC7C,MAAuB,QAAQ,QAC/B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