@ai-sdk/gateway 3.0.230 → 3.0.232
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 +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/docs/00-ai-gateway.mdx +4 -0
- package/package.json +2 -2
- package/src/gateway-provider-options.ts +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @ai-sdk/gateway
|
|
2
2
|
|
|
3
|
+
## 3.0.232
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 706b42a: feat(provider/gateway): type the headquarters provider option
|
|
8
|
+
|
|
9
|
+
## 3.0.231
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [f0dee4b]
|
|
14
|
+
- @ai-sdk/provider-utils@4.0.65
|
|
15
|
+
|
|
3
16
|
## 3.0.230
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1190,6 +1190,7 @@ declare const gatewayProviderOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
|
1190
1190
|
byok?: Record<string, Record<string, unknown>[]> | undefined;
|
|
1191
1191
|
zeroDataRetention?: boolean | undefined;
|
|
1192
1192
|
disallowPromptTraining?: boolean | undefined;
|
|
1193
|
+
headquarters?: string[] | undefined;
|
|
1193
1194
|
quotaEntityId?: string | undefined;
|
|
1194
1195
|
providerTimeouts?: {
|
|
1195
1196
|
byok?: Record<string, number> | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -1190,6 +1190,7 @@ declare const gatewayProviderOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
|
1190
1190
|
byok?: Record<string, Record<string, unknown>[]> | undefined;
|
|
1191
1191
|
zeroDataRetention?: boolean | undefined;
|
|
1192
1192
|
disallowPromptTraining?: boolean | undefined;
|
|
1193
|
+
headquarters?: string[] | undefined;
|
|
1193
1194
|
quotaEntityId?: string | undefined;
|
|
1194
1195
|
providerTimeouts?: {
|
|
1195
1196
|
byok?: Record<string, number> | undefined;
|
package/dist/index.js
CHANGED
|
@@ -2664,7 +2664,7 @@ async function getVercelRequestId() {
|
|
|
2664
2664
|
}
|
|
2665
2665
|
|
|
2666
2666
|
// src/version.ts
|
|
2667
|
-
var VERSION = true ? "3.0.
|
|
2667
|
+
var VERSION = true ? "3.0.232" : "0.0.0-test";
|
|
2668
2668
|
|
|
2669
2669
|
// src/gateway-provider.ts
|
|
2670
2670
|
var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
|
package/dist/index.mjs
CHANGED
|
@@ -2762,7 +2762,7 @@ async function getVercelRequestId() {
|
|
|
2762
2762
|
}
|
|
2763
2763
|
|
|
2764
2764
|
// src/version.ts
|
|
2765
|
-
var VERSION = true ? "3.0.
|
|
2765
|
+
var VERSION = true ? "3.0.232" : "0.0.0-test";
|
|
2766
2766
|
|
|
2767
2767
|
// src/gateway-provider.ts
|
|
2768
2768
|
var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
|
package/docs/00-ai-gateway.mdx
CHANGED
|
@@ -1299,6 +1299,10 @@ The following gateway provider options are available:
|
|
|
1299
1299
|
|
|
1300
1300
|
Restricts routing requests to providers that have agreements with Vercel for AI Gateway to not use prompts for model training. If there are no providers available for the model that disallow prompt training, the request will fail. BYOK credentials are skipped when `disallowPromptTraining` is set to `true` to ensure that requests are only routed to providers that do not train on prompt data.
|
|
1301
1301
|
|
|
1302
|
+
- **headquarters** _string[]_
|
|
1303
|
+
|
|
1304
|
+
Restricts routing to providers whose parent company is headquartered in the listed countries, given as ISO 3166-1 alpha-2 codes (for example `['US', 'DE']`). To exclude countries instead, prefix every code with `!`, as in `['!US']`. A list can't mix allowed and excluded countries. The filter applies to both BYOK and system credentials, since it's about the provider rather than the credential. Providers without a recorded headquarters country are always excluded. If no provider for the model is headquartered in an allowed country, the request fails.
|
|
1305
|
+
|
|
1302
1306
|
- **quotaEntityId** _string_
|
|
1303
1307
|
|
|
1304
1308
|
The unique identifier for the entity against which quota is tracked. Used for quota management and enforcement purposes.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/gateway",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.232",
|
|
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.19",
|
|
35
|
-
"@ai-sdk/provider-utils": "4.0.
|
|
35
|
+
"@ai-sdk/provider-utils": "4.0.65"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/node": "18.15.11",
|
|
@@ -77,6 +77,12 @@ const gatewayProviderOptions = lazySchema(() =>
|
|
|
77
77
|
* to not use prompts for model training will be used.
|
|
78
78
|
*/
|
|
79
79
|
disallowPromptTraining: z.boolean().optional(),
|
|
80
|
+
/**
|
|
81
|
+
* Route only to providers headquartered in these countries (ISO 3166-1
|
|
82
|
+
* alpha-2 codes, e.g. `['US', 'DE']`), or prefix every code with `!` to
|
|
83
|
+
* exclude countries instead (e.g. `['!US']`). A list can't mix the two.
|
|
84
|
+
*/
|
|
85
|
+
headquarters: z.array(z.string()).optional(),
|
|
80
86
|
/**
|
|
81
87
|
* The unique identifier for the entity against which quota is tracked.
|
|
82
88
|
*
|