@ai-sdk/gateway 3.0.62 → 3.0.63
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 +7 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/docs/00-ai-gateway.mdx +8 -0
- package/package.json +1 -1
- package/src/gateway-provider-options.ts +12 -0
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -440,6 +440,9 @@ declare const gatewayLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
|
440
440
|
models?: string[] | undefined;
|
|
441
441
|
byok?: Record<string, Record<string, unknown>[]> | undefined;
|
|
442
442
|
zeroDataRetention?: boolean | undefined;
|
|
443
|
+
providerTimeouts?: {
|
|
444
|
+
byok?: Record<string, number> | undefined;
|
|
445
|
+
} | undefined;
|
|
443
446
|
}>;
|
|
444
447
|
type GatewayLanguageModelOptions = InferSchema<typeof gatewayLanguageModelOptions>;
|
|
445
448
|
|
package/dist/index.d.ts
CHANGED
|
@@ -440,6 +440,9 @@ declare const gatewayLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
|
|
|
440
440
|
models?: string[] | undefined;
|
|
441
441
|
byok?: Record<string, Record<string, unknown>[]> | undefined;
|
|
442
442
|
zeroDataRetention?: boolean | undefined;
|
|
443
|
+
providerTimeouts?: {
|
|
444
|
+
byok?: Record<string, number> | undefined;
|
|
445
|
+
} | undefined;
|
|
443
446
|
}>;
|
|
444
447
|
type GatewayLanguageModelOptions = InferSchema<typeof gatewayLanguageModelOptions>;
|
|
445
448
|
|
package/dist/index.js
CHANGED
|
@@ -1336,7 +1336,7 @@ async function getVercelRequestId() {
|
|
|
1336
1336
|
var import_provider_utils12 = require("@ai-sdk/provider-utils");
|
|
1337
1337
|
|
|
1338
1338
|
// src/version.ts
|
|
1339
|
-
var VERSION = true ? "3.0.
|
|
1339
|
+
var VERSION = true ? "3.0.63" : "0.0.0-test";
|
|
1340
1340
|
|
|
1341
1341
|
// src/gateway-provider.ts
|
|
1342
1342
|
var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
|
package/dist/index.mjs
CHANGED
|
@@ -1356,7 +1356,7 @@ async function getVercelRequestId() {
|
|
|
1356
1356
|
import { withUserAgentSuffix } from "@ai-sdk/provider-utils";
|
|
1357
1357
|
|
|
1358
1358
|
// src/version.ts
|
|
1359
|
-
var VERSION = true ? "3.0.
|
|
1359
|
+
var VERSION = true ? "3.0.63" : "0.0.0-test";
|
|
1360
1360
|
|
|
1361
1361
|
// src/gateway-provider.ts
|
|
1362
1362
|
var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
|
package/docs/00-ai-gateway.mdx
CHANGED
|
@@ -631,6 +631,14 @@ The following gateway provider options are available:
|
|
|
631
631
|
|
|
632
632
|
Restricts routing requests to providers that have zero data retention policies.
|
|
633
633
|
|
|
634
|
+
- **providerTimeouts** _object_
|
|
635
|
+
|
|
636
|
+
Per-provider timeouts for BYOK credentials in milliseconds. Controls how long to wait for a provider to start responding before falling back to the next available provider.
|
|
637
|
+
|
|
638
|
+
Example: `providerTimeouts: { byok: { openai: 5000, anthropic: 2000 } }`
|
|
639
|
+
|
|
640
|
+
For full details, see [Provider Timeouts](https://vercel.com/docs/ai-gateway/models-and-providers/provider-timeouts).
|
|
641
|
+
|
|
634
642
|
You can combine these options to have fine-grained control over routing and tracking:
|
|
635
643
|
|
|
636
644
|
```ts
|
package/package.json
CHANGED
|
@@ -59,6 +59,18 @@ const gatewayLanguageModelOptions = lazySchema(() =>
|
|
|
59
59
|
* used.
|
|
60
60
|
*/
|
|
61
61
|
zeroDataRetention: z.boolean().optional(),
|
|
62
|
+
/**
|
|
63
|
+
* Per-provider timeouts for BYOK credentials in milliseconds.
|
|
64
|
+
* Controls how long to wait for a provider to start responding
|
|
65
|
+
* before falling back to the next available provider.
|
|
66
|
+
*
|
|
67
|
+
* Example: `{ byok: { openai: 5000, anthropic: 2000 } }`
|
|
68
|
+
*/
|
|
69
|
+
providerTimeouts: z
|
|
70
|
+
.object({
|
|
71
|
+
byok: z.record(z.string(), z.number().int().min(1000)).optional(),
|
|
72
|
+
})
|
|
73
|
+
.optional(),
|
|
62
74
|
}),
|
|
63
75
|
),
|
|
64
76
|
);
|