@ai-sdk/gateway 3.0.184 → 3.0.186

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.184",
4
+ "version": "3.0.186",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
7
7
  "main": "./dist/index.js",
@@ -32,7 +32,7 @@
32
32
  "dependencies": {
33
33
  "@vercel/oidc": "3.2.0",
34
34
  "@ai-sdk/provider": "3.0.15",
35
- "@ai-sdk/provider-utils": "4.0.49"
35
+ "@ai-sdk/provider-utils": "4.0.50"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/node": "18.15.11",
@@ -59,6 +59,11 @@ export async function asGatewayError(
59
59
  defaultMessage: 'Gateway request failed',
60
60
  cause: error,
61
61
  authMethod,
62
+ isRetryable:
63
+ error.isRetryable &&
64
+ (error.statusCode == null || error.statusCode < 400)
65
+ ? true
66
+ : undefined,
62
67
  });
63
68
  }
64
69
 
@@ -28,12 +28,14 @@ export async function createGatewayErrorFromResponse({
28
28
  defaultMessage = 'Gateway request failed',
29
29
  cause,
30
30
  authMethod,
31
+ isRetryable,
31
32
  }: {
32
33
  response: unknown;
33
34
  statusCode: number;
34
35
  defaultMessage?: string;
35
36
  cause?: unknown;
36
37
  authMethod?: 'api-key' | 'oidc';
38
+ isRetryable?: boolean;
37
39
  }): Promise<GatewayError> {
38
40
  const parseResult = await safeValidateTypes({
39
41
  value: response,
@@ -56,6 +58,7 @@ export async function createGatewayErrorFromResponse({
56
58
  validationError: parseResult.error,
57
59
  cause,
58
60
  generationId: rawGenerationId,
61
+ isRetryable,
59
62
  });
60
63
  }
61
64
 
@@ -23,6 +23,7 @@ export class GatewayResponseError extends GatewayError {
23
23
  validationError,
24
24
  cause,
25
25
  generationId,
26
+ isRetryable,
26
27
  }: {
27
28
  message?: string;
28
29
  statusCode?: number;
@@ -30,8 +31,9 @@ export class GatewayResponseError extends GatewayError {
30
31
  validationError?: TypeValidationError;
31
32
  cause?: unknown;
32
33
  generationId?: string;
34
+ isRetryable?: boolean;
33
35
  } = {}) {
34
- super({ message, statusCode, cause, generationId });
36
+ super({ message, statusCode, cause, generationId, isRetryable });
35
37
  this.response = response;
36
38
  this.validationError = validationError;
37
39
  }
@@ -13,6 +13,7 @@ export type GatewayImageModelId =
13
13
  | 'bytedance/seedream-4.5'
14
14
  | 'bytedance/seedream-5.0-lite'
15
15
  | 'bytedance/seedream-5.0-pro'
16
+ | 'meta/muse-image-1.0'
16
17
  | 'openai/gpt-image-1'
17
18
  | 'openai/gpt-image-1-mini'
18
19
  | 'openai/gpt-image-1.5'
@@ -26,6 +26,8 @@ export type GatewayModelId =
26
26
  | 'alibaba/qwen3.7-plus'
27
27
  | 'alibaba/qwen3.8-2.4t-a95b'
28
28
  | 'alibaba/qwen3.8-27b'
29
+ | 'alibaba/qwen3.8-flash'
30
+ | 'alibaba/qwen3.8-flash-next'
29
31
  | 'alibaba/qwen3.8-max'
30
32
  | 'amazon/nova-2-lite'
31
33
  | 'amazon/nova-lite'
@@ -82,6 +84,8 @@ export type GatewayModelId =
82
84
  | 'inception/mercury-2'
83
85
  | 'inception/mercury-coder-small'
84
86
  | 'inclusionai/ling-3.0-flash'
87
+ | 'inclusionai/ling-3.0-flash-fin'
88
+ | 'inclusionai/ling-3.0-flash-fin-free'
85
89
  | 'interfaze/interfaze-beta'
86
90
  | 'kwaipilot/kat-coder-air-v2.5'
87
91
  | 'kwaipilot/kat-coder-pro-v1'
@@ -215,6 +219,7 @@ export type GatewayModelId =
215
219
  | 'tencent/hy-mt2-plus'
216
220
  | 'tencent/hy-mt2-pro'
217
221
  | 'tencent/hy3'
222
+ | 'tencent/hy4-preview'
218
223
  | 'thinkingmachines/inkling'
219
224
  | 'thinkingmachines/inkling-small'
220
225
  | 'xiaomi/mimo-v2.5'
@@ -1,6 +1,8 @@
1
1
  export type GatewayTranscriptionModelId =
2
2
  | 'fish-audio/transcribe-1'
3
3
  | 'fish-audio/transcribe-1-free'
4
+ | 'google/gemini-3.5-transcribe'
5
+ | 'google/gemini-3.5-transcribe-live'
4
6
  | 'openai/gpt-4o-mini-transcribe'
5
7
  | 'openai/gpt-4o-transcribe'
6
8
  | 'openai/gpt-realtime-whisper'
@@ -8,6 +8,7 @@ export type GatewayVideoModelId =
8
8
  | 'alibaba/wan-v2.7-r2v'
9
9
  | 'alibaba/wan-v2.7-t2v'
10
10
  | 'alibaba/wan-v3.0-video'
11
+ | 'alibaba/wan-v3.0-video-prime'
11
12
  | 'bfl/flux-3-video'
12
13
  | 'bytedance/seedance-2.0'
13
14
  | 'bytedance/seedance-2.0-fast'
@@ -30,6 +31,7 @@ export type GatewayVideoModelId =
30
31
  | 'klingai/kling-v3.0-motion-control'
31
32
  | 'klingai/kling-v3.0-t2v'
32
33
  | 'minimax/minimax-h3'
34
+ | 'minimax/minimax-h3-max'
33
35
  | 'spacexai/grok-imagine-video'
34
36
  | 'spacexai/grok-imagine-video-1.5'
35
37
  | 'spacexai/grok-imagine-video-1.5-preview'