@ai-sdk/gateway 3.0.125 → 3.0.127

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.125",
4
+ "version": "3.0.127",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
7
7
  "main": "./dist/index.js",
@@ -8,6 +8,7 @@ import {
8
8
  modelNotFoundParamSchema,
9
9
  } from './gateway-model-not-found-error';
10
10
  import { GatewayInternalServerError } from './gateway-internal-server-error';
11
+ import { GatewayFailedDependencyError } from './gateway-failed-dependency-error';
11
12
  import { GatewayResponseError } from './gateway-response-error';
12
13
  import {
13
14
  lazySchema,
@@ -103,6 +104,13 @@ export async function createGatewayErrorFromResponse({
103
104
  cause,
104
105
  generationId,
105
106
  });
107
+ case 'failed_dependency':
108
+ return new GatewayFailedDependencyError({
109
+ message,
110
+ statusCode,
111
+ cause,
112
+ generationId,
113
+ });
106
114
  default:
107
115
  return new GatewayInternalServerError({
108
116
  message,
@@ -0,0 +1,35 @@
1
+ import { GatewayError } from './gateway-error';
2
+
3
+ const name = 'GatewayFailedDependencyError';
4
+ const marker = `vercel.ai.gateway.error.${name}`;
5
+ const symbol = Symbol.for(marker);
6
+
7
+ /**
8
+ * The request could not be fulfilled because a dependency it relied on was not
9
+ * available on the credentials or provider used to serve it (HTTP 424). Not
10
+ * retryable — the caller must change the request.
11
+ */
12
+ export class GatewayFailedDependencyError extends GatewayError {
13
+ private readonly [symbol] = true; // used in isInstance
14
+
15
+ readonly name = name;
16
+ readonly type = 'failed_dependency';
17
+
18
+ constructor({
19
+ message = 'Failed dependency',
20
+ statusCode = 424,
21
+ cause,
22
+ generationId,
23
+ }: {
24
+ message?: string;
25
+ statusCode?: number;
26
+ cause?: unknown;
27
+ generationId?: string;
28
+ } = {}) {
29
+ super({ message, statusCode, cause, generationId });
30
+ }
31
+
32
+ static isInstance(error: unknown): error is GatewayFailedDependencyError {
33
+ return GatewayError.hasMarker(error) && symbol in error;
34
+ }
35
+ }
@@ -6,6 +6,7 @@ export {
6
6
  export { extractApiCallResponse } from './extract-api-call-response';
7
7
  export { GatewayError } from './gateway-error';
8
8
  export { GatewayAuthenticationError } from './gateway-authentication-error';
9
+ export { GatewayFailedDependencyError } from './gateway-failed-dependency-error';
9
10
  export { GatewayInternalServerError } from './gateway-internal-server-error';
10
11
  export { GatewayInvalidRequestError } from './gateway-invalid-request-error';
11
12
  export {
@@ -29,6 +29,7 @@ export type GatewayModelId =
29
29
  | 'amazon/nova-pro'
30
30
  | 'anthropic/claude-3-haiku'
31
31
  | 'anthropic/claude-3.5-haiku'
32
+ | 'anthropic/claude-fable-5'
32
33
  | 'anthropic/claude-haiku-4.5'
33
34
  | 'anthropic/claude-opus-4'
34
35
  | 'anthropic/claude-opus-4.1'
@@ -53,8 +54,6 @@ export type GatewayModelId =
53
54
  | 'deepseek/deepseek-v3.2-thinking'
54
55
  | 'deepseek/deepseek-v4-flash'
55
56
  | 'deepseek/deepseek-v4-pro'
56
- | 'google/gemini-2.0-flash'
57
- | 'google/gemini-2.0-flash-lite'
58
57
  | 'google/gemini-2.5-flash'
59
58
  | 'google/gemini-2.5-flash-image'
60
59
  | 'google/gemini-2.5-flash-lite'
package/src/index.ts CHANGED
@@ -33,6 +33,7 @@ export type {
33
33
  export {
34
34
  GatewayError,
35
35
  GatewayAuthenticationError,
36
+ GatewayFailedDependencyError,
36
37
  GatewayInvalidRequestError,
37
38
  GatewayRateLimitError,
38
39
  GatewayModelNotFoundError,