@ai-sdk/provider 0.0.26 → 1.0.0

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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @ai-sdk/provider
2
2
 
3
+ ## 1.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - b469a7e: chore: remove isXXXError methods
8
+ - c0ddc24: chore (ai): remove toJSON method from AI SDK errors
9
+
10
+ ## 1.0.0-canary.0
11
+
12
+ ### Major Changes
13
+
14
+ - b469a7e: chore: remove isXXXError methods
15
+ - c0ddc24: chore (ai): remove toJSON method from AI SDK errors
16
+
3
17
  ## 0.0.26
4
18
 
5
19
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -114,16 +114,6 @@ declare class AISDKError extends Error {
114
114
  */
115
115
  static isInstance(error: unknown): error is AISDKError;
116
116
  protected static hasMarker(error: unknown, marker: string): boolean;
117
- /**
118
- * Returns a JSON representation of the error.
119
- * @returns {Object} An object containing the error's name, message, and cause.
120
- *
121
- * @deprecated Do not use this method. It will be removed in the next major version.
122
- */
123
- toJSON(): {
124
- name: string;
125
- message: string;
126
- };
127
117
  }
128
118
 
129
119
  declare const symbol$c: unique symbol;
@@ -149,25 +139,6 @@ declare class APICallError extends AISDKError {
149
139
  data?: unknown;
150
140
  });
151
141
  static isInstance(error: unknown): error is APICallError;
152
- /**
153
- * @deprecated Use isInstance instead.
154
- */
155
- static isAPICallError(error: unknown): error is APICallError;
156
- /**
157
- * @deprecated Do not use this method. It will be removed in the next major version.
158
- */
159
- toJSON(): {
160
- name: string;
161
- message: string;
162
- url: string;
163
- requestBodyValues: unknown;
164
- statusCode: number | undefined;
165
- responseHeaders: Record<string, string> | undefined;
166
- responseBody: string | undefined;
167
- cause: unknown;
168
- isRetryable: boolean;
169
- data: unknown;
170
- };
171
142
  }
172
143
 
173
144
  declare const symbol$b: unique symbol;
@@ -177,10 +148,6 @@ declare class EmptyResponseBodyError extends AISDKError {
177
148
  message?: string;
178
149
  });
179
150
  static isInstance(error: unknown): error is EmptyResponseBodyError;
180
- /**
181
- * @deprecated use `isInstance` instead
182
- */
183
- static isEmptyResponseBodyError(error: unknown): error is EmptyResponseBodyError;
184
151
  }
185
152
 
186
153
  declare function getErrorMessage(error: unknown | undefined): string;
@@ -214,19 +181,6 @@ declare class InvalidPromptError extends AISDKError {
214
181
  cause?: unknown;
215
182
  });
216
183
  static isInstance(error: unknown): error is InvalidPromptError;
217
- /**
218
- * @deprecated use `isInstance` instead
219
- */
220
- static isInvalidPromptError(error: unknown): error is InvalidPromptError;
221
- /**
222
- * @deprecated Do not use this method. It will be removed in the next major version.
223
- */
224
- toJSON(): {
225
- name: string;
226
- message: string;
227
- stack: string | undefined;
228
- prompt: unknown;
229
- };
230
184
  }
231
185
 
232
186
  declare const symbol$8: unique symbol;
@@ -242,19 +196,6 @@ declare class InvalidResponseDataError extends AISDKError {
242
196
  message?: string;
243
197
  });
244
198
  static isInstance(error: unknown): error is InvalidResponseDataError;
245
- /**
246
- * @deprecated use `isInstance` instead
247
- */
248
- static isInvalidResponseDataError(error: unknown): error is InvalidResponseDataError;
249
- /**
250
- * @deprecated Do not use this method. It will be removed in the next major version.
251
- */
252
- toJSON(): {
253
- name: string;
254
- message: string;
255
- stack: string | undefined;
256
- data: unknown;
257
- };
258
199
  }
259
200
 
260
201
  declare const symbol$7: unique symbol;
@@ -266,20 +207,6 @@ declare class JSONParseError extends AISDKError {
266
207
  cause: unknown;
267
208
  });
268
209
  static isInstance(error: unknown): error is JSONParseError;
269
- /**
270
- * @deprecated use `isInstance` instead
271
- */
272
- static isJSONParseError(error: unknown): error is JSONParseError;
273
- /**
274
- * @deprecated Do not use this method. It will be removed in the next major version.
275
- */
276
- toJSON(): {
277
- name: string;
278
- message: string;
279
- cause: unknown;
280
- stack: string | undefined;
281
- valueText: string;
282
- };
283
210
  }
284
211
 
285
212
  declare const symbol$6: unique symbol;
@@ -289,10 +216,6 @@ declare class LoadAPIKeyError extends AISDKError {
289
216
  message: string;
290
217
  });
291
218
  static isInstance(error: unknown): error is LoadAPIKeyError;
292
- /**
293
- * @deprecated Use isInstance instead.
294
- */
295
- static isLoadAPIKeyError(error: unknown): error is LoadAPIKeyError;
296
219
  }
297
220
 
298
221
  declare const symbol$5: unique symbol;
@@ -302,10 +225,6 @@ declare class LoadSettingError extends AISDKError {
302
225
  message: string;
303
226
  });
304
227
  static isInstance(error: unknown): error is LoadSettingError;
305
- /**
306
- * @deprecated Use isInstance instead.
307
- */
308
- static isLoadSettingError(error: unknown): error is LoadSettingError;
309
228
  }
310
229
 
311
230
  declare const symbol$4: unique symbol;
@@ -318,19 +237,6 @@ declare class NoContentGeneratedError extends AISDKError {
318
237
  message?: string;
319
238
  });
320
239
  static isInstance(error: unknown): error is NoContentGeneratedError;
321
- /**
322
- * @deprecated Use isInstance instead.
323
- */
324
- static isNoContentGeneratedError(error: unknown): error is NoContentGeneratedError;
325
- /**
326
- * @deprecated Do not use this method. It will be removed in the next major version.
327
- */
328
- toJSON(): {
329
- name: string;
330
- cause: unknown;
331
- message: string;
332
- stack: string | undefined;
333
- };
334
240
  }
335
241
 
336
242
  declare const symbol$3: unique symbol;
@@ -345,20 +251,6 @@ declare class NoSuchModelError extends AISDKError {
345
251
  message?: string;
346
252
  });
347
253
  static isInstance(error: unknown): error is NoSuchModelError;
348
- /**
349
- * @deprecated use `isInstance` instead
350
- */
351
- static isNoSuchModelError(error: unknown): error is NoSuchModelError;
352
- /**
353
- * @deprecated Do not use this method. It will be removed in the next major version.
354
- */
355
- toJSON(): {
356
- name: string;
357
- message: string;
358
- stack: string | undefined;
359
- modelId: string;
360
- modelType: "languageModel" | "textEmbeddingModel";
361
- };
362
254
  }
363
255
 
364
256
  declare const symbol$2: unique symbol;
@@ -375,22 +267,6 @@ declare class TooManyEmbeddingValuesForCallError extends AISDKError {
375
267
  values: Array<unknown>;
376
268
  });
377
269
  static isInstance(error: unknown): error is TooManyEmbeddingValuesForCallError;
378
- /**
379
- * @deprecated use `isInstance` instead
380
- */
381
- static isTooManyEmbeddingValuesForCallError(error: unknown): error is TooManyEmbeddingValuesForCallError;
382
- /**
383
- * @deprecated Do not use this method. It will be removed in the next major version.
384
- */
385
- toJSON(): {
386
- name: string;
387
- message: string;
388
- stack: string | undefined;
389
- provider: string;
390
- modelId: string;
391
- maxEmbeddingsPerCall: number;
392
- values: unknown[];
393
- };
394
270
  }
395
271
 
396
272
  declare const symbol$1: unique symbol;
@@ -416,20 +292,6 @@ declare class TypeValidationError extends AISDKError {
416
292
  value: unknown;
417
293
  cause: unknown;
418
294
  }): TypeValidationError;
419
- /**
420
- * @deprecated use `isInstance` instead
421
- */
422
- static isTypeValidationError(error: unknown): error is TypeValidationError;
423
- /**
424
- * @deprecated Do not use this method. It will be removed in the next major version.
425
- */
426
- toJSON(): {
427
- name: string;
428
- message: string;
429
- cause: unknown;
430
- stack: string | undefined;
431
- value: unknown;
432
- };
433
295
  }
434
296
 
435
297
  declare const symbol: unique symbol;
@@ -440,19 +302,6 @@ declare class UnsupportedFunctionalityError extends AISDKError {
440
302
  functionality: string;
441
303
  });
442
304
  static isInstance(error: unknown): error is UnsupportedFunctionalityError;
443
- /**
444
- * @deprecated Use isInstance instead.
445
- */
446
- static isUnsupportedFunctionalityError(error: unknown): error is UnsupportedFunctionalityError;
447
- /**
448
- * @deprecated Do not use this method. It will be removed in the next major version.
449
- */
450
- toJSON(): {
451
- name: string;
452
- message: string;
453
- stack: string | undefined;
454
- functionality: string;
455
- };
456
305
  }
457
306
 
458
307
  type JSONValue = null | string | number | boolean | JSONObject | JSONArray;
package/dist/index.d.ts CHANGED
@@ -114,16 +114,6 @@ declare class AISDKError extends Error {
114
114
  */
115
115
  static isInstance(error: unknown): error is AISDKError;
116
116
  protected static hasMarker(error: unknown, marker: string): boolean;
117
- /**
118
- * Returns a JSON representation of the error.
119
- * @returns {Object} An object containing the error's name, message, and cause.
120
- *
121
- * @deprecated Do not use this method. It will be removed in the next major version.
122
- */
123
- toJSON(): {
124
- name: string;
125
- message: string;
126
- };
127
117
  }
128
118
 
129
119
  declare const symbol$c: unique symbol;
@@ -149,25 +139,6 @@ declare class APICallError extends AISDKError {
149
139
  data?: unknown;
150
140
  });
151
141
  static isInstance(error: unknown): error is APICallError;
152
- /**
153
- * @deprecated Use isInstance instead.
154
- */
155
- static isAPICallError(error: unknown): error is APICallError;
156
- /**
157
- * @deprecated Do not use this method. It will be removed in the next major version.
158
- */
159
- toJSON(): {
160
- name: string;
161
- message: string;
162
- url: string;
163
- requestBodyValues: unknown;
164
- statusCode: number | undefined;
165
- responseHeaders: Record<string, string> | undefined;
166
- responseBody: string | undefined;
167
- cause: unknown;
168
- isRetryable: boolean;
169
- data: unknown;
170
- };
171
142
  }
172
143
 
173
144
  declare const symbol$b: unique symbol;
@@ -177,10 +148,6 @@ declare class EmptyResponseBodyError extends AISDKError {
177
148
  message?: string;
178
149
  });
179
150
  static isInstance(error: unknown): error is EmptyResponseBodyError;
180
- /**
181
- * @deprecated use `isInstance` instead
182
- */
183
- static isEmptyResponseBodyError(error: unknown): error is EmptyResponseBodyError;
184
151
  }
185
152
 
186
153
  declare function getErrorMessage(error: unknown | undefined): string;
@@ -214,19 +181,6 @@ declare class InvalidPromptError extends AISDKError {
214
181
  cause?: unknown;
215
182
  });
216
183
  static isInstance(error: unknown): error is InvalidPromptError;
217
- /**
218
- * @deprecated use `isInstance` instead
219
- */
220
- static isInvalidPromptError(error: unknown): error is InvalidPromptError;
221
- /**
222
- * @deprecated Do not use this method. It will be removed in the next major version.
223
- */
224
- toJSON(): {
225
- name: string;
226
- message: string;
227
- stack: string | undefined;
228
- prompt: unknown;
229
- };
230
184
  }
231
185
 
232
186
  declare const symbol$8: unique symbol;
@@ -242,19 +196,6 @@ declare class InvalidResponseDataError extends AISDKError {
242
196
  message?: string;
243
197
  });
244
198
  static isInstance(error: unknown): error is InvalidResponseDataError;
245
- /**
246
- * @deprecated use `isInstance` instead
247
- */
248
- static isInvalidResponseDataError(error: unknown): error is InvalidResponseDataError;
249
- /**
250
- * @deprecated Do not use this method. It will be removed in the next major version.
251
- */
252
- toJSON(): {
253
- name: string;
254
- message: string;
255
- stack: string | undefined;
256
- data: unknown;
257
- };
258
199
  }
259
200
 
260
201
  declare const symbol$7: unique symbol;
@@ -266,20 +207,6 @@ declare class JSONParseError extends AISDKError {
266
207
  cause: unknown;
267
208
  });
268
209
  static isInstance(error: unknown): error is JSONParseError;
269
- /**
270
- * @deprecated use `isInstance` instead
271
- */
272
- static isJSONParseError(error: unknown): error is JSONParseError;
273
- /**
274
- * @deprecated Do not use this method. It will be removed in the next major version.
275
- */
276
- toJSON(): {
277
- name: string;
278
- message: string;
279
- cause: unknown;
280
- stack: string | undefined;
281
- valueText: string;
282
- };
283
210
  }
284
211
 
285
212
  declare const symbol$6: unique symbol;
@@ -289,10 +216,6 @@ declare class LoadAPIKeyError extends AISDKError {
289
216
  message: string;
290
217
  });
291
218
  static isInstance(error: unknown): error is LoadAPIKeyError;
292
- /**
293
- * @deprecated Use isInstance instead.
294
- */
295
- static isLoadAPIKeyError(error: unknown): error is LoadAPIKeyError;
296
219
  }
297
220
 
298
221
  declare const symbol$5: unique symbol;
@@ -302,10 +225,6 @@ declare class LoadSettingError extends AISDKError {
302
225
  message: string;
303
226
  });
304
227
  static isInstance(error: unknown): error is LoadSettingError;
305
- /**
306
- * @deprecated Use isInstance instead.
307
- */
308
- static isLoadSettingError(error: unknown): error is LoadSettingError;
309
228
  }
310
229
 
311
230
  declare const symbol$4: unique symbol;
@@ -318,19 +237,6 @@ declare class NoContentGeneratedError extends AISDKError {
318
237
  message?: string;
319
238
  });
320
239
  static isInstance(error: unknown): error is NoContentGeneratedError;
321
- /**
322
- * @deprecated Use isInstance instead.
323
- */
324
- static isNoContentGeneratedError(error: unknown): error is NoContentGeneratedError;
325
- /**
326
- * @deprecated Do not use this method. It will be removed in the next major version.
327
- */
328
- toJSON(): {
329
- name: string;
330
- cause: unknown;
331
- message: string;
332
- stack: string | undefined;
333
- };
334
240
  }
335
241
 
336
242
  declare const symbol$3: unique symbol;
@@ -345,20 +251,6 @@ declare class NoSuchModelError extends AISDKError {
345
251
  message?: string;
346
252
  });
347
253
  static isInstance(error: unknown): error is NoSuchModelError;
348
- /**
349
- * @deprecated use `isInstance` instead
350
- */
351
- static isNoSuchModelError(error: unknown): error is NoSuchModelError;
352
- /**
353
- * @deprecated Do not use this method. It will be removed in the next major version.
354
- */
355
- toJSON(): {
356
- name: string;
357
- message: string;
358
- stack: string | undefined;
359
- modelId: string;
360
- modelType: "languageModel" | "textEmbeddingModel";
361
- };
362
254
  }
363
255
 
364
256
  declare const symbol$2: unique symbol;
@@ -375,22 +267,6 @@ declare class TooManyEmbeddingValuesForCallError extends AISDKError {
375
267
  values: Array<unknown>;
376
268
  });
377
269
  static isInstance(error: unknown): error is TooManyEmbeddingValuesForCallError;
378
- /**
379
- * @deprecated use `isInstance` instead
380
- */
381
- static isTooManyEmbeddingValuesForCallError(error: unknown): error is TooManyEmbeddingValuesForCallError;
382
- /**
383
- * @deprecated Do not use this method. It will be removed in the next major version.
384
- */
385
- toJSON(): {
386
- name: string;
387
- message: string;
388
- stack: string | undefined;
389
- provider: string;
390
- modelId: string;
391
- maxEmbeddingsPerCall: number;
392
- values: unknown[];
393
- };
394
270
  }
395
271
 
396
272
  declare const symbol$1: unique symbol;
@@ -416,20 +292,6 @@ declare class TypeValidationError extends AISDKError {
416
292
  value: unknown;
417
293
  cause: unknown;
418
294
  }): TypeValidationError;
419
- /**
420
- * @deprecated use `isInstance` instead
421
- */
422
- static isTypeValidationError(error: unknown): error is TypeValidationError;
423
- /**
424
- * @deprecated Do not use this method. It will be removed in the next major version.
425
- */
426
- toJSON(): {
427
- name: string;
428
- message: string;
429
- cause: unknown;
430
- stack: string | undefined;
431
- value: unknown;
432
- };
433
295
  }
434
296
 
435
297
  declare const symbol: unique symbol;
@@ -440,19 +302,6 @@ declare class UnsupportedFunctionalityError extends AISDKError {
440
302
  functionality: string;
441
303
  });
442
304
  static isInstance(error: unknown): error is UnsupportedFunctionalityError;
443
- /**
444
- * @deprecated Use isInstance instead.
445
- */
446
- static isUnsupportedFunctionalityError(error: unknown): error is UnsupportedFunctionalityError;
447
- /**
448
- * @deprecated Do not use this method. It will be removed in the next major version.
449
- */
450
- toJSON(): {
451
- name: string;
452
- message: string;
453
- stack: string | undefined;
454
- functionality: string;
455
- };
456
305
  }
457
306
 
458
307
  type JSONValue = null | string | number | boolean | JSONObject | JSONArray;