@ai-sdk/gateway 2.0.0-beta.22 → 2.0.0-beta.24
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 +12 -0
- package/dist/index.d.mts +19 -19
- package/dist/index.d.ts +19 -19
- 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 +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ai-sdk/gateway
|
|
2
2
|
|
|
3
|
+
## 2.0.0-beta.24
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0e29b8b: chore(provider/gateway): lazy schema loading
|
|
8
|
+
|
|
9
|
+
## 2.0.0-beta.23
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- acc14d8: feat (provider/gateway): add 'only' to provider options
|
|
14
|
+
|
|
3
15
|
## 2.0.0-beta.22
|
|
4
16
|
|
|
5
17
|
### 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,10 +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
|
-
|
|
118
|
-
|
|
119
|
-
|
|
115
|
+
declare const gatewayProviderOptions: _ai_sdk_provider_utils.LazyValidator<{
|
|
116
|
+
only?: string[] | undefined;
|
|
117
|
+
order?: string[] | undefined;
|
|
118
|
+
}>;
|
|
119
|
+
type GatewayProviderOptions = InferValidator<typeof gatewayProviderOptions>;
|
|
120
120
|
|
|
121
121
|
declare const symbol$6: unique symbol;
|
|
122
122
|
declare abstract class GatewayError extends Error {
|
|
@@ -139,15 +139,15 @@ declare abstract class GatewayError extends Error {
|
|
|
139
139
|
static hasMarker(error: unknown): error is GatewayError;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
declare const gatewayErrorResponseSchema:
|
|
143
|
-
error:
|
|
144
|
-
message:
|
|
145
|
-
type
|
|
146
|
-
param
|
|
147
|
-
code
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
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>;
|
|
151
151
|
|
|
152
152
|
declare const symbol$5: unique symbol;
|
|
153
153
|
/**
|
|
@@ -250,12 +250,12 @@ declare class GatewayResponseError extends GatewayError {
|
|
|
250
250
|
readonly name = "GatewayResponseError";
|
|
251
251
|
readonly type = "response_error";
|
|
252
252
|
readonly response?: unknown;
|
|
253
|
-
readonly validationError?:
|
|
253
|
+
readonly validationError?: TypeValidationError;
|
|
254
254
|
constructor({ message, statusCode, response, validationError, cause, }?: {
|
|
255
255
|
message?: string;
|
|
256
256
|
statusCode?: number;
|
|
257
257
|
response?: unknown;
|
|
258
|
-
validationError?:
|
|
258
|
+
validationError?: TypeValidationError;
|
|
259
259
|
cause?: unknown;
|
|
260
260
|
});
|
|
261
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,10 +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
|
-
|
|
118
|
-
|
|
119
|
-
|
|
115
|
+
declare const gatewayProviderOptions: _ai_sdk_provider_utils.LazyValidator<{
|
|
116
|
+
only?: string[] | undefined;
|
|
117
|
+
order?: string[] | undefined;
|
|
118
|
+
}>;
|
|
119
|
+
type GatewayProviderOptions = InferValidator<typeof gatewayProviderOptions>;
|
|
120
120
|
|
|
121
121
|
declare const symbol$6: unique symbol;
|
|
122
122
|
declare abstract class GatewayError extends Error {
|
|
@@ -139,15 +139,15 @@ declare abstract class GatewayError extends Error {
|
|
|
139
139
|
static hasMarker(error: unknown): error is GatewayError;
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
-
declare const gatewayErrorResponseSchema:
|
|
143
|
-
error:
|
|
144
|
-
message:
|
|
145
|
-
type
|
|
146
|
-
param
|
|
147
|
-
code
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
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>;
|
|
151
151
|
|
|
152
152
|
declare const symbol$5: unique symbol;
|
|
153
153
|
/**
|
|
@@ -250,12 +250,12 @@ declare class GatewayResponseError extends GatewayError {
|
|
|
250
250
|
readonly name = "GatewayResponseError";
|
|
251
251
|
readonly type = "response_error";
|
|
252
252
|
readonly response?: unknown;
|
|
253
|
-
readonly validationError?:
|
|
253
|
+
readonly validationError?: TypeValidationError;
|
|
254
254
|
constructor({ message, statusCode, response, validationError, cause, }?: {
|
|
255
255
|
message?: string;
|
|
256
256
|
statusCode?: number;
|
|
257
257
|
response?: unknown;
|
|
258
|
-
validationError?:
|
|
258
|
+
validationError?: TypeValidationError;
|
|
259
259
|
cause?: unknown;
|
|
260
260
|
});
|
|
261
261
|
static isInstance(error: unknown): error is GatewayResponseError;
|