@ai-sdk/gateway 2.0.0-beta.23 → 2.0.0-beta.25
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 +13 -0
- package/dist/index.d.mts +19 -20
- package/dist/index.d.ts +19 -20
- package/dist/index.js +148 -112
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +127 -79
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @ai-sdk/gateway
|
|
2
2
|
|
|
3
|
+
## 2.0.0-beta.25
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [7e32fea]
|
|
8
|
+
- @ai-sdk/provider-utils@4.0.0-beta.12
|
|
9
|
+
|
|
10
|
+
## 2.0.0-beta.24
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 0e29b8b: chore(provider/gateway): lazy schema loading
|
|
15
|
+
|
|
3
16
|
## 2.0.0-beta.23
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { LanguageModelV3, ProviderV3, EmbeddingModelV3 } from '@ai-sdk/provider';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { ZodError } from 'zod/v4';
|
|
1
|
+
import { LanguageModelV3, ProviderV3, EmbeddingModelV3, TypeValidationError } from '@ai-sdk/provider';
|
|
2
|
+
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
3
|
+
import { FetchFunction, InferValidator } from '@ai-sdk/provider-utils';
|
|
5
4
|
|
|
6
5
|
type GatewayModelId = 'alibaba/qwen-3-14b' | 'alibaba/qwen-3-235b' | 'alibaba/qwen-3-30b' | 'alibaba/qwen-3-32b' | 'alibaba/qwen3-coder' | 'alibaba/qwen3-coder-plus' | 'alibaba/qwen3-max' | 'alibaba/qwen3-max-preview' | 'alibaba/qwen3-next-80b-a3b-instruct' | 'alibaba/qwen3-next-80b-a3b-thinking' | 'alibaba/qwen3-vl-instruct' | 'alibaba/qwen3-vl-thinking' | 'amazon/nova-lite' | 'amazon/nova-micro' | 'amazon/nova-pro' | 'anthropic/claude-3-haiku' | 'anthropic/claude-3-opus' | 'anthropic/claude-3.5-haiku' | 'anthropic/claude-3.5-sonnet' | 'anthropic/claude-3.7-sonnet' | 'anthropic/claude-opus-4' | 'anthropic/claude-opus-4.1' | 'anthropic/claude-sonnet-4' | 'anthropic/claude-sonnet-4.5' | 'cohere/command-a' | 'cohere/command-r' | 'cohere/command-r-plus' | 'deepseek/deepseek-r1' | 'deepseek/deepseek-r1-distill-llama-70b' | 'deepseek/deepseek-v3' | 'deepseek/deepseek-v3.1' | 'deepseek/deepseek-v3.1-base' | 'deepseek/deepseek-v3.1-terminus' | 'deepseek/deepseek-v3.2-exp' | 'deepseek/deepseek-v3.2-exp-thinking' | 'google/gemini-2.0-flash' | 'google/gemini-2.0-flash-lite' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-flash-image-preview' | 'google/gemini-2.5-flash-preview-09-2025' | 'google/gemini-2.5-flash-lite' | 'google/gemini-2.5-flash-lite-preview-09-2025' | 'google/gemini-2.5-pro' | 'google/gemma-2-9b' | 'inception/mercury-coder-small' | 'meituan/longcat-flash-chat' | 'meituan/longcat-flash-thinking' | 'meta/llama-3-70b' | 'meta/llama-3-8b' | 'meta/llama-3.1-70b' | 'meta/llama-3.1-8b' | 'meta/llama-3.2-11b' | 'meta/llama-3.2-1b' | 'meta/llama-3.2-3b' | 'meta/llama-3.2-90b' | 'meta/llama-3.3-70b' | 'meta/llama-4-maverick' | 'meta/llama-4-scout' | 'mistral/codestral' | 'mistral/devstral-small' | 'mistral/magistral-medium' | 'mistral/magistral-small' | 'mistral/ministral-3b' | 'mistral/ministral-8b' | 'mistral/mistral-large' | 'mistral/mistral-medium' | 'mistral/mistral-small' | 'mistral/mixtral-8x22b-instruct' | 'mistral/pixtral-12b' | 'mistral/pixtral-large' | 'moonshotai/kimi-k2' | 'moonshotai/kimi-k2-0905' | 'moonshotai/kimi-k2-turbo' | 'morph/morph-v3-fast' | 'morph/morph-v3-large' | 'openai/gpt-3.5-turbo' | 'openai/gpt-3.5-turbo-instruct' | 'openai/gpt-4-turbo' | 'openai/gpt-4.1' | 'openai/gpt-4.1-mini' | 'openai/gpt-4.1-nano' | 'openai/gpt-4o' | 'openai/gpt-4o-mini' | 'openai/gpt-5' | 'openai/gpt-5-codex' | 'openai/gpt-5-mini' | 'openai/gpt-5-nano' | 'openai/gpt-5-pro' | 'openai/gpt-oss-120b' | 'openai/gpt-oss-20b' | 'openai/o1' | 'openai/o3' | 'openai/o3-mini' | 'openai/o4-mini' | 'perplexity/sonar' | 'perplexity/sonar-pro' | 'perplexity/sonar-reasoning' | 'perplexity/sonar-reasoning-pro' | 'stealth/sonoma-dusk-alpha' | 'stealth/sonoma-sky-alpha' | 'vercel/v0-1.0-md' | 'vercel/v0-1.5-md' | 'xai/grok-2' | 'xai/grok-2-vision' | 'xai/grok-3' | 'xai/grok-3-fast' | 'xai/grok-3-mini' | 'xai/grok-3-mini-fast' | 'xai/grok-4' | 'xai/grok-code-fast-1' | 'xai/grok-4-fast-non-reasoning' | 'xai/grok-4-fast-reasoning' | 'zai/glm-4.5' | 'zai/glm-4.5-air' | 'zai/glm-4.5v' | 'zai/glm-4.6' | (string & {});
|
|
7
6
|
|
|
@@ -113,11 +112,11 @@ Create a remote provider instance.
|
|
|
113
112
|
declare function createGatewayProvider(options?: GatewayProviderSettings): GatewayProvider;
|
|
114
113
|
declare const gateway: GatewayProvider;
|
|
115
114
|
|
|
116
|
-
declare const gatewayProviderOptions:
|
|
117
|
-
only
|
|
118
|
-
order
|
|
119
|
-
}
|
|
120
|
-
type GatewayProviderOptions =
|
|
115
|
+
declare const gatewayProviderOptions: _ai_sdk_provider_utils.LazyValidator<{
|
|
116
|
+
only?: string[] | undefined;
|
|
117
|
+
order?: string[] | undefined;
|
|
118
|
+
}>;
|
|
119
|
+
type GatewayProviderOptions = InferValidator<typeof gatewayProviderOptions>;
|
|
121
120
|
|
|
122
121
|
declare const symbol$6: unique symbol;
|
|
123
122
|
declare abstract class GatewayError extends Error {
|
|
@@ -140,15 +139,15 @@ declare abstract class GatewayError extends Error {
|
|
|
140
139
|
static hasMarker(error: unknown): error is GatewayError;
|
|
141
140
|
}
|
|
142
141
|
|
|
143
|
-
declare const gatewayErrorResponseSchema:
|
|
144
|
-
error:
|
|
145
|
-
message:
|
|
146
|
-
type
|
|
147
|
-
param
|
|
148
|
-
code
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
type GatewayErrorResponse =
|
|
142
|
+
declare const gatewayErrorResponseSchema: _ai_sdk_provider_utils.LazyValidator<{
|
|
143
|
+
error: {
|
|
144
|
+
message: string;
|
|
145
|
+
type?: string | null | undefined;
|
|
146
|
+
param?: unknown;
|
|
147
|
+
code?: string | number | null | undefined;
|
|
148
|
+
};
|
|
149
|
+
}>;
|
|
150
|
+
type GatewayErrorResponse = InferValidator<typeof gatewayErrorResponseSchema>;
|
|
152
151
|
|
|
153
152
|
declare const symbol$5: unique symbol;
|
|
154
153
|
/**
|
|
@@ -251,12 +250,12 @@ declare class GatewayResponseError extends GatewayError {
|
|
|
251
250
|
readonly name = "GatewayResponseError";
|
|
252
251
|
readonly type = "response_error";
|
|
253
252
|
readonly response?: unknown;
|
|
254
|
-
readonly validationError?:
|
|
253
|
+
readonly validationError?: TypeValidationError;
|
|
255
254
|
constructor({ message, statusCode, response, validationError, cause, }?: {
|
|
256
255
|
message?: string;
|
|
257
256
|
statusCode?: number;
|
|
258
257
|
response?: unknown;
|
|
259
|
-
validationError?:
|
|
258
|
+
validationError?: TypeValidationError;
|
|
260
259
|
cause?: unknown;
|
|
261
260
|
});
|
|
262
261
|
static isInstance(error: unknown): error is GatewayResponseError;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { LanguageModelV3, ProviderV3, EmbeddingModelV3 } from '@ai-sdk/provider';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { ZodError } from 'zod/v4';
|
|
1
|
+
import { LanguageModelV3, ProviderV3, EmbeddingModelV3, TypeValidationError } from '@ai-sdk/provider';
|
|
2
|
+
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
3
|
+
import { FetchFunction, InferValidator } from '@ai-sdk/provider-utils';
|
|
5
4
|
|
|
6
5
|
type GatewayModelId = 'alibaba/qwen-3-14b' | 'alibaba/qwen-3-235b' | 'alibaba/qwen-3-30b' | 'alibaba/qwen-3-32b' | 'alibaba/qwen3-coder' | 'alibaba/qwen3-coder-plus' | 'alibaba/qwen3-max' | 'alibaba/qwen3-max-preview' | 'alibaba/qwen3-next-80b-a3b-instruct' | 'alibaba/qwen3-next-80b-a3b-thinking' | 'alibaba/qwen3-vl-instruct' | 'alibaba/qwen3-vl-thinking' | 'amazon/nova-lite' | 'amazon/nova-micro' | 'amazon/nova-pro' | 'anthropic/claude-3-haiku' | 'anthropic/claude-3-opus' | 'anthropic/claude-3.5-haiku' | 'anthropic/claude-3.5-sonnet' | 'anthropic/claude-3.7-sonnet' | 'anthropic/claude-opus-4' | 'anthropic/claude-opus-4.1' | 'anthropic/claude-sonnet-4' | 'anthropic/claude-sonnet-4.5' | 'cohere/command-a' | 'cohere/command-r' | 'cohere/command-r-plus' | 'deepseek/deepseek-r1' | 'deepseek/deepseek-r1-distill-llama-70b' | 'deepseek/deepseek-v3' | 'deepseek/deepseek-v3.1' | 'deepseek/deepseek-v3.1-base' | 'deepseek/deepseek-v3.1-terminus' | 'deepseek/deepseek-v3.2-exp' | 'deepseek/deepseek-v3.2-exp-thinking' | 'google/gemini-2.0-flash' | 'google/gemini-2.0-flash-lite' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-flash-image-preview' | 'google/gemini-2.5-flash-preview-09-2025' | 'google/gemini-2.5-flash-lite' | 'google/gemini-2.5-flash-lite-preview-09-2025' | 'google/gemini-2.5-pro' | 'google/gemma-2-9b' | 'inception/mercury-coder-small' | 'meituan/longcat-flash-chat' | 'meituan/longcat-flash-thinking' | 'meta/llama-3-70b' | 'meta/llama-3-8b' | 'meta/llama-3.1-70b' | 'meta/llama-3.1-8b' | 'meta/llama-3.2-11b' | 'meta/llama-3.2-1b' | 'meta/llama-3.2-3b' | 'meta/llama-3.2-90b' | 'meta/llama-3.3-70b' | 'meta/llama-4-maverick' | 'meta/llama-4-scout' | 'mistral/codestral' | 'mistral/devstral-small' | 'mistral/magistral-medium' | 'mistral/magistral-small' | 'mistral/ministral-3b' | 'mistral/ministral-8b' | 'mistral/mistral-large' | 'mistral/mistral-medium' | 'mistral/mistral-small' | 'mistral/mixtral-8x22b-instruct' | 'mistral/pixtral-12b' | 'mistral/pixtral-large' | 'moonshotai/kimi-k2' | 'moonshotai/kimi-k2-0905' | 'moonshotai/kimi-k2-turbo' | 'morph/morph-v3-fast' | 'morph/morph-v3-large' | 'openai/gpt-3.5-turbo' | 'openai/gpt-3.5-turbo-instruct' | 'openai/gpt-4-turbo' | 'openai/gpt-4.1' | 'openai/gpt-4.1-mini' | 'openai/gpt-4.1-nano' | 'openai/gpt-4o' | 'openai/gpt-4o-mini' | 'openai/gpt-5' | 'openai/gpt-5-codex' | 'openai/gpt-5-mini' | 'openai/gpt-5-nano' | 'openai/gpt-5-pro' | 'openai/gpt-oss-120b' | 'openai/gpt-oss-20b' | 'openai/o1' | 'openai/o3' | 'openai/o3-mini' | 'openai/o4-mini' | 'perplexity/sonar' | 'perplexity/sonar-pro' | 'perplexity/sonar-reasoning' | 'perplexity/sonar-reasoning-pro' | 'stealth/sonoma-dusk-alpha' | 'stealth/sonoma-sky-alpha' | 'vercel/v0-1.0-md' | 'vercel/v0-1.5-md' | 'xai/grok-2' | 'xai/grok-2-vision' | 'xai/grok-3' | 'xai/grok-3-fast' | 'xai/grok-3-mini' | 'xai/grok-3-mini-fast' | 'xai/grok-4' | 'xai/grok-code-fast-1' | 'xai/grok-4-fast-non-reasoning' | 'xai/grok-4-fast-reasoning' | 'zai/glm-4.5' | 'zai/glm-4.5-air' | 'zai/glm-4.5v' | 'zai/glm-4.6' | (string & {});
|
|
7
6
|
|
|
@@ -113,11 +112,11 @@ Create a remote provider instance.
|
|
|
113
112
|
declare function createGatewayProvider(options?: GatewayProviderSettings): GatewayProvider;
|
|
114
113
|
declare const gateway: GatewayProvider;
|
|
115
114
|
|
|
116
|
-
declare const gatewayProviderOptions:
|
|
117
|
-
only
|
|
118
|
-
order
|
|
119
|
-
}
|
|
120
|
-
type GatewayProviderOptions =
|
|
115
|
+
declare const gatewayProviderOptions: _ai_sdk_provider_utils.LazyValidator<{
|
|
116
|
+
only?: string[] | undefined;
|
|
117
|
+
order?: string[] | undefined;
|
|
118
|
+
}>;
|
|
119
|
+
type GatewayProviderOptions = InferValidator<typeof gatewayProviderOptions>;
|
|
121
120
|
|
|
122
121
|
declare const symbol$6: unique symbol;
|
|
123
122
|
declare abstract class GatewayError extends Error {
|
|
@@ -140,15 +139,15 @@ declare abstract class GatewayError extends Error {
|
|
|
140
139
|
static hasMarker(error: unknown): error is GatewayError;
|
|
141
140
|
}
|
|
142
141
|
|
|
143
|
-
declare const gatewayErrorResponseSchema:
|
|
144
|
-
error:
|
|
145
|
-
message:
|
|
146
|
-
type
|
|
147
|
-
param
|
|
148
|
-
code
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
type GatewayErrorResponse =
|
|
142
|
+
declare const gatewayErrorResponseSchema: _ai_sdk_provider_utils.LazyValidator<{
|
|
143
|
+
error: {
|
|
144
|
+
message: string;
|
|
145
|
+
type?: string | null | undefined;
|
|
146
|
+
param?: unknown;
|
|
147
|
+
code?: string | number | null | undefined;
|
|
148
|
+
};
|
|
149
|
+
}>;
|
|
150
|
+
type GatewayErrorResponse = InferValidator<typeof gatewayErrorResponseSchema>;
|
|
152
151
|
|
|
153
152
|
declare const symbol$5: unique symbol;
|
|
154
153
|
/**
|
|
@@ -251,12 +250,12 @@ declare class GatewayResponseError extends GatewayError {
|
|
|
251
250
|
readonly name = "GatewayResponseError";
|
|
252
251
|
readonly type = "response_error";
|
|
253
252
|
readonly response?: unknown;
|
|
254
|
-
readonly validationError?:
|
|
253
|
+
readonly validationError?: TypeValidationError;
|
|
255
254
|
constructor({ message, statusCode, response, validationError, cause, }?: {
|
|
256
255
|
message?: string;
|
|
257
256
|
statusCode?: number;
|
|
258
257
|
response?: unknown;
|
|
259
|
-
validationError?:
|
|
258
|
+
validationError?: TypeValidationError;
|
|
260
259
|
cause?: unknown;
|
|
261
260
|
});
|
|
262
261
|
static isInstance(error: unknown): error is GatewayResponseError;
|