@ai-sdk/gateway 3.0.112 → 3.0.115

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ai-sdk/gateway",
3
3
  "private": false,
4
- "version": "3.0.112",
4
+ "version": "3.0.115",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
7
7
  "main": "./dist/index.js",
@@ -9,22 +9,30 @@ export abstract class GatewayError extends Error {
9
9
  readonly statusCode: number;
10
10
  readonly cause?: unknown;
11
11
  readonly generationId?: string;
12
+ readonly isRetryable: boolean;
12
13
 
13
14
  constructor({
14
15
  message,
15
16
  statusCode = 500,
16
17
  cause,
17
18
  generationId,
19
+ isRetryable = statusCode != null &&
20
+ (statusCode === 408 || // request timeout
21
+ statusCode === 409 || // conflict
22
+ statusCode === 429 || // too many requests
23
+ statusCode >= 500), // server error
18
24
  }: {
19
25
  message: string;
20
26
  statusCode?: number;
21
27
  cause?: unknown;
22
28
  generationId?: string;
29
+ isRetryable?: boolean;
23
30
  }) {
24
31
  super(generationId ? `${message} [${generationId}]` : message);
25
32
  this.statusCode = statusCode;
26
33
  this.cause = cause;
27
34
  this.generationId = generationId;
35
+ this.isRetryable = isRetryable;
28
36
  }
29
37
 
30
38
  /**
@@ -24,6 +24,10 @@ export type GatewayImageModelId =
24
24
  | 'recraft/recraft-v3'
25
25
  | 'recraft/recraft-v4'
26
26
  | 'recraft/recraft-v4-pro'
27
+ | 'recraft/recraft-v4.1'
28
+ | 'recraft/recraft-v4.1-pro'
29
+ | 'recraft/recraft-v4.1-utility'
30
+ | 'recraft/recraft-v4.1-utility-pro'
27
31
  | 'xai/grok-imagine-image'
28
32
  | 'xai/grok-imagine-image-pro'
29
33
  | (string & {});
@@ -27,7 +27,6 @@ export type GatewayModelId =
27
27
  | 'amazon/nova-pro'
28
28
  | 'anthropic/claude-3-haiku'
29
29
  | 'anthropic/claude-3.5-haiku'
30
- | 'anthropic/claude-3.7-sonnet'
31
30
  | 'anthropic/claude-haiku-4.5'
32
31
  | 'anthropic/claude-opus-4'
33
32
  | 'anthropic/claude-opus-4.1'