@ai-sdk/gateway 4.0.49 → 4.0.51
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.ts +2 -2
- package/dist/index.js +75 -20
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/gateway-embedding-model.ts +2 -1
- package/src/gateway-fetch-metadata.ts +3 -2
- package/src/gateway-generation-info.ts +2 -1
- package/src/gateway-image-model-settings.ts +1 -1
- package/src/gateway-image-model.ts +3 -2
- package/src/gateway-language-model-settings.ts +2 -0
- package/src/gateway-language-model.ts +3 -2
- package/src/gateway-provider.ts +2 -1
- package/src/gateway-reranking-model.ts +2 -1
- package/src/gateway-speech-model.ts +2 -1
- package/src/gateway-spend-report.ts +2 -1
- package/src/gateway-transcription-model.ts +1 -1
- package/src/gateway-video-model.ts +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @ai-sdk/gateway
|
|
2
2
|
|
|
3
|
+
## 4.0.51
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ea75787: Serialize structured Gateway error responses in nested API call error messages.
|
|
8
|
+
- b20de9e: chore(provider/gateway): update gateway model settings files
|
|
9
|
+
|
|
10
|
+
## 4.0.50
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- a4d386d: feat(xai): add the Grok 4.6 model IDs and support its `xhigh` reasoning effort
|
|
15
|
+
|
|
3
16
|
## 4.0.49
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ import { FetchFunction, WebSocketConstructor, InferSchema } from '@ai-sdk/provid
|
|
|
4
4
|
|
|
5
5
|
type GatewayEmbeddingModelId = 'alibaba/qwen3-embedding-0.6b' | 'alibaba/qwen3-embedding-4b' | 'alibaba/qwen3-embedding-8b' | 'amazon/titan-embed-text-v2' | 'cohere/embed-v4.0' | 'google/gemini-embedding-001' | 'google/gemini-embedding-2' | 'google/text-embedding-005' | 'google/text-multilingual-embedding-002' | 'mistral/codestral-embed' | 'mistral/mistral-embed' | 'openai/text-embedding-3-large' | 'openai/text-embedding-3-small' | 'openai/text-embedding-ada-002' | 'perplexity/pplx-embed-v1-0.6b' | 'perplexity/pplx-embed-v1-4b' | 'voyage/voyage-3-large' | 'voyage/voyage-3.5' | 'voyage/voyage-3.5-lite' | 'voyage/voyage-4' | 'voyage/voyage-4-large' | 'voyage/voyage-4-lite' | 'voyage/voyage-code-2' | 'voyage/voyage-code-3' | 'voyage/voyage-finance-2' | 'voyage/voyage-law-2' | (string & {});
|
|
6
6
|
|
|
7
|
-
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-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' | 'google/imagen-4.0-fast-generate-001' | 'google/imagen-4.0-generate-001' | 'google/imagen-4.0-ultra-generate-001' | 'openai/gpt-image-1' | 'openai/gpt-image-1-mini' | 'openai/gpt-image-1.5' | 'openai/gpt-image-2' | 'prodia/flux-fast-schnell' | 'quiverai/arrow-1.1' | 'recraft/recraft-v2' | 'recraft/recraft-v3' | 'recraft/recraft-v4' | 'recraft/recraft-v4-pro' | 'recraft/recraft-v4.1' | 'recraft/recraft-v4.1-pro' | 'recraft/recraft-v4.1-utility' | 'recraft/recraft-v4.1-utility-pro' | 'xai/grok-imagine-image' | 'xai/grok-imagine-image-2.0
|
|
7
|
+
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-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' | 'google/imagen-4.0-fast-generate-001' | 'google/imagen-4.0-generate-001' | 'google/imagen-4.0-ultra-generate-001' | 'openai/gpt-image-1' | 'openai/gpt-image-1-mini' | 'openai/gpt-image-1.5' | 'openai/gpt-image-2' | 'prodia/flux-fast-schnell' | 'quiverai/arrow-1.1' | 'recraft/recraft-v2' | 'recraft/recraft-v3' | 'recraft/recraft-v4' | 'recraft/recraft-v4-pro' | 'recraft/recraft-v4.1' | 'recraft/recraft-v4.1-pro' | 'recraft/recraft-v4.1-utility' | 'recraft/recraft-v4.1-utility-pro' | 'xai/grok-imagine-image' | 'xai/grok-imagine-image-2.0' | (string & {});
|
|
8
8
|
|
|
9
|
-
type GatewayModelId = 'alibaba/qwen-3-14b' | 'alibaba/qwen-3-235b' | 'alibaba/qwen-3-30b' | 'alibaba/qwen-3-32b' | 'alibaba/qwen-3.6-max-preview' | 'alibaba/qwen3-235b-a22b-thinking' | 'alibaba/qwen3-coder' | 'alibaba/qwen3-coder-30b-a3b' | 'alibaba/qwen3-coder-next' | 'alibaba/qwen3-coder-plus' | 'alibaba/qwen3-max' | 'alibaba/qwen3-max-preview' | 'alibaba/qwen3-max-thinking' | 'alibaba/qwen3-next-80b-a3b-instruct' | 'alibaba/qwen3-next-80b-a3b-thinking' | 'alibaba/qwen3-vl-235b-a22b-instruct' | 'alibaba/qwen3-vl-instruct' | 'alibaba/qwen3-vl-thinking' | 'alibaba/qwen3.5-flash' | 'alibaba/qwen3.5-plus' | 'alibaba/qwen3.6-27b' | 'alibaba/qwen3.6-plus' | 'alibaba/qwen3.7-flash' | 'alibaba/qwen3.7-max' | 'alibaba/qwen3.7-plus' | 'alibaba/qwen3.8-max' | 'amazon/nova-2-lite' | 'amazon/nova-lite' | 'amazon/nova-micro' | 'amazon/nova-pro' | 'anthropic/claude-3-haiku' | 'anthropic/claude-fable-5' | 'anthropic/claude-haiku-4.5' | 'anthropic/claude-opus-4' | 'anthropic/claude-opus-4.5' | 'anthropic/claude-opus-4.6' | 'anthropic/claude-opus-4.7' | 'anthropic/claude-opus-4.8' | 'anthropic/claude-opus-4.8-fast' | 'anthropic/claude-opus-5' | 'anthropic/claude-opus-5-fast' | 'anthropic/claude-sonnet-4' | 'anthropic/claude-sonnet-4.5' | 'anthropic/claude-sonnet-4.6' | 'anthropic/claude-sonnet-5' | 'arcee-ai/trinity-large-thinking' | 'arcee-ai/trinity-mini' | 'bytedance/seed-1.6' | 'bytedance/seed-1.8' | 'cohere/command-a' | 'deepseek/deepseek-r1' | 'deepseek/deepseek-v3' | 'deepseek/deepseek-v3.1' | 'deepseek/deepseek-v3.1-terminus' | 'deepseek/deepseek-v3.2' | 'deepseek/deepseek-v3.2-thinking' | 'deepseek/deepseek-v4-flash' | 'deepseek/deepseek-v4-flash-0731' | 'deepseek/deepseek-v4-pro' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-flash-image' | 'google/gemini-2.5-flash-lite' | 'google/gemini-2.5-pro' | 'google/gemini-3-flash' | 'google/gemini-3-pro-image' | 'google/gemini-3.1-flash-image' | 'google/gemini-3.1-flash-image-preview' | 'google/gemini-3.1-flash-lite' | 'google/gemini-3.1-flash-lite-image' | 'google/gemini-3.1-pro-preview' | 'google/gemini-3.5-flash' | 'google/gemini-3.5-flash-lite' | 'google/gemini-3.6-flash' | 'google/gemini-omni-flash-preview' | 'google/gemma-4-26b-a4b-it' | 'google/gemma-4-31b-it' | 'inception/mercury-2' | 'inception/mercury-coder-small' | 'inclusionai/ling-3.0-flash' | 'inclusionai/ling-3.0-tiny-free' | 'interfaze/interfaze-beta' | 'kwaipilot/kat-coder-air-v2.5' | 'kwaipilot/kat-coder-pro-v1' | 'kwaipilot/kat-coder-pro-v2' | 'kwaipilot/kat-coder-pro-v2.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-glimmer-30b' | 'meta/muse-spark-1.1' | 'meta/muse-spark-1.2' | 'meta/muse-spark-1.2-contributor' | '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' | 'mistral/codestral' | 'mistral/devstral-2' | 'mistral/devstral-small-2' | 'mistral/magistral-medium' | 'mistral/magistral-small' | 'mistral/ministral-14b' | 'mistral/ministral-3b' | 'mistral/ministral-8b' | 'mistral/mistral-large-3' | 'mistral/mistral-medium' | 'mistral/mistral-medium-3.5' | 'mistral/mistral-nemo' | 'mistral/mistral-small' | 'mistral/pixtral-12b' | 'moonshotai/kimi-k2' | 'moonshotai/kimi-k2-thinking' | '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' | 'morph/morph-v3-fast' | 'morph/morph-v3-large' | 'nvidia/nemotron-3-nano-30b-a3b' | 'nvidia/nemotron-3-super-120b-a12b' | 'nvidia/nemotron-3-ultra-550b-a55b' | 'nvidia/nemotron-nano-12b-v2-vl' | 'nvidia/nemotron-nano-9b-v2' | 'openai/gpt-3.5-turbo' | 'openai/gpt-4-turbo' | 'openai/gpt-4.1' | 'openai/gpt-4.1-mini' | 'openai/gpt-4.1-nano' | 'openai/gpt-4o' | 'openai/gpt-4o-mini' | 'openai/gpt-4o-mini-search-preview' | 'openai/gpt-5' | 'openai/gpt-5-codex' | 'openai/gpt-5-mini' | 'openai/gpt-5-nano' | 'openai/gpt-5-pro' | '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.2' | 'openai/gpt-5.2-codex' | 'openai/gpt-5.2-pro' | 'openai/gpt-5.3-codex' | 'openai/gpt-5.4' | 'openai/gpt-5.4-mini' | 'openai/gpt-5.4-nano' | 'openai/gpt-5.4-pro' | 'openai/gpt-5.5' | 'openai/gpt-5.5-pro' | 'openai/gpt-5.6-luna' | 'openai/gpt-5.6-sol' | 'openai/gpt-5.6-terra' | 'openai/gpt-oss-120b' | 'openai/gpt-oss-20b' | 'openai/gpt-oss-safeguard-20b' | 'openai/o1' | 'openai/o3' | 'openai/o3-deep-research' | 'openai/o3-mini' | 'openai/o3-pro' | 'openai/o4-mini' | 'perplexity/sonar' | 'perplexity/sonar-pro' | 'perplexity/sonar-reasoning-pro' | 'poolside/laguna-s-2.1' | 'poolside/laguna-s-2.1-free' | 'sakana/fugu-ultra' | 'sakana/namazu' | 'stepfun/step-3.5-flash' | 'stepfun/step-3.7-flash' | 'tencent/hy3' | 'thinkingmachines/inkling' | 'thinkingmachines/inkling-small' | 'xai/grok-4.1-fast-non-reasoning' | 'xai/grok-4.1-fast-reasoning' | 'xai/grok-4.20-multi-agent' | 'xai/grok-4.20-multi-agent-beta' | 'xai/grok-4.20-non-reasoning' | 'xai/grok-4.20-non-reasoning-beta' | 'xai/grok-4.20-reasoning' | 'xai/grok-4.20-reasoning-beta' | 'xai/grok-4.3' | 'xai/grok-4.5' | 'xai/grok-build-0.1' | 'xiaomi/mimo-v2.5' | 'xiaomi/mimo-v2.5-pro' | 'zai/glm-4.5' | 'zai/glm-4.5-air' | 'zai/glm-4.5v' | 'zai/glm-4.6' | 'zai/glm-4.6v' | 'zai/glm-4.6v-flash' | '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-5v-turbo' | (string & {});
|
|
9
|
+
type GatewayModelId = 'alibaba/qwen-3-14b' | 'alibaba/qwen-3-235b' | 'alibaba/qwen-3-30b' | 'alibaba/qwen-3-32b' | 'alibaba/qwen-3.6-max-preview' | 'alibaba/qwen3-235b-a22b-thinking' | 'alibaba/qwen3-coder' | 'alibaba/qwen3-coder-30b-a3b' | 'alibaba/qwen3-coder-next' | 'alibaba/qwen3-coder-plus' | 'alibaba/qwen3-max' | 'alibaba/qwen3-max-preview' | 'alibaba/qwen3-max-thinking' | 'alibaba/qwen3-next-80b-a3b-instruct' | 'alibaba/qwen3-next-80b-a3b-thinking' | 'alibaba/qwen3-vl-235b-a22b-instruct' | 'alibaba/qwen3-vl-instruct' | 'alibaba/qwen3-vl-thinking' | 'alibaba/qwen3.5-flash' | 'alibaba/qwen3.5-plus' | 'alibaba/qwen3.6-27b' | 'alibaba/qwen3.6-plus' | 'alibaba/qwen3.7-flash' | 'alibaba/qwen3.7-max' | 'alibaba/qwen3.7-plus' | 'alibaba/qwen3.8-max' | 'amazon/nova-2-lite' | 'amazon/nova-lite' | 'amazon/nova-micro' | 'amazon/nova-pro' | 'anthropic/claude-3-haiku' | 'anthropic/claude-fable-5' | 'anthropic/claude-haiku-4.5' | 'anthropic/claude-opus-4' | 'anthropic/claude-opus-4.5' | 'anthropic/claude-opus-4.6' | 'anthropic/claude-opus-4.7' | 'anthropic/claude-opus-4.8' | 'anthropic/claude-opus-4.8-fast' | 'anthropic/claude-opus-5' | 'anthropic/claude-opus-5-fast' | 'anthropic/claude-sonnet-4' | 'anthropic/claude-sonnet-4.5' | 'anthropic/claude-sonnet-4.6' | 'anthropic/claude-sonnet-5' | 'arcee-ai/trinity-large-thinking' | 'arcee-ai/trinity-mini' | 'bytedance/seed-1.6' | 'bytedance/seed-1.8' | 'cohere/command-a' | 'deepseek/deepseek-r1' | 'deepseek/deepseek-v3' | 'deepseek/deepseek-v3.1' | 'deepseek/deepseek-v3.1-terminus' | 'deepseek/deepseek-v3.2' | 'deepseek/deepseek-v3.2-thinking' | 'deepseek/deepseek-v4-flash' | 'deepseek/deepseek-v4-flash-0731' | 'deepseek/deepseek-v4-pro' | 'deepseek/deepseek-v4-pro-0813' | 'google/gemini-2.5-flash' | 'google/gemini-2.5-flash-image' | 'google/gemini-2.5-flash-lite' | 'google/gemini-2.5-pro' | 'google/gemini-3-flash' | 'google/gemini-3-pro-image' | 'google/gemini-3.1-flash-image' | 'google/gemini-3.1-flash-image-preview' | 'google/gemini-3.1-flash-lite' | 'google/gemini-3.1-flash-lite-image' | 'google/gemini-3.1-pro-preview' | 'google/gemini-3.5-flash' | 'google/gemini-3.5-flash-lite' | 'google/gemini-3.6-flash' | 'google/gemini-omni-flash-preview' | 'google/gemma-4-26b-a4b-it' | 'google/gemma-4-31b-it' | 'inception/mercury-2' | 'inception/mercury-coder-small' | 'inclusionai/ling-3.0-flash' | 'inclusionai/ling-3.0-tiny-free' | 'interfaze/interfaze-beta' | 'kwaipilot/kat-coder-air-v2.5' | 'kwaipilot/kat-coder-pro-v1' | 'kwaipilot/kat-coder-pro-v2' | 'kwaipilot/kat-coder-pro-v2.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-glimmer-30b' | 'meta/muse-spark-1.1' | 'meta/muse-spark-1.2' | 'meta/muse-spark-1.2-contributor' | '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' | 'mistral/codestral' | 'mistral/devstral-2' | 'mistral/devstral-small-2' | 'mistral/magistral-medium' | 'mistral/magistral-small' | 'mistral/ministral-14b' | 'mistral/ministral-3b' | 'mistral/ministral-8b' | 'mistral/mistral-large-3' | 'mistral/mistral-medium' | 'mistral/mistral-medium-3.5' | 'mistral/mistral-nemo' | 'mistral/mistral-small' | 'mistral/pixtral-12b' | 'moonshotai/kimi-k2' | 'moonshotai/kimi-k2-thinking' | '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' | 'morph/morph-v3-fast' | 'morph/morph-v3-large' | 'nvidia/nemotron-3-nano-30b-a3b' | 'nvidia/nemotron-3-super-120b-a12b' | 'nvidia/nemotron-3-ultra-550b-a55b' | 'nvidia/nemotron-nano-12b-v2-vl' | 'nvidia/nemotron-nano-9b-v2' | 'openai/gpt-3.5-turbo' | 'openai/gpt-4-turbo' | 'openai/gpt-4.1' | 'openai/gpt-4.1-mini' | 'openai/gpt-4.1-nano' | 'openai/gpt-4o' | 'openai/gpt-4o-mini' | 'openai/gpt-4o-mini-search-preview' | 'openai/gpt-5' | 'openai/gpt-5-codex' | 'openai/gpt-5-mini' | 'openai/gpt-5-nano' | 'openai/gpt-5-pro' | '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.2' | 'openai/gpt-5.2-codex' | 'openai/gpt-5.2-pro' | 'openai/gpt-5.3-codex' | 'openai/gpt-5.4' | 'openai/gpt-5.4-mini' | 'openai/gpt-5.4-nano' | 'openai/gpt-5.4-pro' | 'openai/gpt-5.5' | 'openai/gpt-5.5-pro' | 'openai/gpt-5.6-luna' | 'openai/gpt-5.6-sol' | 'openai/gpt-5.6-terra' | 'openai/gpt-oss-120b' | 'openai/gpt-oss-20b' | 'openai/gpt-oss-safeguard-20b' | 'openai/o1' | 'openai/o3' | 'openai/o3-deep-research' | 'openai/o3-mini' | 'openai/o3-pro' | 'openai/o4-mini' | 'perplexity/sonar' | 'perplexity/sonar-pro' | 'perplexity/sonar-reasoning-pro' | 'poolside/laguna-s-2.1' | 'poolside/laguna-s-2.1-free' | 'sakana/fugu-ultra' | 'sakana/namazu' | 'stepfun/step-3.5-flash' | 'stepfun/step-3.7-flash' | 'tencent/hy3' | 'thinkingmachines/inkling' | 'thinkingmachines/inkling-small' | 'xai/grok-4.1-fast-non-reasoning' | 'xai/grok-4.1-fast-reasoning' | 'xai/grok-4.20-multi-agent' | 'xai/grok-4.20-multi-agent-beta' | 'xai/grok-4.20-non-reasoning' | 'xai/grok-4.20-non-reasoning-beta' | 'xai/grok-4.20-reasoning' | 'xai/grok-4.20-reasoning-beta' | 'xai/grok-4.3' | 'xai/grok-4.5' | 'xai/grok-4.6' | 'xai/grok-build-0.1' | 'xiaomi/mimo-v2.5' | 'xiaomi/mimo-v2.5-pro' | 'zai/glm-4.5' | 'zai/glm-4.5-air' | 'zai/glm-4.5v' | 'zai/glm-4.6' | 'zai/glm-4.6v' | 'zai/glm-4.6v-flash' | '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-5v-turbo' | (string & {});
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Shared WebSocket subprotocol contract for AI Gateway realtime and streaming
|
package/dist/index.js
CHANGED
|
@@ -64,6 +64,7 @@ function decodeSubprotocolValue(value) {
|
|
|
64
64
|
import {
|
|
65
65
|
createJsonErrorResponseHandler as createJsonErrorResponseHandler11,
|
|
66
66
|
createJsonResponseHandler as createJsonResponseHandler11,
|
|
67
|
+
getErrorMessage as getErrorMessage11,
|
|
67
68
|
loadOptionalSetting,
|
|
68
69
|
postJsonToApi as postJsonToApi8,
|
|
69
70
|
withoutTrailingSlash,
|
|
@@ -644,6 +645,7 @@ var gatewayAuthMethodSchema = lazySchema4(
|
|
|
644
645
|
import {
|
|
645
646
|
createJsonErrorResponseHandler,
|
|
646
647
|
createJsonResponseHandler,
|
|
648
|
+
getErrorMessage,
|
|
647
649
|
getFromApi,
|
|
648
650
|
lazySchema as lazySchema5,
|
|
649
651
|
resolve,
|
|
@@ -678,7 +680,10 @@ var GatewayFetchMetadata = class {
|
|
|
678
680
|
),
|
|
679
681
|
failedResponseHandler: createJsonErrorResponseHandler({
|
|
680
682
|
errorSchema: z.any(),
|
|
681
|
-
errorToMessage: (data) =>
|
|
683
|
+
errorToMessage: (data) => {
|
|
684
|
+
var _a11;
|
|
685
|
+
return (_a11 = getErrorMessage(data)) != null ? _a11 : "unknown error";
|
|
686
|
+
}
|
|
682
687
|
}),
|
|
683
688
|
fetch: this.config.fetch
|
|
684
689
|
});
|
|
@@ -699,7 +704,10 @@ var GatewayFetchMetadata = class {
|
|
|
699
704
|
),
|
|
700
705
|
failedResponseHandler: createJsonErrorResponseHandler({
|
|
701
706
|
errorSchema: z.any(),
|
|
702
|
-
errorToMessage: (data) =>
|
|
707
|
+
errorToMessage: (data) => {
|
|
708
|
+
var _a11;
|
|
709
|
+
return (_a11 = getErrorMessage(data)) != null ? _a11 : "unknown error";
|
|
710
|
+
}
|
|
703
711
|
}),
|
|
704
712
|
fetch: this.config.fetch
|
|
705
713
|
});
|
|
@@ -761,6 +769,7 @@ var gatewayCreditsResponseSchema = lazySchema5(
|
|
|
761
769
|
import {
|
|
762
770
|
createJsonErrorResponseHandler as createJsonErrorResponseHandler2,
|
|
763
771
|
createJsonResponseHandler as createJsonResponseHandler2,
|
|
772
|
+
getErrorMessage as getErrorMessage2,
|
|
764
773
|
getFromApi as getFromApi2,
|
|
765
774
|
lazySchema as lazySchema6,
|
|
766
775
|
resolve as resolve2,
|
|
@@ -806,7 +815,10 @@ var GatewaySpendReport = class {
|
|
|
806
815
|
),
|
|
807
816
|
failedResponseHandler: createJsonErrorResponseHandler2({
|
|
808
817
|
errorSchema: z.any(),
|
|
809
|
-
errorToMessage: (data) =>
|
|
818
|
+
errorToMessage: (data) => {
|
|
819
|
+
var _a11;
|
|
820
|
+
return (_a11 = getErrorMessage2(data)) != null ? _a11 : "unknown error";
|
|
821
|
+
}
|
|
810
822
|
}),
|
|
811
823
|
fetch: this.config.fetch
|
|
812
824
|
});
|
|
@@ -870,6 +882,7 @@ var gatewaySpendReportResponseSchema = lazySchema6(
|
|
|
870
882
|
import {
|
|
871
883
|
createJsonErrorResponseHandler as createJsonErrorResponseHandler3,
|
|
872
884
|
createJsonResponseHandler as createJsonResponseHandler3,
|
|
885
|
+
getErrorMessage as getErrorMessage3,
|
|
873
886
|
getFromApi as getFromApi3,
|
|
874
887
|
lazySchema as lazySchema7,
|
|
875
888
|
resolve as resolve3,
|
|
@@ -891,7 +904,10 @@ var GatewayGenerationInfoFetcher = class {
|
|
|
891
904
|
),
|
|
892
905
|
failedResponseHandler: createJsonErrorResponseHandler3({
|
|
893
906
|
errorSchema: z.any(),
|
|
894
|
-
errorToMessage: (data) =>
|
|
907
|
+
errorToMessage: (data) => {
|
|
908
|
+
var _a11;
|
|
909
|
+
return (_a11 = getErrorMessage3(data)) != null ? _a11 : "unknown error";
|
|
910
|
+
}
|
|
895
911
|
}),
|
|
896
912
|
fetch: this.config.fetch
|
|
897
913
|
});
|
|
@@ -966,6 +982,7 @@ import {
|
|
|
966
982
|
createEventSourceResponseHandler,
|
|
967
983
|
createJsonErrorResponseHandler as createJsonErrorResponseHandler4,
|
|
968
984
|
createJsonResponseHandler as createJsonResponseHandler4,
|
|
985
|
+
getErrorMessage as getErrorMessage4,
|
|
969
986
|
postJsonToApi,
|
|
970
987
|
resolve as resolve4,
|
|
971
988
|
serializeModelOptions,
|
|
@@ -1019,7 +1036,10 @@ var GatewayLanguageModel = class _GatewayLanguageModel {
|
|
|
1019
1036
|
successfulResponseHandler: createJsonResponseHandler4(z.any()),
|
|
1020
1037
|
failedResponseHandler: createJsonErrorResponseHandler4({
|
|
1021
1038
|
errorSchema: z.any(),
|
|
1022
|
-
errorToMessage: (data) =>
|
|
1039
|
+
errorToMessage: (data) => {
|
|
1040
|
+
var _a11;
|
|
1041
|
+
return (_a11 = getErrorMessage4(data)) != null ? _a11 : "unknown error";
|
|
1042
|
+
}
|
|
1023
1043
|
}),
|
|
1024
1044
|
...abortSignal && { abortSignal },
|
|
1025
1045
|
fetch: this.config.fetch
|
|
@@ -1054,7 +1074,10 @@ var GatewayLanguageModel = class _GatewayLanguageModel {
|
|
|
1054
1074
|
successfulResponseHandler: createEventSourceResponseHandler(z.any()),
|
|
1055
1075
|
failedResponseHandler: createJsonErrorResponseHandler4({
|
|
1056
1076
|
errorSchema: z.any(),
|
|
1057
|
-
errorToMessage: (data) =>
|
|
1077
|
+
errorToMessage: (data) => {
|
|
1078
|
+
var _a11;
|
|
1079
|
+
return (_a11 = getErrorMessage4(data)) != null ? _a11 : "unknown error";
|
|
1080
|
+
}
|
|
1058
1081
|
}),
|
|
1059
1082
|
...abortSignal && { abortSignal },
|
|
1060
1083
|
fetch: this.config.fetch
|
|
@@ -1145,6 +1168,7 @@ import {
|
|
|
1145
1168
|
combineHeaders as combineHeaders2,
|
|
1146
1169
|
createJsonErrorResponseHandler as createJsonErrorResponseHandler5,
|
|
1147
1170
|
createJsonResponseHandler as createJsonResponseHandler5,
|
|
1171
|
+
getErrorMessage as getErrorMessage5,
|
|
1148
1172
|
lazySchema as lazySchema8,
|
|
1149
1173
|
postJsonToApi as postJsonToApi2,
|
|
1150
1174
|
resolve as resolve5,
|
|
@@ -1203,7 +1227,10 @@ var GatewayEmbeddingModel = class _GatewayEmbeddingModel {
|
|
|
1203
1227
|
),
|
|
1204
1228
|
failedResponseHandler: createJsonErrorResponseHandler5({
|
|
1205
1229
|
errorSchema: z.any(),
|
|
1206
|
-
errorToMessage: (data) =>
|
|
1230
|
+
errorToMessage: (data) => {
|
|
1231
|
+
var _a12;
|
|
1232
|
+
return (_a12 = getErrorMessage5(data)) != null ? _a12 : "unknown error";
|
|
1233
|
+
}
|
|
1207
1234
|
}),
|
|
1208
1235
|
...abortSignal && { abortSignal },
|
|
1209
1236
|
fetch: this.config.fetch
|
|
@@ -1268,8 +1295,9 @@ var gatewayEmbeddingResponseSchema = lazySchema8(
|
|
|
1268
1295
|
import {
|
|
1269
1296
|
combineHeaders as combineHeaders3,
|
|
1270
1297
|
convertUint8ArrayToBase64,
|
|
1271
|
-
createJsonResponseHandler as createJsonResponseHandler6,
|
|
1272
1298
|
createJsonErrorResponseHandler as createJsonErrorResponseHandler6,
|
|
1299
|
+
createJsonResponseHandler as createJsonResponseHandler6,
|
|
1300
|
+
getErrorMessage as getErrorMessage6,
|
|
1273
1301
|
postJsonToApi as postJsonToApi3,
|
|
1274
1302
|
resolve as resolve6,
|
|
1275
1303
|
serializeModelOptions as serializeModelOptions3,
|
|
@@ -1336,7 +1364,10 @@ var GatewayImageModel = class _GatewayImageModel {
|
|
|
1336
1364
|
),
|
|
1337
1365
|
failedResponseHandler: createJsonErrorResponseHandler6({
|
|
1338
1366
|
errorSchema: z.any(),
|
|
1339
|
-
errorToMessage: (data) =>
|
|
1367
|
+
errorToMessage: (data) => {
|
|
1368
|
+
var _a12;
|
|
1369
|
+
return (_a12 = getErrorMessage6(data)) != null ? _a12 : "unknown error";
|
|
1370
|
+
}
|
|
1340
1371
|
}),
|
|
1341
1372
|
...abortSignal && { abortSignal },
|
|
1342
1373
|
fetch: this.config.fetch
|
|
@@ -1424,7 +1455,8 @@ var gatewayImageResponseSchema = z.object({
|
|
|
1424
1455
|
|
|
1425
1456
|
// src/gateway-video-model.ts
|
|
1426
1457
|
import {
|
|
1427
|
-
APICallError as APICallError2
|
|
1458
|
+
APICallError as APICallError2,
|
|
1459
|
+
getErrorMessage as getErrorMessage7
|
|
1428
1460
|
} from "@ai-sdk/provider";
|
|
1429
1461
|
import {
|
|
1430
1462
|
combineHeaders as combineHeaders4,
|
|
@@ -1527,7 +1559,10 @@ var GatewayVideoModel = class {
|
|
|
1527
1559
|
},
|
|
1528
1560
|
failedResponseHandler: createJsonErrorResponseHandler7({
|
|
1529
1561
|
errorSchema: z.any(),
|
|
1530
|
-
errorToMessage: (data) =>
|
|
1562
|
+
errorToMessage: (data) => {
|
|
1563
|
+
var _a12;
|
|
1564
|
+
return (_a12 = getErrorMessage7(data)) != null ? _a12 : "unknown error";
|
|
1565
|
+
}
|
|
1531
1566
|
}),
|
|
1532
1567
|
...abortSignal && { abortSignal },
|
|
1533
1568
|
fetch: this.config.fetch
|
|
@@ -1582,7 +1617,10 @@ var GatewayVideoModel = class {
|
|
|
1582
1617
|
),
|
|
1583
1618
|
failedResponseHandler: createJsonErrorResponseHandler7({
|
|
1584
1619
|
errorSchema: z.any(),
|
|
1585
|
-
errorToMessage: (data) =>
|
|
1620
|
+
errorToMessage: (data) => {
|
|
1621
|
+
var _a12;
|
|
1622
|
+
return (_a12 = getErrorMessage7(data)) != null ? _a12 : "unknown error";
|
|
1623
|
+
}
|
|
1586
1624
|
}),
|
|
1587
1625
|
...abortSignal && { abortSignal },
|
|
1588
1626
|
fetch: this.config.fetch
|
|
@@ -1626,7 +1664,10 @@ var GatewayVideoModel = class {
|
|
|
1626
1664
|
),
|
|
1627
1665
|
failedResponseHandler: createJsonErrorResponseHandler7({
|
|
1628
1666
|
errorSchema: z.any(),
|
|
1629
|
-
errorToMessage: (data) =>
|
|
1667
|
+
errorToMessage: (data) => {
|
|
1668
|
+
var _a12;
|
|
1669
|
+
return (_a12 = getErrorMessage7(data)) != null ? _a12 : "unknown error";
|
|
1670
|
+
}
|
|
1630
1671
|
}),
|
|
1631
1672
|
...abortSignal && { abortSignal },
|
|
1632
1673
|
fetch: this.config.fetch
|
|
@@ -1821,6 +1862,7 @@ import {
|
|
|
1821
1862
|
combineHeaders as combineHeaders5,
|
|
1822
1863
|
createJsonErrorResponseHandler as createJsonErrorResponseHandler8,
|
|
1823
1864
|
createJsonResponseHandler as createJsonResponseHandler8,
|
|
1865
|
+
getErrorMessage as getErrorMessage8,
|
|
1824
1866
|
lazySchema as lazySchema9,
|
|
1825
1867
|
postJsonToApi as postJsonToApi5,
|
|
1826
1868
|
resolve as resolve8,
|
|
@@ -1869,7 +1911,10 @@ var GatewayRerankingModel = class {
|
|
|
1869
1911
|
),
|
|
1870
1912
|
failedResponseHandler: createJsonErrorResponseHandler8({
|
|
1871
1913
|
errorSchema: z.any(),
|
|
1872
|
-
errorToMessage: (data) =>
|
|
1914
|
+
errorToMessage: (data) => {
|
|
1915
|
+
var _a12;
|
|
1916
|
+
return (_a12 = getErrorMessage8(data)) != null ? _a12 : "unknown error";
|
|
1917
|
+
}
|
|
1873
1918
|
}),
|
|
1874
1919
|
...abortSignal && { abortSignal },
|
|
1875
1920
|
fetch: this.config.fetch
|
|
@@ -1938,6 +1983,7 @@ import {
|
|
|
1938
1983
|
combineHeaders as combineHeaders6,
|
|
1939
1984
|
createJsonErrorResponseHandler as createJsonErrorResponseHandler9,
|
|
1940
1985
|
createJsonResponseHandler as createJsonResponseHandler9,
|
|
1986
|
+
getErrorMessage as getErrorMessage9,
|
|
1941
1987
|
postJsonToApi as postJsonToApi6,
|
|
1942
1988
|
resolve as resolve9
|
|
1943
1989
|
} from "@ai-sdk/provider-utils";
|
|
@@ -1990,7 +2036,10 @@ var GatewaySpeechModel = class {
|
|
|
1990
2036
|
),
|
|
1991
2037
|
failedResponseHandler: createJsonErrorResponseHandler9({
|
|
1992
2038
|
errorSchema: z.any(),
|
|
1993
|
-
errorToMessage: (data) =>
|
|
2039
|
+
errorToMessage: (data) => {
|
|
2040
|
+
var _a12;
|
|
2041
|
+
return (_a12 = getErrorMessage9(data)) != null ? _a12 : "unknown error";
|
|
2042
|
+
}
|
|
1994
2043
|
}),
|
|
1995
2044
|
...abortSignal && { abortSignal },
|
|
1996
2045
|
fetch: this.config.fetch
|
|
@@ -2053,7 +2102,7 @@ var gatewaySpeechResponseSchema = z.object({
|
|
|
2053
2102
|
|
|
2054
2103
|
// src/gateway-transcription-model.ts
|
|
2055
2104
|
import {
|
|
2056
|
-
getErrorMessage
|
|
2105
|
+
getErrorMessage as getErrorMessage10
|
|
2057
2106
|
} from "@ai-sdk/provider";
|
|
2058
2107
|
import {
|
|
2059
2108
|
combineHeaders as combineHeaders7,
|
|
@@ -2111,7 +2160,10 @@ var GatewayTranscriptionModel = class {
|
|
|
2111
2160
|
),
|
|
2112
2161
|
failedResponseHandler: createJsonErrorResponseHandler10({
|
|
2113
2162
|
errorSchema: z.any(),
|
|
2114
|
-
errorToMessage: (data) =>
|
|
2163
|
+
errorToMessage: (data) => {
|
|
2164
|
+
var _a12;
|
|
2165
|
+
return (_a12 = getErrorMessage10(data)) != null ? _a12 : "unknown error";
|
|
2166
|
+
}
|
|
2115
2167
|
}),
|
|
2116
2168
|
...abortSignal && { abortSignal },
|
|
2117
2169
|
fetch: this.config.fetch
|
|
@@ -2382,7 +2434,7 @@ function getServerErrorMessage(error) {
|
|
|
2382
2434
|
if (error != null && typeof error === "object" && "message" in error && typeof error.message === "string") {
|
|
2383
2435
|
return error.message;
|
|
2384
2436
|
}
|
|
2385
|
-
return
|
|
2437
|
+
return getErrorMessage10(error);
|
|
2386
2438
|
}
|
|
2387
2439
|
var SERVER_ERROR_STATUS_CODES = {
|
|
2388
2440
|
authentication_error: 401,
|
|
@@ -2802,7 +2854,7 @@ async function getVercelRequestId() {
|
|
|
2802
2854
|
}
|
|
2803
2855
|
|
|
2804
2856
|
// src/version.ts
|
|
2805
|
-
var VERSION = true ? "4.0.
|
|
2857
|
+
var VERSION = true ? "4.0.51" : "0.0.0-test";
|
|
2806
2858
|
|
|
2807
2859
|
// src/gateway-provider.ts
|
|
2808
2860
|
var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
|
|
@@ -2872,7 +2924,10 @@ function createGateway(options = {}) {
|
|
|
2872
2924
|
),
|
|
2873
2925
|
failedResponseHandler: createJsonErrorResponseHandler11({
|
|
2874
2926
|
errorSchema: z.any(),
|
|
2875
|
-
errorToMessage: (data) =>
|
|
2927
|
+
errorToMessage: (data) => {
|
|
2928
|
+
var _a12;
|
|
2929
|
+
return (_a12 = getErrorMessage11(data)) != null ? _a12 : "unknown error";
|
|
2930
|
+
}
|
|
2876
2931
|
}),
|
|
2877
2932
|
fetch: options.fetch
|
|
2878
2933
|
});
|