@ai-sdk/gateway 4.0.0-beta.32 → 4.0.0-beta.33
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 +8 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/docs/00-ai-gateway.mdx +4 -4
- package/package.json +3 -3
- package/src/gateway-provider-options.ts +9 -6
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1525,7 +1525,7 @@ async function getVercelRequestId() {
|
|
|
1525
1525
|
var import_provider_utils14 = require("@ai-sdk/provider-utils");
|
|
1526
1526
|
|
|
1527
1527
|
// src/version.ts
|
|
1528
|
-
var VERSION = true ? "4.0.0-beta.
|
|
1528
|
+
var VERSION = true ? "4.0.0-beta.33" : "0.0.0-test";
|
|
1529
1529
|
|
|
1530
1530
|
// src/gateway-provider.ts
|
|
1531
1531
|
var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
|
package/dist/index.mjs
CHANGED
|
@@ -1559,7 +1559,7 @@ async function getVercelRequestId() {
|
|
|
1559
1559
|
import { withUserAgentSuffix } from "@ai-sdk/provider-utils";
|
|
1560
1560
|
|
|
1561
1561
|
// src/version.ts
|
|
1562
|
-
var VERSION = true ? "4.0.0-beta.
|
|
1562
|
+
var VERSION = true ? "4.0.0-beta.33" : "0.0.0-test";
|
|
1563
1563
|
|
|
1564
1564
|
// src/gateway-provider.ts
|
|
1565
1565
|
var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
|
package/docs/00-ai-gateway.mdx
CHANGED
|
@@ -782,11 +782,11 @@ The following gateway provider options are available:
|
|
|
782
782
|
|
|
783
783
|
- **zeroDataRetention** _boolean_
|
|
784
784
|
|
|
785
|
-
Restricts routing
|
|
785
|
+
Restricts routing to providers that have zero data retention agreements with Vercel for AI Gateway. When using BYOK credentials, this filter is not applied. If BYOK credentials fail and the request falls back to system credentials, only providers with zero data retention agreements will be used. If there are no providers available for the model with zero data retention, the request will fail. Request-level ZDR is only available for Vercel Pro and Enterprise plans.
|
|
786
786
|
|
|
787
787
|
- **disallowPromptTraining** _boolean_
|
|
788
788
|
|
|
789
|
-
Restricts routing
|
|
789
|
+
Restricts routing to providers that have agreements with Vercel for AI Gateway to not use prompts for model training. When using BYOK credentials, this filter is not applied. If BYOK credentials fail and the request falls back to system credentials, only providers that do not train on prompt data will be used. If there are no providers available for the model that disallow prompt training, the request will fail.
|
|
790
790
|
|
|
791
791
|
|
|
792
792
|
- **providerTimeouts** _object_
|
|
@@ -842,7 +842,7 @@ const { text } = await generateText({
|
|
|
842
842
|
|
|
843
843
|
#### Zero Data Retention Example
|
|
844
844
|
|
|
845
|
-
Set `zeroDataRetention` to true to route requests to providers that have zero data retention agreements with Vercel for AI Gateway. If there are no providers available for the model with zero data retention, the request will fail. When `zeroDataRetention` is `false` or not specified, there is no enforcement of restricting routing.
|
|
845
|
+
Set `zeroDataRetention` to true to route requests to providers that have zero data retention agreements with Vercel for AI Gateway. When using BYOK credentials, this filter is not applied. If BYOK credentials fail and the request falls back to system credentials, only providers with zero data retention agreements will be used. If there are no providers available for the model with zero data retention, the request will fail. When `zeroDataRetention` is `false` or not specified, there is no enforcement of restricting routing. Request-level ZDR is only available for Vercel Pro and Enterprise plans.
|
|
846
846
|
|
|
847
847
|
```ts
|
|
848
848
|
import type { GatewayProviderOptions } from '@ai-sdk/gateway';
|
|
@@ -861,7 +861,7 @@ const { text } = await generateText({
|
|
|
861
861
|
|
|
862
862
|
#### Disallow Prompt Training Example
|
|
863
863
|
|
|
864
|
-
Set `disallowPromptTraining` to true to route 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. When `disallowPromptTraining` is `false` or not specified, there is no enforcement of restricting routing.
|
|
864
|
+
Set `disallowPromptTraining` to true to route requests to providers that have agreements with Vercel for AI Gateway to not use prompts for model training. When using BYOK credentials, this filter is not applied. If BYOK credentials fail and the request falls back to system credentials, only providers that do not train on prompt data will be used. If there are no providers available for the model that disallow prompt training, the request will fail. When `disallowPromptTraining` is `false` or not specified, there is no enforcement of restricting routing.
|
|
865
865
|
|
|
866
866
|
```ts
|
|
867
867
|
import type { GatewayProviderOptions } from '@ai-sdk/gateway';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/gateway",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "4.0.0-beta.
|
|
4
|
+
"version": "4.0.0-beta.33",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@vercel/oidc": "3.2.0",
|
|
34
|
-
"@ai-sdk/provider": "4.0.0-beta.
|
|
35
|
-
"@ai-sdk/provider-utils": "5.0.0-beta.
|
|
34
|
+
"@ai-sdk/provider": "4.0.0-beta.7",
|
|
35
|
+
"@ai-sdk/provider-utils": "5.0.0-beta.11"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/node": "18.15.11",
|
|
@@ -53,16 +53,19 @@ const gatewayProviderOptions = lazySchema(() =>
|
|
|
53
53
|
.record(z.string(), z.array(z.record(z.string(), z.unknown())))
|
|
54
54
|
.optional(),
|
|
55
55
|
/**
|
|
56
|
-
* Whether to filter by only providers that
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
56
|
+
* Whether to filter by only providers that have zero data retention
|
|
57
|
+
* agreements with Vercel for AI Gateway. When using BYOK credentials,
|
|
58
|
+
* this filter is not applied. If BYOK credentials fail and the request
|
|
59
|
+
* falls back to system credentials, only providers with zero data
|
|
60
|
+
* retention agreements will be used.
|
|
60
61
|
*/
|
|
61
62
|
zeroDataRetention: z.boolean().optional(),
|
|
62
63
|
/**
|
|
63
64
|
* Whether to filter by only providers that do not train on prompt data.
|
|
64
|
-
* When
|
|
65
|
-
*
|
|
65
|
+
* When using BYOK credentials, this filter is not applied. If BYOK
|
|
66
|
+
* credentials fail and the request falls back to system credentials,
|
|
67
|
+
* only providers that have agreements with Vercel for AI Gateway to not
|
|
68
|
+
* use prompts for model training will be used.
|
|
66
69
|
*/
|
|
67
70
|
disallowPromptTraining: z.boolean().optional(),
|
|
68
71
|
/**
|