@ai-sdk/gateway 0.0.0-02dba89b-20251009204516 → 0.0.0-4115c213-20260122152721
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 +886 -167
- package/dist/index.d.mts +205 -34
- package/dist/index.d.ts +205 -34
- package/dist/index.js +459 -180
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +450 -148
- package/dist/index.mjs.map +1 -1
- package/docs/00-ai-gateway.mdx +625 -0
- package/package.json +19 -6
- package/src/errors/as-gateway-error.ts +33 -0
- package/src/errors/create-gateway-error.ts +132 -0
- package/src/errors/extract-api-call-response.ts +15 -0
- package/src/errors/gateway-authentication-error.ts +84 -0
- package/src/errors/gateway-error.ts +47 -0
- package/src/errors/gateway-internal-server-error.ts +33 -0
- package/src/errors/gateway-invalid-request-error.ts +33 -0
- package/src/errors/gateway-model-not-found-error.ts +47 -0
- package/src/errors/gateway-rate-limit-error.ts +33 -0
- package/src/errors/gateway-response-error.ts +42 -0
- package/src/errors/index.ts +16 -0
- package/src/errors/parse-auth-method.ts +23 -0
- package/src/gateway-config.ts +7 -0
- package/src/gateway-embedding-model-settings.ts +22 -0
- package/src/gateway-embedding-model.ts +109 -0
- package/src/gateway-fetch-metadata.ts +127 -0
- package/src/gateway-image-model-settings.ts +12 -0
- package/src/gateway-image-model.ts +145 -0
- package/src/gateway-language-model-settings.ts +159 -0
- package/src/gateway-language-model.ts +212 -0
- package/src/gateway-model-entry.ts +58 -0
- package/src/gateway-provider-options.ts +66 -0
- package/src/gateway-provider.ts +284 -0
- package/src/gateway-tools.ts +15 -0
- package/src/index.ts +27 -0
- package/src/tool/perplexity-search.ts +294 -0
- package/src/vercel-environment.ts +6 -0
- package/src/version.ts +6 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { LanguageModelV3 } from '@ai-sdk/provider';
|
|
2
|
+
|
|
3
|
+
export interface GatewayLanguageModelEntry {
|
|
4
|
+
/**
|
|
5
|
+
* The model id used by the remote provider in model settings and for specifying the
|
|
6
|
+
* intended model for text generation.
|
|
7
|
+
*/
|
|
8
|
+
id: string;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The display name of the model for presentation in user-facing contexts.
|
|
12
|
+
*/
|
|
13
|
+
name: string;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Optional description of the model.
|
|
17
|
+
*/
|
|
18
|
+
description?: string | null;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Optional pricing information for the model.
|
|
22
|
+
*/
|
|
23
|
+
pricing?: {
|
|
24
|
+
/**
|
|
25
|
+
* Cost per input token in USD.
|
|
26
|
+
*/
|
|
27
|
+
input: string;
|
|
28
|
+
/**
|
|
29
|
+
* Cost per output token in USD.
|
|
30
|
+
*/
|
|
31
|
+
output: string;
|
|
32
|
+
/**
|
|
33
|
+
* Cost per cached input token in USD.
|
|
34
|
+
* Only present for providers/models that support prompt caching.
|
|
35
|
+
*/
|
|
36
|
+
cachedInputTokens?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Cost per input token to create/write cache entries in USD.
|
|
39
|
+
* Only present for providers/models that support prompt caching.
|
|
40
|
+
*/
|
|
41
|
+
cacheCreationInputTokens?: string;
|
|
42
|
+
} | null;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Additional AI SDK language model specifications for the model.
|
|
46
|
+
*/
|
|
47
|
+
specification: GatewayLanguageModelSpecification;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Optional field to differentiate between model types.
|
|
51
|
+
*/
|
|
52
|
+
modelType?: 'language' | 'embedding' | 'image' | null;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export type GatewayLanguageModelSpecification = Pick<
|
|
56
|
+
LanguageModelV3,
|
|
57
|
+
'specificationVersion' | 'provider' | 'modelId'
|
|
58
|
+
>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { InferSchema, lazySchema, zodSchema } from '@ai-sdk/provider-utils';
|
|
2
|
+
import { z } from 'zod/v4';
|
|
3
|
+
|
|
4
|
+
// https://vercel.com/docs/ai-gateway/provider-options
|
|
5
|
+
const gatewayProviderOptions = lazySchema(() =>
|
|
6
|
+
zodSchema(
|
|
7
|
+
z.object({
|
|
8
|
+
/**
|
|
9
|
+
* Array of provider slugs that are the only ones allowed to be used.
|
|
10
|
+
*
|
|
11
|
+
* Example: `['azure', 'openai']` will only allow Azure and OpenAI to be used.
|
|
12
|
+
*/
|
|
13
|
+
only: z.array(z.string()).optional(),
|
|
14
|
+
/**
|
|
15
|
+
* Array of provider slugs that specifies the sequence in which providers should be attempted.
|
|
16
|
+
*
|
|
17
|
+
* Example: `['bedrock', 'anthropic']` will try Amazon Bedrock first, then Anthropic as fallback.
|
|
18
|
+
*/
|
|
19
|
+
order: z.array(z.string()).optional(),
|
|
20
|
+
/**
|
|
21
|
+
* The unique identifier for the end user on behalf of whom the request was made.
|
|
22
|
+
*
|
|
23
|
+
* Used for spend tracking and attribution purposes.
|
|
24
|
+
*/
|
|
25
|
+
user: z.string().optional(),
|
|
26
|
+
/**
|
|
27
|
+
* User-specified tags for use in reporting and filtering usage.
|
|
28
|
+
*
|
|
29
|
+
* For example, spend tracking reporting by feature or prompt version.
|
|
30
|
+
*
|
|
31
|
+
* Example: `['chat', 'v2']`
|
|
32
|
+
*/
|
|
33
|
+
tags: z.array(z.string()).optional(),
|
|
34
|
+
/**
|
|
35
|
+
* Array of model slugs specifying fallback models to use in order.
|
|
36
|
+
*
|
|
37
|
+
* Example: `['openai/gpt-5-nano', 'zai/glm-4.6']` will try `openai/gpt-5-nano` first, then `zai/glm-4.6` as fallback.
|
|
38
|
+
*/
|
|
39
|
+
models: z.array(z.string()).optional(),
|
|
40
|
+
/**
|
|
41
|
+
* Request-scoped BYOK credentials to use instead of cached credentials.
|
|
42
|
+
*
|
|
43
|
+
* When provided, cached BYOK credentials are ignored entirely.
|
|
44
|
+
*
|
|
45
|
+
* Each provider can have multiple credentials (tried in order).
|
|
46
|
+
*
|
|
47
|
+
* Examples:
|
|
48
|
+
* - Simple: `{ 'anthropic': [{ apiKey: 'sk-ant-...' }] }`
|
|
49
|
+
* - Multiple: `{ 'vertex': [{ projectId: 'proj-1', privateKey: '...' }, { projectId: 'proj-2', privateKey: '...' }] }`
|
|
50
|
+
* - Multi-provider: `{ 'anthropic': [{ apiKey: '...' }], 'bedrock': [{ accessKeyId: '...', secretAccessKey: '...' }] }`
|
|
51
|
+
*/
|
|
52
|
+
byok: z
|
|
53
|
+
.record(z.string(), z.array(z.record(z.string(), z.unknown())))
|
|
54
|
+
.optional(),
|
|
55
|
+
/**
|
|
56
|
+
* Whether to filter by only providers that state they have zero data
|
|
57
|
+
* retention with Vercel AI Gateway. When enabled, only providers that
|
|
58
|
+
* have agreements with Vercel AI Gateway for zero data retention will be
|
|
59
|
+
* used.
|
|
60
|
+
*/
|
|
61
|
+
zeroDataRetention: z.boolean().optional(),
|
|
62
|
+
}),
|
|
63
|
+
),
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
export type GatewayProviderOptions = InferSchema<typeof gatewayProviderOptions>;
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import {
|
|
2
|
+
loadOptionalSetting,
|
|
3
|
+
withoutTrailingSlash,
|
|
4
|
+
type FetchFunction,
|
|
5
|
+
} from '@ai-sdk/provider-utils';
|
|
6
|
+
import { asGatewayError, GatewayAuthenticationError } from './errors';
|
|
7
|
+
import {
|
|
8
|
+
GATEWAY_AUTH_METHOD_HEADER,
|
|
9
|
+
parseAuthMethod,
|
|
10
|
+
} from './errors/parse-auth-method';
|
|
11
|
+
import {
|
|
12
|
+
GatewayFetchMetadata,
|
|
13
|
+
type GatewayFetchMetadataResponse,
|
|
14
|
+
type GatewayCreditsResponse,
|
|
15
|
+
} from './gateway-fetch-metadata';
|
|
16
|
+
import { GatewayLanguageModel } from './gateway-language-model';
|
|
17
|
+
import { GatewayEmbeddingModel } from './gateway-embedding-model';
|
|
18
|
+
import { GatewayImageModel } from './gateway-image-model';
|
|
19
|
+
import type { GatewayEmbeddingModelId } from './gateway-embedding-model-settings';
|
|
20
|
+
import type { GatewayImageModelId } from './gateway-image-model-settings';
|
|
21
|
+
import { gatewayTools } from './gateway-tools';
|
|
22
|
+
import { getVercelOidcToken, getVercelRequestId } from './vercel-environment';
|
|
23
|
+
import type { GatewayModelId } from './gateway-language-model-settings';
|
|
24
|
+
import type {
|
|
25
|
+
LanguageModelV3,
|
|
26
|
+
EmbeddingModelV3,
|
|
27
|
+
ImageModelV3,
|
|
28
|
+
ProviderV3,
|
|
29
|
+
} from '@ai-sdk/provider';
|
|
30
|
+
import { withUserAgentSuffix } from '@ai-sdk/provider-utils';
|
|
31
|
+
import { VERSION } from './version';
|
|
32
|
+
|
|
33
|
+
export interface GatewayProvider extends ProviderV3 {
|
|
34
|
+
(modelId: GatewayModelId): LanguageModelV3;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
Creates a model for text generation.
|
|
38
|
+
*/
|
|
39
|
+
languageModel(modelId: GatewayModelId): LanguageModelV3;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
Returns available providers and models for use with the remote provider.
|
|
43
|
+
*/
|
|
44
|
+
getAvailableModels(): Promise<GatewayFetchMetadataResponse>;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
Returns credit information for the authenticated user.
|
|
48
|
+
*/
|
|
49
|
+
getCredits(): Promise<GatewayCreditsResponse>;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
Creates a model for generating text embeddings.
|
|
53
|
+
*/
|
|
54
|
+
embeddingModel(modelId: GatewayEmbeddingModelId): EmbeddingModelV3;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated Use `embeddingModel` instead.
|
|
58
|
+
*/
|
|
59
|
+
textEmbeddingModel(modelId: GatewayEmbeddingModelId): EmbeddingModelV3;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
Creates a model for generating images.
|
|
63
|
+
*/
|
|
64
|
+
imageModel(modelId: GatewayImageModelId): ImageModelV3;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
Gateway-specific tools executed server-side.
|
|
68
|
+
*/
|
|
69
|
+
tools: typeof gatewayTools;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface GatewayProviderSettings {
|
|
73
|
+
/**
|
|
74
|
+
The base URL prefix for API calls. Defaults to `https://ai-gateway.vercel.sh/v1/ai`.
|
|
75
|
+
*/
|
|
76
|
+
baseURL?: string;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
API key that is being sent using the `Authorization` header.
|
|
80
|
+
*/
|
|
81
|
+
apiKey?: string;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
Custom headers to include in the requests.
|
|
85
|
+
*/
|
|
86
|
+
headers?: Record<string, string>;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
Custom fetch implementation. You can use it as a middleware to intercept requests,
|
|
90
|
+
or to provide a custom fetch implementation for e.g. testing.
|
|
91
|
+
*/
|
|
92
|
+
fetch?: FetchFunction;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
How frequently to refresh the metadata cache in milliseconds.
|
|
96
|
+
*/
|
|
97
|
+
metadataCacheRefreshMillis?: number;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* @internal For testing purposes only
|
|
101
|
+
*/
|
|
102
|
+
_internal?: {
|
|
103
|
+
currentDate?: () => Date;
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const AI_GATEWAY_PROTOCOL_VERSION = '0.0.1';
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
Create a remote provider instance.
|
|
111
|
+
*/
|
|
112
|
+
export function createGatewayProvider(
|
|
113
|
+
options: GatewayProviderSettings = {},
|
|
114
|
+
): GatewayProvider {
|
|
115
|
+
let pendingMetadata: Promise<GatewayFetchMetadataResponse> | null = null;
|
|
116
|
+
let metadataCache: GatewayFetchMetadataResponse | null = null;
|
|
117
|
+
const cacheRefreshMillis =
|
|
118
|
+
options.metadataCacheRefreshMillis ?? 1000 * 60 * 5;
|
|
119
|
+
let lastFetchTime = 0;
|
|
120
|
+
|
|
121
|
+
const baseURL =
|
|
122
|
+
withoutTrailingSlash(options.baseURL) ??
|
|
123
|
+
'https://ai-gateway.vercel.sh/v3/ai';
|
|
124
|
+
|
|
125
|
+
const getHeaders = async () => {
|
|
126
|
+
try {
|
|
127
|
+
const auth = await getGatewayAuthToken(options);
|
|
128
|
+
return withUserAgentSuffix(
|
|
129
|
+
{
|
|
130
|
+
Authorization: `Bearer ${auth.token}`,
|
|
131
|
+
'ai-gateway-protocol-version': AI_GATEWAY_PROTOCOL_VERSION,
|
|
132
|
+
[GATEWAY_AUTH_METHOD_HEADER]: auth.authMethod,
|
|
133
|
+
...options.headers,
|
|
134
|
+
},
|
|
135
|
+
`ai-sdk/gateway/${VERSION}`,
|
|
136
|
+
);
|
|
137
|
+
} catch (error) {
|
|
138
|
+
throw GatewayAuthenticationError.createContextualError({
|
|
139
|
+
apiKeyProvided: false,
|
|
140
|
+
oidcTokenProvided: false,
|
|
141
|
+
statusCode: 401,
|
|
142
|
+
cause: error,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const createO11yHeaders = () => {
|
|
148
|
+
const deploymentId = loadOptionalSetting({
|
|
149
|
+
settingValue: undefined,
|
|
150
|
+
environmentVariableName: 'VERCEL_DEPLOYMENT_ID',
|
|
151
|
+
});
|
|
152
|
+
const environment = loadOptionalSetting({
|
|
153
|
+
settingValue: undefined,
|
|
154
|
+
environmentVariableName: 'VERCEL_ENV',
|
|
155
|
+
});
|
|
156
|
+
const region = loadOptionalSetting({
|
|
157
|
+
settingValue: undefined,
|
|
158
|
+
environmentVariableName: 'VERCEL_REGION',
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
return async () => {
|
|
162
|
+
const requestId = await getVercelRequestId();
|
|
163
|
+
return {
|
|
164
|
+
...(deploymentId && { 'ai-o11y-deployment-id': deploymentId }),
|
|
165
|
+
...(environment && { 'ai-o11y-environment': environment }),
|
|
166
|
+
...(region && { 'ai-o11y-region': region }),
|
|
167
|
+
...(requestId && { 'ai-o11y-request-id': requestId }),
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
const createLanguageModel = (modelId: GatewayModelId) => {
|
|
173
|
+
return new GatewayLanguageModel(modelId, {
|
|
174
|
+
provider: 'gateway',
|
|
175
|
+
baseURL,
|
|
176
|
+
headers: getHeaders,
|
|
177
|
+
fetch: options.fetch,
|
|
178
|
+
o11yHeaders: createO11yHeaders(),
|
|
179
|
+
});
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
const getAvailableModels = async () => {
|
|
183
|
+
const now = options._internal?.currentDate?.().getTime() ?? Date.now();
|
|
184
|
+
if (!pendingMetadata || now - lastFetchTime > cacheRefreshMillis) {
|
|
185
|
+
lastFetchTime = now;
|
|
186
|
+
|
|
187
|
+
pendingMetadata = new GatewayFetchMetadata({
|
|
188
|
+
baseURL,
|
|
189
|
+
headers: getHeaders,
|
|
190
|
+
fetch: options.fetch,
|
|
191
|
+
})
|
|
192
|
+
.getAvailableModels()
|
|
193
|
+
.then(metadata => {
|
|
194
|
+
metadataCache = metadata;
|
|
195
|
+
return metadata;
|
|
196
|
+
})
|
|
197
|
+
.catch(async (error: unknown) => {
|
|
198
|
+
throw await asGatewayError(
|
|
199
|
+
error,
|
|
200
|
+
await parseAuthMethod(await getHeaders()),
|
|
201
|
+
);
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return metadataCache ? Promise.resolve(metadataCache) : pendingMetadata;
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
const getCredits = async () => {
|
|
209
|
+
return new GatewayFetchMetadata({
|
|
210
|
+
baseURL,
|
|
211
|
+
headers: getHeaders,
|
|
212
|
+
fetch: options.fetch,
|
|
213
|
+
})
|
|
214
|
+
.getCredits()
|
|
215
|
+
.catch(async (error: unknown) => {
|
|
216
|
+
throw await asGatewayError(
|
|
217
|
+
error,
|
|
218
|
+
await parseAuthMethod(await getHeaders()),
|
|
219
|
+
);
|
|
220
|
+
});
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
const provider = function (modelId: GatewayModelId) {
|
|
224
|
+
if (new.target) {
|
|
225
|
+
throw new Error(
|
|
226
|
+
'The Gateway Provider model function cannot be called with the new keyword.',
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
return createLanguageModel(modelId);
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
provider.specificationVersion = 'v3' as const;
|
|
234
|
+
provider.getAvailableModels = getAvailableModels;
|
|
235
|
+
provider.getCredits = getCredits;
|
|
236
|
+
provider.imageModel = (modelId: GatewayImageModelId) => {
|
|
237
|
+
return new GatewayImageModel(modelId, {
|
|
238
|
+
provider: 'gateway',
|
|
239
|
+
baseURL,
|
|
240
|
+
headers: getHeaders,
|
|
241
|
+
fetch: options.fetch,
|
|
242
|
+
o11yHeaders: createO11yHeaders(),
|
|
243
|
+
});
|
|
244
|
+
};
|
|
245
|
+
provider.languageModel = createLanguageModel;
|
|
246
|
+
const createEmbeddingModel = (modelId: GatewayEmbeddingModelId) => {
|
|
247
|
+
return new GatewayEmbeddingModel(modelId, {
|
|
248
|
+
provider: 'gateway',
|
|
249
|
+
baseURL,
|
|
250
|
+
headers: getHeaders,
|
|
251
|
+
fetch: options.fetch,
|
|
252
|
+
o11yHeaders: createO11yHeaders(),
|
|
253
|
+
});
|
|
254
|
+
};
|
|
255
|
+
provider.embeddingModel = createEmbeddingModel;
|
|
256
|
+
provider.textEmbeddingModel = createEmbeddingModel;
|
|
257
|
+
provider.tools = gatewayTools;
|
|
258
|
+
|
|
259
|
+
return provider;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
export const gateway = createGatewayProvider();
|
|
263
|
+
|
|
264
|
+
export async function getGatewayAuthToken(
|
|
265
|
+
options: GatewayProviderSettings,
|
|
266
|
+
): Promise<{ token: string; authMethod: 'api-key' | 'oidc' }> {
|
|
267
|
+
const apiKey = loadOptionalSetting({
|
|
268
|
+
settingValue: options.apiKey,
|
|
269
|
+
environmentVariableName: 'AI_GATEWAY_API_KEY',
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
if (apiKey) {
|
|
273
|
+
return {
|
|
274
|
+
token: apiKey,
|
|
275
|
+
authMethod: 'api-key',
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
const oidcToken = await getVercelOidcToken();
|
|
280
|
+
return {
|
|
281
|
+
token: oidcToken,
|
|
282
|
+
authMethod: 'oidc',
|
|
283
|
+
};
|
|
284
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { perplexitySearch } from './tool/perplexity-search';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Gateway-specific provider-defined tools.
|
|
5
|
+
*/
|
|
6
|
+
export const gatewayTools = {
|
|
7
|
+
/**
|
|
8
|
+
* Search the web using Perplexity's Search API for real-time information,
|
|
9
|
+
* news, research papers, and articles.
|
|
10
|
+
*
|
|
11
|
+
* Provides ranked search results with advanced filtering options including
|
|
12
|
+
* domain, language, date range, and recency filters.
|
|
13
|
+
*/
|
|
14
|
+
perplexitySearch,
|
|
15
|
+
};
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type { GatewayModelId } from './gateway-language-model-settings';
|
|
2
|
+
export type {
|
|
3
|
+
GatewayLanguageModelEntry,
|
|
4
|
+
GatewayLanguageModelSpecification,
|
|
5
|
+
} from './gateway-model-entry';
|
|
6
|
+
export type { GatewayCreditsResponse } from './gateway-fetch-metadata';
|
|
7
|
+
export type { GatewayLanguageModelEntry as GatewayModelEntry } from './gateway-model-entry';
|
|
8
|
+
export {
|
|
9
|
+
createGatewayProvider,
|
|
10
|
+
createGatewayProvider as createGateway,
|
|
11
|
+
gateway,
|
|
12
|
+
} from './gateway-provider';
|
|
13
|
+
export type {
|
|
14
|
+
GatewayProvider,
|
|
15
|
+
GatewayProviderSettings,
|
|
16
|
+
} from './gateway-provider';
|
|
17
|
+
export type { GatewayProviderOptions } from './gateway-provider-options';
|
|
18
|
+
export {
|
|
19
|
+
GatewayError,
|
|
20
|
+
GatewayAuthenticationError,
|
|
21
|
+
GatewayInvalidRequestError,
|
|
22
|
+
GatewayRateLimitError,
|
|
23
|
+
GatewayModelNotFoundError,
|
|
24
|
+
GatewayInternalServerError,
|
|
25
|
+
GatewayResponseError,
|
|
26
|
+
} from './errors';
|
|
27
|
+
export type { GatewayErrorResponse } from './errors';
|