@ai-sdk/gateway 4.0.146 → 4.0.147
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.ts +38 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +101 -52
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/errors/create-gateway-error.ts +21 -0
- package/src/errors/gateway-access-policy-denied-error.ts +72 -0
- package/src/errors/index.ts +1 -0
- package/src/gateway-language-model-settings.ts +2 -4
- package/src/index.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ai-sdk/gateway
|
|
2
2
|
|
|
3
|
+
## 4.0.147
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 74042c5: chore(provider/gateway): update gateway model settings files
|
|
8
|
+
- b8c01eb: Map AI Gateway `access_policy_denied` error responses (HTTP 403) to the new `GatewayAccessPolicyDeniedError` instead of `GatewayInternalServerError`. Use `GatewayAccessPolicyDeniedError.isInstance(error)` to tell an access policy denial from other 403 errors. When the response includes them, the error exposes the denying policy IDs (`policyIds`) and the models and providers the policies removed (`removedModels`, `removedProviders`).
|
|
9
|
+
- Updated dependencies [10ff0b1]
|
|
10
|
+
- Updated dependencies [e878ab3]
|
|
11
|
+
- Updated dependencies [d99098a]
|
|
12
|
+
- @ai-sdk/provider@4.0.39
|
|
13
|
+
- @ai-sdk/provider-utils@5.0.82
|
|
14
|
+
|
|
3
15
|
## 4.0.146
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -116,7 +116,7 @@ type GatewayEmbeddingModelId = 'alibaba/qwen3-embedding-0.6b' | 'alibaba/qwen3-e
|
|
|
116
116
|
type GatewayImageModelId = 'bfl/flux-2-flex' | 'bfl/flux-2-klein-4b' | 'bfl/flux-2-klein-9b' | 'bfl/flux-2-max' | 'bfl/flux-2-pro' | 'bfl/flux-3-image' | 'bfl/flux-3-image-klein' | 'bfl/flux-kontext-max' | 'bfl/flux-kontext-pro' | 'bfl/flux-pro-1.0-fill' | 'bfl/flux-pro-1.1' | 'bfl/flux-pro-1.1-ultra' | 'bytedance/seedream-4.0' | 'bytedance/seedream-4.5' | 'bytedance/seedream-5.0-lite' | 'bytedance/seedream-5.0-pro' | 'meta/muse-image-1.0' | 'microsoft/mai-image-2.6' | 'microsoft/mai-image-2.6-flash' | 'minimax/minimax-h3-image' | 'minimax/minimax-h3-image-highspeed' | 'openai/gpt-image-1-mini' | 'openai/gpt-image-1.5' | 'openai/gpt-image-2' | 'openai/gpt-image-2.5-flare' | 'openai/gpt-image-2.5-sunburst' | 'openai/gpt-image-2.6-flare' | 'openai/gpt-image-2.6-sunburst' | 'prodia/flux-fast-schnell' | 'recraft/recraft-v2' | 'recraft/recraft-v3' | 'recraft/recraft-v4' | 'recraft/recraft-v4-pro' | 'recraft/recraft-v4.1' | 'recraft/recraft-v4.1-flash' | 'recraft/recraft-v4.1-pro' | 'recraft/recraft-v4.1-utility' | 'recraft/recraft-v4.1-utility-pro' | 'spacexai/grok-imagine-image' | 'spacexai/grok-imagine-image-2.0' | 'topaz/wonder-3.5' | (string & {});
|
|
117
117
|
//#endregion
|
|
118
118
|
//#region src/gateway-language-model-settings.d.ts
|
|
119
|
-
type GatewayModelId = 'alibaba/qwen-3-14b' | 'alibaba/qwen-3-235b' | 'alibaba/qwen-3-30b' | 'alibaba/qwen-3-32b' | 'alibaba/qwen3-coder' | 'alibaba/qwen3-coder-30b-a3b' | 'alibaba/qwen3-coder-next' | 'alibaba/qwen3-max-thinking' | 'alibaba/qwen3-next-80b-a3b-instruct' | 'alibaba/qwen3-next-80b-a3b-thinking' | 'alibaba/qwen3-vl-instruct' | 'alibaba/qwen3.5-flash' | 'alibaba/qwen3.5-plus' | 'alibaba/qwen3.6-27b' | 'alibaba/qwen3.6-35b-a3b' | 'alibaba/qwen3.6-plus' | 'alibaba/qwen3.7-flash' | 'alibaba/qwen3.7-max' | 'alibaba/qwen3.7-plus' | 'alibaba/qwen3.8-2.4t-a95b' | 'alibaba/qwen3.8-27b' | 'alibaba/qwen3.8-flash' | 'alibaba/qwen3.8-max' | 'alibaba/qwen3.8-max-0902' | 'alibaba/qwen3.8-max-prime' | 'alibaba/qwen3.8-omni-flash' | 'amazon/nova-2-lite' | 'amazon/nova-lite' | 'amazon/nova-micro' | 'amazon/nova-pro' | 'anthropic/claude-fable-5' | 'anthropic/claude-fable-5-batch' | 'anthropic/claude-fable-5.1' | 'anthropic/claude-fable-5.1-batch' | 'anthropic/claude-fable-5.2' | 'anthropic/claude-fable-5.2-batch' | 'anthropic/claude-fable-5.2-fast' | 'anthropic/claude-haiku-4.5' | 'anthropic/claude-haiku-4.5-batch' | 'anthropic/claude-haiku-5.5' | 'anthropic/claude-haiku-5.5-batch' | 'anthropic/claude-opus-4.5' | 'anthropic/claude-opus-4.5-batch' | 'anthropic/claude-opus-4.6' | 'anthropic/claude-opus-4.6-batch' | 'anthropic/claude-opus-4.7' | 'anthropic/claude-opus-4.7-batch' | 'anthropic/claude-opus-4.8' | 'anthropic/claude-opus-4.8-batch' | 'anthropic/claude-opus-4.8-fast' | 'anthropic/claude-opus-5' | 'anthropic/claude-opus-5-batch' | 'anthropic/claude-opus-5-fast' | 'anthropic/claude-opus-5.5' | 'anthropic/claude-opus-5.5-batch' | 'anthropic/claude-opus-5.5-fast' | 'anthropic/claude-sonnet-4.5' | 'anthropic/claude-sonnet-4.5-batch' | 'anthropic/claude-sonnet-4.6' | 'anthropic/claude-sonnet-4.6-batch' | 'anthropic/claude-sonnet-5' | 'anthropic/claude-sonnet-5-batch' | 'anthropic/claude-sonnet-5.5' | 'anthropic/claude-sonnet-5.5-batch' | 'bytedance/seed-2.1-turbo' | 'callstack/apex' | 'cohere/command-a' | 'deepseek/deepseek-r1' | 'deepseek/deepseek-v3.1' | 'deepseek/deepseek-v3.2' | 'deepseek/deepseek-v3.2-thinking' | 'deepseek/deepseek-v4-flash' | 'deepseek/deepseek-v4-flash-0731' | 'deepseek/deepseek-v4-flash-vision-exp' | 'deepseek/deepseek-v4-pro' | 'deepseek/deepseek-v4-pro-0813' | 'deepseek/deepseek-v4.1-flash' | 'deepseek/deepseek-v4.1-flash-1017' | 'deepseek/deepseek-v4.1-flash-1017-fast' | 'deepseek/deepseek-v4.1-flash-1017-ultrafast' | 'deepseek/deepseek-v4.1-flash-fast' | 'elorian/glimpse' | 'fireworks/ember-1' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-flash-batch' | 'google/gemini-2.5-flash-image' | 'google/gemini-2.5-flash-lite' | 'google/gemini-2.5-flash-lite-batch' | 'google/gemini-2.5-pro' | 'google/gemini-2.5-pro-batch' | 'google/gemini-3-flash' | 'google/gemini-3-flash-batch' | 'google/gemini-3-pro-image' | 'google/gemini-3.1-flash-image' | 'google/gemini-3.1-flash-lite' | 'google/gemini-3.1-flash-lite-batch' | 'google/gemini-3.1-flash-lite-image' | 'google/gemini-3.1-pro-preview' | 'google/gemini-3.1-pro-preview-batch' | 'google/gemini-3.5-flash' | 'google/gemini-3.5-flash-lite' | 'google/gemini-3.5-flash-lite-batch' | 'google/gemini-3.6-flash' | 'google/gemini-3.6-flash-batch' | 'google/gemini-3.7-flash' | 'google/gemini-3.8-flash' | 'google/gemini-4-argon' | 'google/gemini-4-carbon' | 'google/gemini-4-hydrogen' | 'google/gemini-nano-banana-2.1' | 'google/gemini-omni-1.2-flash' | 'google/gemini-omni-flash-preview' | 'google/gemma-4-26b-a4b-it' | 'google/gemma-4-31b-it' | 'humansand/ampersand-v0.1' | 'inception/mercury-
|
|
119
|
+
type GatewayModelId = 'alibaba/qwen-3-14b' | 'alibaba/qwen-3-235b' | 'alibaba/qwen-3-30b' | 'alibaba/qwen-3-32b' | 'alibaba/qwen3-coder' | 'alibaba/qwen3-coder-30b-a3b' | 'alibaba/qwen3-coder-next' | 'alibaba/qwen3-max-thinking' | 'alibaba/qwen3-next-80b-a3b-instruct' | 'alibaba/qwen3-next-80b-a3b-thinking' | 'alibaba/qwen3-vl-instruct' | 'alibaba/qwen3.5-flash' | 'alibaba/qwen3.5-plus' | 'alibaba/qwen3.6-27b' | 'alibaba/qwen3.6-35b-a3b' | 'alibaba/qwen3.6-plus' | 'alibaba/qwen3.7-flash' | 'alibaba/qwen3.7-max' | 'alibaba/qwen3.7-plus' | 'alibaba/qwen3.8-2.4t-a95b' | 'alibaba/qwen3.8-27b' | 'alibaba/qwen3.8-flash' | 'alibaba/qwen3.8-max' | 'alibaba/qwen3.8-max-0902' | 'alibaba/qwen3.8-max-prime' | 'alibaba/qwen3.8-omni-flash' | 'alibaba/qwen4-max' | 'amazon/nova-2-lite' | 'amazon/nova-lite' | 'amazon/nova-micro' | 'amazon/nova-pro' | 'anthropic/claude-fable-5' | 'anthropic/claude-fable-5-batch' | 'anthropic/claude-fable-5.1' | 'anthropic/claude-fable-5.1-batch' | 'anthropic/claude-fable-5.2' | 'anthropic/claude-fable-5.2-batch' | 'anthropic/claude-fable-5.2-fast' | 'anthropic/claude-haiku-4.5' | 'anthropic/claude-haiku-4.5-batch' | 'anthropic/claude-haiku-5.5' | 'anthropic/claude-haiku-5.5-batch' | 'anthropic/claude-opus-4.5' | 'anthropic/claude-opus-4.5-batch' | 'anthropic/claude-opus-4.6' | 'anthropic/claude-opus-4.6-batch' | 'anthropic/claude-opus-4.7' | 'anthropic/claude-opus-4.7-batch' | 'anthropic/claude-opus-4.8' | 'anthropic/claude-opus-4.8-batch' | 'anthropic/claude-opus-4.8-fast' | 'anthropic/claude-opus-5' | 'anthropic/claude-opus-5-batch' | 'anthropic/claude-opus-5-fast' | 'anthropic/claude-opus-5.5' | 'anthropic/claude-opus-5.5-batch' | 'anthropic/claude-opus-5.5-fast' | 'anthropic/claude-sonnet-4.5' | 'anthropic/claude-sonnet-4.5-batch' | 'anthropic/claude-sonnet-4.6' | 'anthropic/claude-sonnet-4.6-batch' | 'anthropic/claude-sonnet-5' | 'anthropic/claude-sonnet-5-batch' | 'anthropic/claude-sonnet-5.5' | 'anthropic/claude-sonnet-5.5-batch' | 'bytedance/seed-2.1-turbo' | 'callstack/apex' | 'cohere/command-a' | 'deepseek/deepseek-r1' | 'deepseek/deepseek-v3.1' | 'deepseek/deepseek-v3.2' | 'deepseek/deepseek-v3.2-thinking' | 'deepseek/deepseek-v4-flash' | 'deepseek/deepseek-v4-flash-0731' | 'deepseek/deepseek-v4-flash-vision-exp' | 'deepseek/deepseek-v4-pro' | 'deepseek/deepseek-v4-pro-0813' | 'deepseek/deepseek-v4.1-flash' | 'deepseek/deepseek-v4.1-flash-1017' | 'deepseek/deepseek-v4.1-flash-1017-fast' | 'deepseek/deepseek-v4.1-flash-1017-ultrafast' | 'deepseek/deepseek-v4.1-flash-fast' | 'elorian/glimpse' | 'fireworks/ember-1' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-flash-batch' | 'google/gemini-2.5-flash-image' | 'google/gemini-2.5-flash-lite' | 'google/gemini-2.5-flash-lite-batch' | 'google/gemini-2.5-pro' | 'google/gemini-2.5-pro-batch' | 'google/gemini-3-flash' | 'google/gemini-3-flash-batch' | 'google/gemini-3-pro-image' | 'google/gemini-3.1-flash-image' | 'google/gemini-3.1-flash-lite' | 'google/gemini-3.1-flash-lite-batch' | 'google/gemini-3.1-flash-lite-image' | 'google/gemini-3.1-pro-preview' | 'google/gemini-3.1-pro-preview-batch' | 'google/gemini-3.5-flash' | 'google/gemini-3.5-flash-lite' | 'google/gemini-3.5-flash-lite-batch' | 'google/gemini-3.6-flash' | 'google/gemini-3.6-flash-batch' | 'google/gemini-3.7-flash' | 'google/gemini-3.8-flash' | 'google/gemini-4-argon' | 'google/gemini-4-carbon' | 'google/gemini-4-hydrogen' | 'google/gemini-nano-banana-2.1' | 'google/gemini-omni-1.2-flash' | 'google/gemini-omni-flash-preview' | 'google/gemma-4-26b-a4b-it' | 'google/gemma-4-31b-it' | 'humansand/ampersand-v0.1' | 'inception/mercury-3' | 'inclusionai/ling-3.0-flash' | 'inclusionai/ling-3.0-flash-fin' | 'inclusionai/ling-3.0-flash-sante' | 'inclusionai/ling-3.0-flash-vl' | 'inclusionai/ling-3.1-flash' | 'inclusionai/ling-3.1-flash-1019' | 'inference-net/schematron-v2-small' | 'inference-net/schematron-v2-turbo' | 'interfaze/interfaze-beta' | 'liquid/lfm2.5-24b-a2b' | 'meituan/longcat-2.5' | 'meta/llama-3.1-70b' | 'meta/llama-3.1-8b' | 'meta/llama-3.3-70b' | 'meta/llama-4-maverick' | 'meta/llama-4-scout' | 'meta/muse-ember' | 'meta/muse-glimmer-30b' | 'meta/muse-spark-1.1' | 'meta/muse-spark-1.2' | 'meta/muse-spark-1.2-contributor' | 'meta/muse-spark-1.3' | 'meta/muse-spark-1.3-contributor' | 'meta/muse-spark-open' | 'meta/muse-wonder-1.0' | 'minimax/minimax-m2' | 'minimax/minimax-m2.1' | 'minimax/minimax-m2.1-lightning' | 'minimax/minimax-m2.5' | 'minimax/minimax-m2.5-highspeed' | 'minimax/minimax-m2.7' | 'minimax/minimax-m2.7-highspeed' | 'minimax/minimax-m3' | 'minimax/minimax-m3.1-flash' | 'mistral/codestral' | 'mistral/ministral-14b' | 'mistral/ministral-3b' | 'mistral/ministral-8b' | 'mistral/mistral-large-3' | 'mistral/mistral-large-4' | 'mistral/mistral-medium-3.5' | 'mistral/mistral-nemo' | 'mistral/mistral-small' | 'mixedbread/toast-1' | 'moonshotai/kimi-k2' | 'moonshotai/kimi-k2.5' | 'moonshotai/kimi-k2.6' | 'moonshotai/kimi-k2.7-code' | 'moonshotai/kimi-k2.7-code-highspeed' | 'moonshotai/kimi-k3' | 'moonshotai/kimi-k3-fast' | 'moonshotai/kimi-k3.1-pro' | 'moonshotai/kimi-k3.1-pro-highspeed' | 'morph/morph-v3-fast' | 'morph/morph-v3-large' | 'nvidia/nemotron-3-super-120b-a12b' | 'nvidia/nemotron-3-ultra-550b-a55b' | 'nvidia/nemotron-3.5-lightning' | 'nvidia/nemotron-3.5-lightning-free' | 'nvidia/nemotron-3.5-super-vl' | 'nvidia/nemotron-nano-12b-v2-vl' | 'nvidia/nemotron-nano-9b-v2' | 'openai/gpt-4.1' | 'openai/gpt-4.1-batch' | 'openai/gpt-4.1-fast' | 'openai/gpt-4.1-mini' | 'openai/gpt-4.1-mini-batch' | 'openai/gpt-4.1-mini-fast' | 'openai/gpt-4.1-nano' | 'openai/gpt-4o' | 'openai/gpt-4o-batch' | 'openai/gpt-4o-fast' | 'openai/gpt-4o-mini' | 'openai/gpt-4o-mini-batch' | 'openai/gpt-4o-mini-fast' | 'openai/gpt-5' | 'openai/gpt-5-batch' | 'openai/gpt-5-codex' | 'openai/gpt-5-fast' | 'openai/gpt-5-mini' | 'openai/gpt-5-mini-batch' | 'openai/gpt-5-mini-fast' | 'openai/gpt-5-nano' | 'openai/gpt-5-nano-batch' | 'openai/gpt-5-pro' | 'openai/gpt-5-pro-batch' | 'openai/gpt-5.1-codex' | 'openai/gpt-5.1-codex-max' | 'openai/gpt-5.1-codex-mini' | 'openai/gpt-5.1-thinking' | 'openai/gpt-5.1-thinking-fast' | 'openai/gpt-5.2' | 'openai/gpt-5.2-batch' | 'openai/gpt-5.2-codex' | 'openai/gpt-5.2-fast' | 'openai/gpt-5.2-pro' | 'openai/gpt-5.3-codex' | 'openai/gpt-5.3-codex-fast' | 'openai/gpt-5.4' | 'openai/gpt-5.4-batch' | 'openai/gpt-5.4-fast' | 'openai/gpt-5.4-mini' | 'openai/gpt-5.4-mini-batch' | 'openai/gpt-5.4-mini-fast' | 'openai/gpt-5.4-nano' | 'openai/gpt-5.4-nano-batch' | 'openai/gpt-5.4-pro' | 'openai/gpt-5.5' | 'openai/gpt-5.5-batch' | 'openai/gpt-5.5-fast' | 'openai/gpt-5.5-pro' | 'openai/gpt-5.5-pro-batch' | 'openai/gpt-5.6-luna' | 'openai/gpt-5.6-luna-batch' | 'openai/gpt-5.6-luna-fast' | 'openai/gpt-5.6-sol' | 'openai/gpt-5.6-sol-batch' | 'openai/gpt-5.6-sol-fast' | 'openai/gpt-5.6-terra' | 'openai/gpt-5.6-terra-batch' | 'openai/gpt-5.6-terra-fast' | 'openai/gpt-6-astra' | 'openai/gpt-6-astra-batch' | 'openai/gpt-6-astra-fast' | 'openai/gpt-6-luna' | 'openai/gpt-6-luna-batch' | 'openai/gpt-6-luna-fast' | 'openai/gpt-6-sol' | 'openai/gpt-6-sol-batch' | 'openai/gpt-6-sol-fast' | 'openai/gpt-6.1-sol' | 'openai/gpt-6.1-sol-batch' | 'openai/gpt-6.1-sol-fast' | 'openai/gpt-6.1-terra' | 'openai/gpt-6.1-terra-fast' | 'openai/gpt-oss-120b' | 'openai/gpt-oss-20b' | 'openai/gpt-oss-safeguard-120b' | 'openai/gpt-oss-safeguard-20b' | 'openai/o1' | 'openai/o3' | 'openai/o3-fast' | 'openai/o3-mini' | 'openai/o3-pro' | 'openai/o4-mini' | 'paperinstruments/ultramarine-1-flash' | 'particle/particle-1' | 'perplexity/sonar' | 'quiverai/arrow-2' | 'quiverai/arrow-2-telos' | 'reflection/beam' | 'reflection/beam-free' | 'sakana/fugu-max' | 'sakana/fugu-ultra' | 'sakana/fugu-ultra-v2' | 'sakana/namazu' | 'scaledown/scaledown-extract-1' | 'scaledown/scaledown-summarize-1' | 'spacexai/grok-4.20-multi-agent' | 'spacexai/grok-4.20-multi-agent-batch' | 'spacexai/grok-4.20-multi-agent-beta' | 'spacexai/grok-4.20-non-reasoning' | 'spacexai/grok-4.20-non-reasoning-batch' | 'spacexai/grok-4.20-non-reasoning-beta' | 'spacexai/grok-4.20-reasoning' | 'spacexai/grok-4.20-reasoning-batch' | 'spacexai/grok-4.20-reasoning-beta' | 'spacexai/grok-4.3' | 'spacexai/grok-4.3-batch' | 'spacexai/grok-4.5' | 'spacexai/grok-4.6' | 'spacexai/grok-4.7' | 'spacexai/grok-build-0.1' | 'stealth/glyph-cluster' | 'stepfun/step-3.7-flash' | 'stepfun/step-5-preview' | 'tencent/hy-mt2-lite' | 'tencent/hy-mt2-plus' | 'tencent/hy-mt2-pro' | 'tencent/hy3' | 'tencent/hy4' | 'tencent/hy4-flash' | 'tencent/hy4-preview' | 'thinkingmachines/inkling' | 'thinkingmachines/inkling-2-small' | 'thinkingmachines/inkling-small' | 'xiaomi/mimo-v2.6-flash' | 'xiaomi/mimo-v2.6-pro' | 'xiaomi/mimo-v2.6-pro-ultraspeed' | 'zai/glm-4.5' | 'zai/glm-4.5-air' | 'zai/glm-4.5v' | 'zai/glm-4.6' | 'zai/glm-4.7' | 'zai/glm-4.7-flash' | 'zai/glm-4.7-flashx' | 'zai/glm-5' | 'zai/glm-5-turbo' | 'zai/glm-5.1' | 'zai/glm-5.2' | 'zai/glm-5.2-fast' | 'zai/glm-5.3' | 'zai/glm-5.3-fast' | 'zai/glm-5.3-flash' | 'zai/glm-5.3-flashx' | 'zai/glm-5.3-flashx-legal' | 'zai/glm-5v-turbo' | (string & {});
|
|
120
120
|
//#endregion
|
|
121
121
|
//#region src/gateway-realtime-auth.d.ts
|
|
122
122
|
/**
|
|
@@ -1579,9 +1579,9 @@ type GatewayProviderMetadata = {
|
|
|
1579
1579
|
};
|
|
1580
1580
|
//#endregion
|
|
1581
1581
|
//#region src/errors/gateway-error.d.ts
|
|
1582
|
-
declare const symbol$
|
|
1582
|
+
declare const symbol$10: unique symbol;
|
|
1583
1583
|
export declare abstract class GatewayError extends Error {
|
|
1584
|
-
private readonly [symbol$
|
|
1584
|
+
private readonly [symbol$10];
|
|
1585
1585
|
abstract readonly name: string;
|
|
1586
1586
|
abstract readonly type: string;
|
|
1587
1587
|
readonly statusCode: number;
|
|
@@ -1616,6 +1616,41 @@ declare const gatewayErrorResponseSchema: import("@ai-sdk/provider-utils").LazyS
|
|
|
1616
1616
|
}>;
|
|
1617
1617
|
type GatewayErrorResponse = InferSchema<typeof gatewayErrorResponseSchema>;
|
|
1618
1618
|
//#endregion
|
|
1619
|
+
//#region src/errors/gateway-access-policy-denied-error.d.ts
|
|
1620
|
+
declare const symbol$9: unique symbol;
|
|
1621
|
+
/**
|
|
1622
|
+
* Access policy denied - an AI Gateway access policy that applies to the
|
|
1623
|
+
* request does not allow the requested model or provider.
|
|
1624
|
+
*/
|
|
1625
|
+
export declare class GatewayAccessPolicyDeniedError extends GatewayError {
|
|
1626
|
+
private readonly [symbol$9];
|
|
1627
|
+
readonly name = "GatewayAccessPolicyDeniedError";
|
|
1628
|
+
readonly type = "access_policy_denied";
|
|
1629
|
+
/**
|
|
1630
|
+
* IDs of the access policies that denied the request, when the gateway
|
|
1631
|
+
* includes them.
|
|
1632
|
+
*/
|
|
1633
|
+
readonly policyIds?: string[];
|
|
1634
|
+
/**
|
|
1635
|
+
* Models the access policies removed, when the gateway includes them.
|
|
1636
|
+
*/
|
|
1637
|
+
readonly removedModels?: string[];
|
|
1638
|
+
/**
|
|
1639
|
+
* Providers the access policies removed, when the gateway includes them.
|
|
1640
|
+
*/
|
|
1641
|
+
readonly removedProviders?: string[];
|
|
1642
|
+
constructor({ message, statusCode, cause, generationId, policyIds, removedModels, removedProviders }?: {
|
|
1643
|
+
message?: string;
|
|
1644
|
+
statusCode?: number;
|
|
1645
|
+
cause?: unknown;
|
|
1646
|
+
generationId?: string;
|
|
1647
|
+
policyIds?: string[];
|
|
1648
|
+
removedModels?: string[];
|
|
1649
|
+
removedProviders?: string[];
|
|
1650
|
+
});
|
|
1651
|
+
static isInstance(error: unknown): error is GatewayAccessPolicyDeniedError;
|
|
1652
|
+
}
|
|
1653
|
+
//#endregion
|
|
1619
1654
|
//#region src/errors/gateway-authentication-error.d.ts
|
|
1620
1655
|
declare const symbol$8: unique symbol;
|
|
1621
1656
|
/**
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":["_$__tool_browserbase_fetch0.BrowserbaseFetchConfig","_$__tool_browserbase_fetch0.browserbaseFetchToolFactory","_$__tool_browserbase_search0.BrowserbaseSearchConfig","_$__tool_browserbase_search0.browserbaseSearchToolFactory","_$__tool_deepseek_fetch0.DeepSeekFetchConfig","_$__tool_deepseek_fetch0.deepseekFetchToolFactory","_$__tool_deepseek_search0.DeepSeekSearchConfig","_$__tool_deepseek_search0.deepseekSearchToolFactory","_$__tool_exa_search0.ExaSearchConfig","_$__tool_exa_search0.exaSearchToolFactory","_$__tool_parallel_search0.ParallelSearchConfig","_$__tool_parallel_search0.parallelSearchToolFactory","_$__tool_perplexity_search0.PerplexitySearchConfig","_$__tool_perplexity_search0.perplexitySearchToolFactory","_$__tool_tako_search0.TakoSearchConfig","_$__tool_tako_search0.takoSearchToolFactory","BatchV4","RealtimeFactoryV4","symbol","symbol","symbol","symbol","symbol","symbol","symbol","symbol","symbol"],"sources":["../src/gateway-decision-model-settings.ts","../src/gateway-provider-options.ts","../src/gateway-embedding-model-settings.ts","../src/gateway-image-model-settings.ts","../src/gateway-language-model-settings.ts","../src/gateway-realtime-auth.ts","../src/gateway-realtime-model-settings.ts","../src/gateway-reranking-model-settings.ts","../src/gateway-speech-model-settings.ts","../src/gateway-transcription-model-settings.ts","../src/gateway-video-model-settings.ts","../src/gateway-model-entry.ts","../src/gateway-fetch-metadata.ts","../src/gateway-spend-report.ts","../src/gateway-generation-info.ts","../src/tool/browserbase-fetch.ts","../src/tool/browserbase-search.ts","../src/tool/gateway-tool-error.ts","../src/tool/deepseek-fetch.ts","../src/tool/deepseek-search.ts","../src/tool/exa-search.ts","../src/tool/parallel-search.ts","../src/tool/perplexity-search.ts","../src/tool/tako-search.ts","../src/gateway-tools.ts","../src/gateway-provider.ts","../src/gateway-provider-metadata.ts","../src/errors/gateway-error.ts","../src/errors/create-gateway-error.ts","../src/errors/gateway-authentication-error.ts","../src/errors/gateway-failed-dependency-error.ts","../src/errors/gateway-forbidden-error.ts","../src/errors/gateway-internal-server-error.ts","../src/errors/gateway-invalid-request-error.ts","../src/errors/gateway-model-not-found-error.ts","../src/errors/gateway-not-found-error.ts","../src/errors/gateway-rate-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ACA,YACA,OACA;IAEA;IACA;IACA;IACA;;SAKK,WAAW,iBAAiB,SAAS;;;;cCzBxCC;;;;;qBAcO,8BAA8B;oBACvBA;WAET;WACA;WACA;EAEG,cACV,SACA,YACA,OACA,cACA;IAEA;IACA;IACA;IACA;IACA;;SAMK,WAAW,iBAAiB,SAAS;;;;cCxCxCC;;;;qBAKO,mCAAmC;oBAC5BA;WAET;WACA;EAEG,cACV,SACA,YACA,OACA;IAEA;IACA;IACA;IACA;;SAKK,WAAW,iBAAiB,SAAS;;;;cCzBxCC;;;;qBAKO,mCAAmC;oBAC5BA;WAET;WACA;EAEG,cACV,SACA,YACA,OACA;IAEA;IACA;IACA;IACA;;SAKK,WAAW,iBAAiB,SAAS;;;;cCvBxCC;;;;qBAaO,kCAAkC;oBAC3BA;WAET;WACA;WACA;EAEG,cACV,SACA,YACA,SACA,OACA;IAEA;IACA;IACA;IACA;IACA;;SAMK,WAAW,iBAAiB,SAAS;;;;cCvCxCC;;;;;;qBAOO,6BAA6B;oBACtBA;WAET;WACA;EAEG,cACV,SACA,YACA,OACA;IAEA;IACA;IACA;IACA;;SAKK,WAAW,iBAAiB,SAAS;;;;cC3BxCC;;;;qBAKO,8BAA8B;oBACvBA;WAET;WACA;EAEG,cACV,SACA,YACA,OACA;IAEA;IACA;IACA;IACA;;SAKK,WAAW,iBAAiB,SAAS;;;;cCxBxC;;;;qBAKO,6BAA6B;oBACtB;WAET;WACA;WACA;WACA,kBAAkB;EAEf,cACV,SACA,YACA,UACA,iBACA,OACA,cACA;IAEA;IACA;IACA;IACA,kBAAkB;IAClB;IACA;IACA;;SAOK,WAAW,iBAAiB,SAAS;;;;qBCtCjC;;;;YC0ED,2BAA2B;;YAE3B,4BAA4B,uCACtC,0BAA0B"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["_$__tool_browserbase_fetch0.BrowserbaseFetchConfig","_$__tool_browserbase_fetch0.browserbaseFetchToolFactory","_$__tool_browserbase_search0.BrowserbaseSearchConfig","_$__tool_browserbase_search0.browserbaseSearchToolFactory","_$__tool_deepseek_fetch0.DeepSeekFetchConfig","_$__tool_deepseek_fetch0.deepseekFetchToolFactory","_$__tool_deepseek_search0.DeepSeekSearchConfig","_$__tool_deepseek_search0.deepseekSearchToolFactory","_$__tool_exa_search0.ExaSearchConfig","_$__tool_exa_search0.exaSearchToolFactory","_$__tool_parallel_search0.ParallelSearchConfig","_$__tool_parallel_search0.parallelSearchToolFactory","_$__tool_perplexity_search0.PerplexitySearchConfig","_$__tool_perplexity_search0.perplexitySearchToolFactory","_$__tool_tako_search0.TakoSearchConfig","_$__tool_tako_search0.takoSearchToolFactory","BatchV4","RealtimeFactoryV4","symbol","symbol","symbol","symbol","symbol","symbol","symbol","symbol","symbol","symbol"],"sources":["../src/gateway-decision-model-settings.ts","../src/gateway-provider-options.ts","../src/gateway-embedding-model-settings.ts","../src/gateway-image-model-settings.ts","../src/gateway-language-model-settings.ts","../src/gateway-realtime-auth.ts","../src/gateway-realtime-model-settings.ts","../src/gateway-reranking-model-settings.ts","../src/gateway-speech-model-settings.ts","../src/gateway-transcription-model-settings.ts","../src/gateway-video-model-settings.ts","../src/gateway-model-entry.ts","../src/gateway-fetch-metadata.ts","../src/gateway-spend-report.ts","../src/gateway-generation-info.ts","../src/tool/browserbase-fetch.ts","../src/tool/browserbase-search.ts","../src/tool/gateway-tool-error.ts","../src/tool/deepseek-fetch.ts","../src/tool/deepseek-search.ts","../src/tool/exa-search.ts","../src/tool/parallel-search.ts","../src/tool/perplexity-search.ts","../src/tool/tako-search.ts","../src/gateway-tools.ts","../src/gateway-provider.ts","../src/gateway-provider-metadata.ts","../src/errors/gateway-error.ts","../src/errors/create-gateway-error.ts","../src/errors/gateway-access-policy-denied-error.ts","../src/errors/gateway-authentication-error.ts","../src/errors/gateway-failed-dependency-error.ts","../src/errors/gateway-forbidden-error.ts","../src/errors/gateway-internal-server-error.ts","../src/errors/gateway-invalid-request-error.ts","../src/errors/gateway-model-not-found-error.ts","../src/errors/gateway-not-found-error.ts","../src/errors/gateway-rate-limit-error.ts","../src/errors/gateway-response-error.ts","../src/version.ts","../src/index.ts"],"mappings":";;;KAAY;;;;;;;;;;KC2BA,0BAA0B,uCAClC;EAAqB,WAAW;EAAa;KAC7C;EACE,WAAW;EACX;KAEF;EAAqB,KAAK,8BAA8B;KACxD;EAAqB,KAAK,8BAA8B;KACxD;EACE;IACE;IACA,YAAY,8BAA8B;;;KAItC,qBAAqB;EAG3B;EACA,MAAM,0BAA0B;;KAG1B,uBAAuB;;;;;GAKhC;;EAGD,OAAO,eAAe,MAAM;;EAG5B;;;;;;;EAQA;;EAGA;;;;;;EAOA;;;;;;;;;;;;;EAcA,MAAM;;;;;EAcN;;;;;;;;EASA,SAAS,yBAAyB;;EAGlC;;EAGA;;EAGA;IACE,OAAO;;;EAIT;;EAGA;;EAGA;;EAGA;;EAGA;;EAGA;;KAGG,8BAA8B,+BACjC,0BAA0B,iBACvB,0BAA0B;KAG1B;KASA,mBAAmB,aAAa,eAClC,OAAO,QAAQ,oBAAoB;KAGjC,gCAAgC,8BAA8B,QACjE,qBAAqB;KAIlB,yBAAyB,0CAEzB,gCAAgC;;;KC5KzB;;;KCAA;;;KCAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBC4BC;;;;;qBAMA;;;;;qBAMA;;qBAGA;;qBAGA;;;;;wBAMG,4BACd,eACA;EAAY;;;;;;wBASE,iCACd,eACA;EAAY;;;;;;wBAaE,0BACd,eACA;EAAY;;;;;;;;;;;wBA8BE,4BACd;;;;;;wBAgBc,+BACd;;;KChIU;;;KCAA;;;KCAA;;;KCAA;;;KCAA;;;cCEC;KAcD,yBAAyB;UAEpB;;;;;EAKf;;;;EAKA;;;;EAKA;;;;EAKA;;;;IAIE;;;;IAIA;;;;;IAKA;;;;;IAKA;;;;;EAMF,eAAe;;;;EAKf,YAAY;;KAGF,oCAAoC,KAC9C;;;UCnDe;EACf,QAAQ;;UAGO;;EAEf;;EAEA;;;;UCfe;;EAEf;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A;EAEG,cACV,SACA,YACA,OACA;IAEA;IACA;IACA;IACA;;SAKK,WAAW,iBAAiB,SAAS;;;;SAOrC,wBACL,gBACA,mBACA,YACA,OACA;IAEA;IACA;IACA;IACA;IACA;IACA;MACE;;;;cC7CAC;;;;;;qBAOO,qCAAqC;oBAC9BA;WAET;WACA;EAEG,cACV,SACA,YACA,OACA;IAEA;IACA;IACA;IACA;;SAKK,WAAW,iBAAiB,SAAS;;;;cCzBxCC;;;;;qBAcO,8BAA8B;oBACvBA;WAET;WACA;WACA;EAEG,cACV,SACA,YACA,OACA,cACA;IAEA;IACA;IACA;IACA;IACA;;SAMK,WAAW,iBAAiB,SAAS;;;;cCxCxCC;;;;qBAKO,mCAAmC;oBAC5BA;WAET;WACA;EAEG,cACV,SACA,YACA,OACA;IAEA;IACA;IACA;IACA;;SAKK,WAAW,iBAAiB,SAAS;;;;cCzBxCC;;;;qBAKO,mCAAmC;oBAC5BA;WAET;WACA;EAEG,cACV,SACA,YACA,OACA;IAEA;IACA;IACA;IACA;;SAKK,WAAW,iBAAiB,SAAS;;;;cCvBxCC;;;;qBAaO,kCAAkC;oBAC3BA;WAET;WACA;WACA;EAEG,cACV,SACA,YACA,SACA,OACA;IAEA;IACA;IACA;IACA;IACA;;SAMK,WAAW,iBAAiB,SAAS;;;;cCvCxCC;;;;;;qBAOO,6BAA6B;oBACtBA;WAET;WACA;EAEG,cACV,SACA,YACA,OACA;IAEA;IACA;IACA;IACA;;SAKK,WAAW,iBAAiB,SAAS;;;;cC3BxCC;;;;qBAKO,8BAA8B;oBACvBA;WAET;WACA;EAEG,cACV,SACA,YACA,OACA;IAEA;IACA;IACA;IACA;;SAKK,WAAW,iBAAiB,SAAS;;;;cCxBxC;;;;qBAKO,6BAA6B;oBACtB;WAET;WACA;WACA;WACA,kBAAkB;EAEf,cACV,SACA,YACA,UACA,iBACA,OACA,cACA;IAEA;IACA;IACA;IACA,kBAAkB;IAClB;IACA;IACA;;SAOK,WAAW,iBAAiB,SAAS;;;;qBCtCjC;;;;YC2ED,2BAA2B;;YAE3B,4BAA4B,uCACtC,0BAA0B"}
|
package/dist/index.js
CHANGED
|
@@ -155,11 +155,11 @@ function describe(schema, description) {
|
|
|
155
155
|
}
|
|
156
156
|
//#endregion
|
|
157
157
|
//#region src/errors/gateway-error.ts
|
|
158
|
-
const symbol$
|
|
158
|
+
const symbol$11 = Symbol.for("vercel.ai.gateway.error");
|
|
159
159
|
var GatewayError = class GatewayError extends Error {
|
|
160
160
|
constructor({ message, statusCode = 500, cause, generationId, isRetryable = statusCode != null && (statusCode === 408 || statusCode === 409 || statusCode === 429 || statusCode >= 500) }) {
|
|
161
161
|
super(generationId ? `${message} [${generationId}]` : message);
|
|
162
|
-
this[symbol$
|
|
162
|
+
this[symbol$11] = true;
|
|
163
163
|
this.statusCode = statusCode;
|
|
164
164
|
this.cause = cause;
|
|
165
165
|
this.generationId = generationId;
|
|
@@ -174,14 +174,14 @@ var GatewayError = class GatewayError extends Error {
|
|
|
174
174
|
return GatewayError.hasMarker(error);
|
|
175
175
|
}
|
|
176
176
|
static hasMarker(error) {
|
|
177
|
-
return typeof error === "object" && error !== null && symbol$
|
|
177
|
+
return typeof error === "object" && error !== null && symbol$11 in error && error[symbol$11] === true;
|
|
178
178
|
}
|
|
179
179
|
};
|
|
180
180
|
//#endregion
|
|
181
181
|
//#region src/errors/gateway-authentication-error.ts
|
|
182
|
-
const name$
|
|
183
|
-
const marker$
|
|
184
|
-
const symbol$
|
|
182
|
+
const name$10 = "GatewayAuthenticationError";
|
|
183
|
+
const marker$10 = `vercel.ai.gateway.error.${name$10}`;
|
|
184
|
+
const symbol$10 = Symbol.for(marker$10);
|
|
185
185
|
/**
|
|
186
186
|
* Authentication failed - invalid API key or OIDC token
|
|
187
187
|
*/
|
|
@@ -193,12 +193,12 @@ var GatewayAuthenticationError = class GatewayAuthenticationError extends Gatewa
|
|
|
193
193
|
cause,
|
|
194
194
|
generationId
|
|
195
195
|
});
|
|
196
|
-
this[symbol$
|
|
197
|
-
this.name = name$
|
|
196
|
+
this[symbol$10] = true;
|
|
197
|
+
this.name = name$10;
|
|
198
198
|
this.type = "authentication_error";
|
|
199
199
|
}
|
|
200
200
|
static isInstance(error) {
|
|
201
|
-
return GatewayError.hasMarker(error) && symbol$
|
|
201
|
+
return GatewayError.hasMarker(error) && symbol$10 in error;
|
|
202
202
|
}
|
|
203
203
|
/**
|
|
204
204
|
* Creates a contextual error message when authentication fails
|
|
@@ -237,9 +237,9 @@ Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the toke
|
|
|
237
237
|
};
|
|
238
238
|
//#endregion
|
|
239
239
|
//#region src/errors/gateway-invalid-request-error.ts
|
|
240
|
-
const name$
|
|
241
|
-
const marker$
|
|
242
|
-
const symbol$
|
|
240
|
+
const name$9 = "GatewayInvalidRequestError";
|
|
241
|
+
const marker$9 = `vercel.ai.gateway.error.${name$9}`;
|
|
242
|
+
const symbol$9 = Symbol.for(marker$9);
|
|
243
243
|
/**
|
|
244
244
|
* Invalid request - missing headers, malformed data, etc.
|
|
245
245
|
*/
|
|
@@ -251,19 +251,19 @@ var GatewayInvalidRequestError = class extends GatewayError {
|
|
|
251
251
|
cause,
|
|
252
252
|
generationId
|
|
253
253
|
});
|
|
254
|
-
this[symbol$
|
|
255
|
-
this.name = name$
|
|
254
|
+
this[symbol$9] = true;
|
|
255
|
+
this.name = name$9;
|
|
256
256
|
this.type = "invalid_request_error";
|
|
257
257
|
}
|
|
258
258
|
static isInstance(error) {
|
|
259
|
-
return GatewayError.hasMarker(error) && symbol$
|
|
259
|
+
return GatewayError.hasMarker(error) && symbol$9 in error;
|
|
260
260
|
}
|
|
261
261
|
};
|
|
262
262
|
//#endregion
|
|
263
263
|
//#region src/errors/gateway-rate-limit-error.ts
|
|
264
|
-
const name$
|
|
265
|
-
const marker$
|
|
266
|
-
const symbol$
|
|
264
|
+
const name$8 = "GatewayRateLimitError";
|
|
265
|
+
const marker$8 = `vercel.ai.gateway.error.${name$8}`;
|
|
266
|
+
const symbol$8 = Symbol.for(marker$8);
|
|
267
267
|
/**
|
|
268
268
|
* Rate limit exceeded.
|
|
269
269
|
*/
|
|
@@ -275,19 +275,19 @@ var GatewayRateLimitError = class extends GatewayError {
|
|
|
275
275
|
cause,
|
|
276
276
|
generationId
|
|
277
277
|
});
|
|
278
|
-
this[symbol$
|
|
279
|
-
this.name = name$
|
|
278
|
+
this[symbol$8] = true;
|
|
279
|
+
this.name = name$8;
|
|
280
280
|
this.type = "rate_limit_exceeded";
|
|
281
281
|
}
|
|
282
282
|
static isInstance(error) {
|
|
283
|
-
return GatewayError.hasMarker(error) && symbol$
|
|
283
|
+
return GatewayError.hasMarker(error) && symbol$8 in error;
|
|
284
284
|
}
|
|
285
285
|
};
|
|
286
286
|
//#endregion
|
|
287
287
|
//#region src/errors/gateway-model-not-found-error.ts
|
|
288
|
-
const name$
|
|
289
|
-
const marker$
|
|
290
|
-
const symbol$
|
|
288
|
+
const name$7 = "GatewayModelNotFoundError";
|
|
289
|
+
const marker$7 = `vercel.ai.gateway.error.${name$7}`;
|
|
290
|
+
const symbol$7 = Symbol.for(marker$7);
|
|
291
291
|
const modelNotFoundParamSchema = lazySchema(() => zodSchema(z.object({ modelId: z.string() })));
|
|
292
292
|
/**
|
|
293
293
|
* Model not found or not available
|
|
@@ -300,20 +300,20 @@ var GatewayModelNotFoundError = class extends GatewayError {
|
|
|
300
300
|
cause,
|
|
301
301
|
generationId
|
|
302
302
|
});
|
|
303
|
-
this[symbol$
|
|
304
|
-
this.name = name$
|
|
303
|
+
this[symbol$7] = true;
|
|
304
|
+
this.name = name$7;
|
|
305
305
|
this.type = "model_not_found";
|
|
306
306
|
this.modelId = modelId;
|
|
307
307
|
}
|
|
308
308
|
static isInstance(error) {
|
|
309
|
-
return GatewayError.hasMarker(error) && symbol$
|
|
309
|
+
return GatewayError.hasMarker(error) && symbol$7 in error;
|
|
310
310
|
}
|
|
311
311
|
};
|
|
312
312
|
//#endregion
|
|
313
313
|
//#region src/errors/gateway-not-found-error.ts
|
|
314
|
-
const name$
|
|
315
|
-
const marker$
|
|
316
|
-
const symbol$
|
|
314
|
+
const name$6 = "GatewayNotFoundError";
|
|
315
|
+
const marker$6 = `vercel.ai.gateway.error.${name$6}`;
|
|
316
|
+
const symbol$6 = Symbol.for(marker$6);
|
|
317
317
|
/**
|
|
318
318
|
* Not found - the requested Gateway resource does not exist or is not
|
|
319
319
|
* visible to the caller (e.g. an unknown async batch/video job id).
|
|
@@ -327,19 +327,19 @@ var GatewayNotFoundError = class extends GatewayError {
|
|
|
327
327
|
cause,
|
|
328
328
|
generationId
|
|
329
329
|
});
|
|
330
|
-
this[symbol$
|
|
331
|
-
this.name = name$
|
|
330
|
+
this[symbol$6] = true;
|
|
331
|
+
this.name = name$6;
|
|
332
332
|
this.type = "not_found";
|
|
333
333
|
}
|
|
334
334
|
static isInstance(error) {
|
|
335
|
-
return GatewayError.hasMarker(error) && symbol$
|
|
335
|
+
return GatewayError.hasMarker(error) && symbol$6 in error;
|
|
336
336
|
}
|
|
337
337
|
};
|
|
338
338
|
//#endregion
|
|
339
339
|
//#region src/errors/gateway-internal-server-error.ts
|
|
340
|
-
const name$
|
|
341
|
-
const marker$
|
|
342
|
-
const symbol$
|
|
340
|
+
const name$5 = "GatewayInternalServerError";
|
|
341
|
+
const marker$5 = `vercel.ai.gateway.error.${name$5}`;
|
|
342
|
+
const symbol$5 = Symbol.for(marker$5);
|
|
343
343
|
/**
|
|
344
344
|
* Internal server error from the Gateway
|
|
345
345
|
*/
|
|
@@ -351,19 +351,19 @@ var GatewayInternalServerError = class extends GatewayError {
|
|
|
351
351
|
cause,
|
|
352
352
|
generationId
|
|
353
353
|
});
|
|
354
|
-
this[symbol$
|
|
355
|
-
this.name = name$
|
|
354
|
+
this[symbol$5] = true;
|
|
355
|
+
this.name = name$5;
|
|
356
356
|
this.type = "internal_server_error";
|
|
357
357
|
}
|
|
358
358
|
static isInstance(error) {
|
|
359
|
-
return GatewayError.hasMarker(error) && symbol$
|
|
359
|
+
return GatewayError.hasMarker(error) && symbol$5 in error;
|
|
360
360
|
}
|
|
361
361
|
};
|
|
362
362
|
//#endregion
|
|
363
363
|
//#region src/errors/gateway-failed-dependency-error.ts
|
|
364
|
-
const name$
|
|
365
|
-
const marker$
|
|
366
|
-
const symbol$
|
|
364
|
+
const name$4 = "GatewayFailedDependencyError";
|
|
365
|
+
const marker$4 = `vercel.ai.gateway.error.${name$4}`;
|
|
366
|
+
const symbol$4 = Symbol.for(marker$4);
|
|
367
367
|
/**
|
|
368
368
|
* The request could not be fulfilled because a dependency it relied on was not
|
|
369
369
|
* available on the credentials or provider used to serve it (HTTP 424). Not
|
|
@@ -377,19 +377,19 @@ var GatewayFailedDependencyError = class extends GatewayError {
|
|
|
377
377
|
cause,
|
|
378
378
|
generationId
|
|
379
379
|
});
|
|
380
|
-
this[symbol$
|
|
381
|
-
this.name = name$
|
|
380
|
+
this[symbol$4] = true;
|
|
381
|
+
this.name = name$4;
|
|
382
382
|
this.type = "failed_dependency";
|
|
383
383
|
}
|
|
384
384
|
static isInstance(error) {
|
|
385
|
-
return GatewayError.hasMarker(error) && symbol$
|
|
385
|
+
return GatewayError.hasMarker(error) && symbol$4 in error;
|
|
386
386
|
}
|
|
387
387
|
};
|
|
388
388
|
//#endregion
|
|
389
389
|
//#region src/errors/gateway-forbidden-error.ts
|
|
390
|
-
const name$
|
|
391
|
-
const marker$
|
|
392
|
-
const symbol$
|
|
390
|
+
const name$3 = "GatewayForbiddenError";
|
|
391
|
+
const marker$3 = `vercel.ai.gateway.error.${name$3}`;
|
|
392
|
+
const symbol$3 = Symbol.for(marker$3);
|
|
393
393
|
const forbiddenParamSchema = lazySchema(() => zodSchema(z.object({ ruleId: z.string() })));
|
|
394
394
|
/**
|
|
395
395
|
* Forbidden - the request was rejected by policy (e.g. a routing rule),
|
|
@@ -403,11 +403,44 @@ var GatewayForbiddenError = class extends GatewayError {
|
|
|
403
403
|
cause,
|
|
404
404
|
generationId
|
|
405
405
|
});
|
|
406
|
-
this[symbol$
|
|
407
|
-
this.name = name$
|
|
406
|
+
this[symbol$3] = true;
|
|
407
|
+
this.name = name$3;
|
|
408
408
|
this.type = "forbidden";
|
|
409
409
|
this.ruleId = ruleId;
|
|
410
410
|
}
|
|
411
|
+
static isInstance(error) {
|
|
412
|
+
return GatewayError.hasMarker(error) && symbol$3 in error;
|
|
413
|
+
}
|
|
414
|
+
};
|
|
415
|
+
//#endregion
|
|
416
|
+
//#region src/errors/gateway-access-policy-denied-error.ts
|
|
417
|
+
const name$2 = "GatewayAccessPolicyDeniedError";
|
|
418
|
+
const marker$2 = `vercel.ai.gateway.error.${name$2}`;
|
|
419
|
+
const symbol$2 = Symbol.for(marker$2);
|
|
420
|
+
const accessPolicyDeniedParamSchema = lazySchema(() => zodSchema(z.object({
|
|
421
|
+
policyIds: z.optional(z.array(z.string())),
|
|
422
|
+
removedModels: z.optional(z.array(z.string())),
|
|
423
|
+
removedProviders: z.optional(z.array(z.string()))
|
|
424
|
+
})));
|
|
425
|
+
/**
|
|
426
|
+
* Access policy denied - an AI Gateway access policy that applies to the
|
|
427
|
+
* request does not allow the requested model or provider.
|
|
428
|
+
*/
|
|
429
|
+
var GatewayAccessPolicyDeniedError = class extends GatewayError {
|
|
430
|
+
constructor({ message = "Access policy denied", statusCode = 403, cause, generationId, policyIds, removedModels, removedProviders } = {}) {
|
|
431
|
+
super({
|
|
432
|
+
message,
|
|
433
|
+
statusCode,
|
|
434
|
+
cause,
|
|
435
|
+
generationId
|
|
436
|
+
});
|
|
437
|
+
this[symbol$2] = true;
|
|
438
|
+
this.name = name$2;
|
|
439
|
+
this.type = "access_policy_denied";
|
|
440
|
+
this.policyIds = policyIds;
|
|
441
|
+
this.removedModels = removedModels;
|
|
442
|
+
this.removedProviders = removedProviders;
|
|
443
|
+
}
|
|
411
444
|
static isInstance(error) {
|
|
412
445
|
return GatewayError.hasMarker(error) && symbol$2 in error;
|
|
413
446
|
}
|
|
@@ -526,6 +559,22 @@ async function createGatewayErrorFromResponse({ response, statusCode, defaultMes
|
|
|
526
559
|
ruleId: ruleResult.success ? ruleResult.value.ruleId : void 0
|
|
527
560
|
});
|
|
528
561
|
}
|
|
562
|
+
case "access_policy_denied": {
|
|
563
|
+
const paramResult = await safeValidateTypes({
|
|
564
|
+
value: validatedResponse.error.param,
|
|
565
|
+
schema: accessPolicyDeniedParamSchema
|
|
566
|
+
});
|
|
567
|
+
const param = paramResult.success ? paramResult.value : void 0;
|
|
568
|
+
return new GatewayAccessPolicyDeniedError({
|
|
569
|
+
message,
|
|
570
|
+
statusCode,
|
|
571
|
+
cause,
|
|
572
|
+
generationId,
|
|
573
|
+
policyIds: param?.policyIds,
|
|
574
|
+
removedModels: param?.removedModels,
|
|
575
|
+
removedProviders: param?.removedProviders
|
|
576
|
+
});
|
|
577
|
+
}
|
|
529
578
|
default: return new GatewayInternalServerError({
|
|
530
579
|
message,
|
|
531
580
|
statusCode,
|
|
@@ -3410,7 +3459,7 @@ async function getVercelRequestId() {
|
|
|
3410
3459
|
}
|
|
3411
3460
|
//#endregion
|
|
3412
3461
|
//#region src/version.ts
|
|
3413
|
-
const VERSION = "4.0.
|
|
3462
|
+
const VERSION = "4.0.147";
|
|
3414
3463
|
//#endregion
|
|
3415
3464
|
//#region src/gateway-provider.ts
|
|
3416
3465
|
const AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
|
|
@@ -3761,6 +3810,6 @@ function assertGatewayClientSecretServerEnvironment() {
|
|
|
3761
3810
|
if (typeof globalThis.window !== "undefined") throw new Error("AI Gateway client secrets must be minted server-side: minting needs your Gateway credential, which must never reach the browser. Call gateway.experimental_realtime.getToken(), gateway.experimental_transcription.getToken(), or gateway.experimental_speech.getToken() from your server and pass the returned token to the client.");
|
|
3762
3811
|
}
|
|
3763
3812
|
//#endregion
|
|
3764
|
-
export { GATEWAY_AUTH_SUBPROTOCOL_PREFIX, GATEWAY_REALTIME_SUBPROTOCOL, GATEWAY_SPEECH_SUBPROTOCOL, GATEWAY_TEAM_SUBPROTOCOL_PREFIX, GATEWAY_TRANSCRIPTION_SUBPROTOCOL, GatewayAuthenticationError, GatewayError, GatewayFailedDependencyError, GatewayForbiddenError, GatewayInternalServerError, GatewayInvalidRequestError, GatewayModelNotFoundError, GatewayNotFoundError, GatewayRateLimitError, GatewayResponseError, VERSION, createGateway, createGateway as createGatewayProvider, gateway, getGatewayRealtimeAuthToken, getGatewayRealtimeProtocols, getGatewayRealtimeTeamIdOrSlug, getGatewaySpeechProtocols, getGatewayTranscriptionProtocols };
|
|
3813
|
+
export { GATEWAY_AUTH_SUBPROTOCOL_PREFIX, GATEWAY_REALTIME_SUBPROTOCOL, GATEWAY_SPEECH_SUBPROTOCOL, GATEWAY_TEAM_SUBPROTOCOL_PREFIX, GATEWAY_TRANSCRIPTION_SUBPROTOCOL, GatewayAccessPolicyDeniedError, GatewayAuthenticationError, GatewayError, GatewayFailedDependencyError, GatewayForbiddenError, GatewayInternalServerError, GatewayInvalidRequestError, GatewayModelNotFoundError, GatewayNotFoundError, GatewayRateLimitError, GatewayResponseError, VERSION, createGateway, createGateway as createGatewayProvider, gateway, getGatewayRealtimeAuthToken, getGatewayRealtimeProtocols, getGatewayRealtimeTeamIdOrSlug, getGatewaySpeechProtocols, getGatewayTranscriptionProtocols };
|
|
3765
3814
|
|
|
3766
3815
|
//# sourceMappingURL=index.js.map
|