@ai-sdk/gateway 4.0.91 → 4.0.94
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 +23 -0
- package/README.md +1 -1
- package/dist/index.d.ts +132 -11
- package/dist/index.js +257 -209
- package/dist/index.js.map +1 -1
- package/docs/00-ai-gateway.mdx +153 -26
- package/package.json +3 -3
- package/src/gateway-image-model-settings.ts +1 -0
- package/src/gateway-language-model-settings.ts +3 -1
- package/src/gateway-provider-options.ts +8 -6
- package/src/gateway-speech-model-settings.ts +1 -1
- package/src/gateway-tools.ts +18 -0
- package/src/tool/browserbase-fetch.ts +157 -0
- package/src/tool/browserbase-search.ts +137 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @ai-sdk/gateway
|
|
2
2
|
|
|
3
|
+
## 4.0.94
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [af9597b]
|
|
8
|
+
- Updated dependencies [bc49f78]
|
|
9
|
+
- @ai-sdk/provider-utils@5.0.49
|
|
10
|
+
|
|
11
|
+
## 4.0.93
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 80b9100: feat (provider/gateway): add Browserbase Search and Fetch tool support
|
|
16
|
+
- d3cc6ae: feat(provider/gateway): accept structured-output in the has provider option
|
|
17
|
+
- Updated dependencies [be877ff]
|
|
18
|
+
- @ai-sdk/provider-utils@5.0.48
|
|
19
|
+
|
|
20
|
+
## 4.0.92
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- 124b6ef: chore(provider/gateway): update gateway model settings files
|
|
25
|
+
|
|
3
26
|
## 4.0.91
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ import { gateway } from '@ai-sdk/gateway';
|
|
|
33
33
|
import { generateText } from 'ai';
|
|
34
34
|
|
|
35
35
|
const { text } = await generateText({
|
|
36
|
-
model: gateway('
|
|
36
|
+
model: gateway('spacexai/grok-4.7'),
|
|
37
37
|
prompt:
|
|
38
38
|
'Tell me about the history of the San Francisco Mission-style burrito.',
|
|
39
39
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -6,9 +6,9 @@ type GatewayEmbeddingModelId = 'alibaba/qwen3-embedding-0.6b' | 'alibaba/qwen3-e
|
|
|
6
6
|
|
|
7
7
|
type GatewayEvaluationModelId = 'typesafe-ai/jev' | (string & {});
|
|
8
8
|
|
|
9
|
-
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' | 'meta/muse-image-1.0' | 'openai/gpt-image-1' | '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' | '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' | 'spacexai/grok-imagine-image' | 'spacexai/grok-imagine-image-2.0' | (string & {});
|
|
9
|
+
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' | 'meta/muse-image-1.0' | 'openai/gpt-image-1' | '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' | '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-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' | (string & {});
|
|
10
10
|
|
|
11
|
-
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-2.4t-a95b' | 'alibaba/qwen3.8-27b' | 'alibaba/qwen3.8-flash' | 'alibaba/qwen3.8-max' | 'alibaba/qwen3.8-max-0902' | 'alibaba/qwen3.8-omni-flash' | 'amazon/nova-2-lite' | 'amazon/nova-lite' | 'amazon/nova-micro' | 'amazon/nova-pro' | 'anthropic/claude-3-haiku' | 'anthropic/claude-fable-5' | 'anthropic/claude-fable-5.1' | '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-opus-5.5' | 'anthropic/claude-sonnet-4' | 'anthropic/claude-sonnet-4.5' | 'anthropic/claude-sonnet-4.6' | 'anthropic/claude-sonnet-5' | 'arcee-ai/trinity-large-thinking' | 'bytedance/seed-1.6' | 'bytedance/seed-1.8' | 'bytedance/seed-2.1-turbo' | 'cohere/command-a' | 'deepseek/deepseek-r1' | '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-flash-vision-exp' | 'deepseek/deepseek-v4-pro' | 'deepseek/deepseek-v4-pro-0813' | 'deepseek/deepseek-v4.1-flash' | '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-3.7-flash' | 'google/gemini-3.8-flash' | 'google/gemini-omni-flash-preview' | 'google/gemma-4-26b-a4b-it' | 'google/gemma-4-31b-it' | 'inception/mercury-2' | 'inception/mercury-2.5' | 'inception/mercury-coder-small' | 'inclusionai/ling-3.0-flash' | 'inclusionai/ling-3.0-flash-fin' | 'inclusionai/ling-3.0-flash-fin-free' | 'inclusionai/ling-3.0-flash-sante' | 'inclusionai/ling-3.0-flash-sante-free' | 'inclusionai/ling-3.0-flash-vl' | '
|
|
11
|
+
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-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-3-haiku' | 'anthropic/claude-fable-5' | 'anthropic/claude-fable-5.1' | '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-opus-5.5' | 'anthropic/claude-opus-5.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' | 'bytedance/seed-1.6' | 'bytedance/seed-1.8' | 'bytedance/seed-2.1-turbo' | 'cohere/command-a' | 'deepseek/deepseek-r1' | '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-flash-vision-exp' | 'deepseek/deepseek-v4-pro' | 'deepseek/deepseek-v4-pro-0813' | 'deepseek/deepseek-v4.1-flash' | 'fireworks/ember-1' | '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-3.7-flash' | 'google/gemini-3.8-flash' | 'google/gemini-omni-flash-preview' | 'google/gemma-4-26b-a4b-it' | 'google/gemma-4-31b-it' | 'inception/mercury-2' | 'inception/mercury-2.5' | 'inception/mercury-coder-small' | 'inclusionai/ling-3.0-flash' | 'inclusionai/ling-3.0-flash-fin' | 'inclusionai/ling-3.0-flash-fin-free' | 'inclusionai/ling-3.0-flash-sante' | 'inclusionai/ling-3.0-flash-sante-free' | 'inclusionai/ling-3.0-flash-vl' | 'inference-net/schematron-v2-small' | 'inference-net/schematron-v2-turbo' | 'interfaze/interfaze-beta' | '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' | 'meta/muse-spark-1.3' | 'meta/muse-spark-1.3-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/ministral-14b' | 'mistral/ministral-3b' | 'mistral/ministral-8b' | 'mistral/mistral-large-3' | 'mistral/mistral-medium-3.5' | 'mistral/mistral-nemo' | 'mistral/mistral-small' | 'mixedbread/toast-1' | '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-3.5-lightning' | '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-fast' | 'openai/gpt-4.1-mini' | 'openai/gpt-4.1-mini-fast' | 'openai/gpt-4.1-nano' | 'openai/gpt-4.1-nano-fast' | 'openai/gpt-4o' | 'openai/gpt-4o-fast' | 'openai/gpt-4o-mini' | 'openai/gpt-4o-mini-fast' | 'openai/gpt-5' | 'openai/gpt-5-codex' | 'openai/gpt-5-fast' | 'openai/gpt-5-mini' | 'openai/gpt-5-mini-fast' | '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.1-thinking-fast' | 'openai/gpt-5.2' | '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-fast' | 'openai/gpt-5.4-mini' | 'openai/gpt-5.4-mini-fast' | 'openai/gpt-5.4-nano' | 'openai/gpt-5.4-pro' | 'openai/gpt-5.5' | 'openai/gpt-5.5-fast' | 'openai/gpt-5.5-pro' | 'openai/gpt-5.6-luna' | 'openai/gpt-5.6-luna-fast' | 'openai/gpt-5.6-sol' | 'openai/gpt-5.6-sol-fast' | 'openai/gpt-5.6-terra' | 'openai/gpt-5.6-terra-fast' | 'openai/gpt-6-astra' | 'openai/gpt-6-astra-fast' | 'openai/gpt-6-luna' | 'openai/gpt-6-luna-fast' | 'openai/gpt-6-sol' | 'openai/gpt-6-sol-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' | 'openai/o4-mini-fast' | 'perplexity/sonar' | 'perplexity/sonar-pro' | 'perplexity/sonar-reasoning-pro' | 'poolside/laguna-s-2.1' | 'poolside/laguna-s-2.1-free' | 'quiverai/arrow-2' | 'quiverai/arrow-2-telos' | 'sakana/fugu-max' | 'sakana/fugu-ultra' | 'sakana/fugu-ultra-v2' | 'sakana/namazu' | 'spacexai/grok-4.1-fast-non-reasoning' | 'spacexai/grok-4.1-fast-reasoning' | 'spacexai/grok-4.20-multi-agent' | 'spacexai/grok-4.20-multi-agent-beta' | 'spacexai/grok-4.20-non-reasoning' | 'spacexai/grok-4.20-non-reasoning-beta' | 'spacexai/grok-4.20-reasoning' | 'spacexai/grok-4.20-reasoning-beta' | 'spacexai/grok-4.3' | 'spacexai/grok-4.5' | 'spacexai/grok-4.6' | 'spacexai/grok-4.7' | 'spacexai/grok-build-0.1' | 'stepfun/step-3.5-flash' | '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-preview' | 'thinkingmachines/inkling' | 'thinkingmachines/inkling-small' | 'xiaomi/mimo-v2.5' | 'xiaomi/mimo-v2.5-pro' | '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-5v-turbo' | (string & {});
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Shared WebSocket subprotocol contract for AI Gateway realtime and streaming
|
|
@@ -81,7 +81,7 @@ type GatewayRealtimeModelId = 'google/gemini-3.8-live' | 'google/gemini-3.8-live
|
|
|
81
81
|
|
|
82
82
|
type GatewayRerankingModelId = 'cohere/rerank-v3.5' | 'cohere/rerank-v4-fast' | 'cohere/rerank-v4-pro' | 'voyage/rerank-2.5' | 'voyage/rerank-2.5-lite' | (string & {});
|
|
83
83
|
|
|
84
|
-
type GatewaySpeechModelId = 'fish-audio/s1' | 'fish-audio/s2-pro' | 'fish-audio/s2.1-pro' | 'google/gemini-3.8-flash-tts' | 'google/gemini-3.8-flash-
|
|
84
|
+
type GatewaySpeechModelId = 'fish-audio/s1' | 'fish-audio/s2-pro' | 'fish-audio/s2.1-pro' | 'google/gemini-3.8-flash-lite-tts' | 'google/gemini-3.8-flash-tts' | 'openai/tts-1' | 'openai/tts-1-hd' | 'spacexai/grok-tts' | (string & {});
|
|
85
85
|
|
|
86
86
|
type GatewayTranscriptionModelId = 'fish-audio/transcribe-1' | 'google/gemini-3.5-transcribe' | 'google/gemini-3.5-transcribe-live' | 'openai/gpt-4o-mini-transcribe' | 'openai/gpt-4o-transcribe' | 'openai/gpt-realtime-whisper' | 'openai/whisper-1' | 'spacexai/grok-stt' | (string & {});
|
|
87
87
|
|
|
@@ -868,10 +868,130 @@ interface ExaSearchInput {
|
|
|
868
868
|
type ExaSearchOutput = ExaSearchResponse | ExaSearchError;
|
|
869
869
|
declare const exaSearchToolFactory: _ai_sdk_provider_utils.ProviderExecutedToolFactory<ExaSearchInput, ExaSearchOutput, ExaSearchConfig, {}>;
|
|
870
870
|
|
|
871
|
+
interface BrowserbaseSearchConfig {
|
|
872
|
+
/**
|
|
873
|
+
* Default maximum number of results to return (1-25, default: 10).
|
|
874
|
+
*/
|
|
875
|
+
numResults?: number;
|
|
876
|
+
}
|
|
877
|
+
interface BrowserbaseSearchInput {
|
|
878
|
+
/**
|
|
879
|
+
* Web search query (1-200 characters).
|
|
880
|
+
*/
|
|
881
|
+
query: string;
|
|
882
|
+
/**
|
|
883
|
+
* Maximum number of results to return (1-25, default: 10).
|
|
884
|
+
*/
|
|
885
|
+
num_results?: number;
|
|
886
|
+
}
|
|
887
|
+
interface BrowserbaseSearchResult {
|
|
888
|
+
/** Unique identifier for the result. */
|
|
889
|
+
id: string;
|
|
890
|
+
/** Title of the search result. */
|
|
891
|
+
title: string;
|
|
892
|
+
/** URL of the search result. */
|
|
893
|
+
url: string;
|
|
894
|
+
/** Author of the content, when available. */
|
|
895
|
+
author?: string;
|
|
896
|
+
/** Favicon URL, when available. */
|
|
897
|
+
favicon?: string;
|
|
898
|
+
/** Image URL, when available. */
|
|
899
|
+
image?: string;
|
|
900
|
+
/** Publication date in ISO 8601 format, when available. */
|
|
901
|
+
publishedDate?: string;
|
|
902
|
+
}
|
|
903
|
+
interface BrowserbaseSearchResponse {
|
|
904
|
+
/** The search query that was executed. */
|
|
905
|
+
query: string;
|
|
906
|
+
/** Unique identifier for the request. */
|
|
907
|
+
requestId: string;
|
|
908
|
+
/** Search results. */
|
|
909
|
+
results: BrowserbaseSearchResult[];
|
|
910
|
+
}
|
|
911
|
+
interface BrowserbaseSearchError {
|
|
912
|
+
error: 'api_error' | 'configuration_error' | 'execution_error' | 'invalid_input' | 'rate_limit' | 'timeout' | 'unknown';
|
|
913
|
+
statusCode?: number;
|
|
914
|
+
message: string;
|
|
915
|
+
}
|
|
916
|
+
type BrowserbaseSearchOutput = BrowserbaseSearchError | BrowserbaseSearchResponse;
|
|
917
|
+
declare const browserbaseSearchToolFactory: _ai_sdk_provider_utils.ProviderExecutedToolFactory<BrowserbaseSearchInput, BrowserbaseSearchOutput, BrowserbaseSearchConfig, {}>;
|
|
918
|
+
|
|
919
|
+
type BrowserbaseFetchFormat = 'raw' | 'json' | 'markdown';
|
|
920
|
+
interface BrowserbaseFetchConfig {
|
|
921
|
+
/** Whether to follow HTTP redirects (default: false). */
|
|
922
|
+
allowRedirects?: boolean;
|
|
923
|
+
/** Whether to bypass TLS certificate verification (default: false). */
|
|
924
|
+
allowInsecureSsl?: boolean;
|
|
925
|
+
/** Whether to route the request through Browserbase proxies (default: false). */
|
|
926
|
+
proxies?: boolean;
|
|
927
|
+
/** Output format for the response content (default: raw). */
|
|
928
|
+
format?: BrowserbaseFetchFormat;
|
|
929
|
+
/**
|
|
930
|
+
* JSON Schema describing the desired response content. Only used when format
|
|
931
|
+
* is json.
|
|
932
|
+
*/
|
|
933
|
+
schema?: Record<string, unknown>;
|
|
934
|
+
}
|
|
935
|
+
interface BrowserbaseFetchInput {
|
|
936
|
+
/** URL of the page to fetch. */
|
|
937
|
+
url: string;
|
|
938
|
+
/** Whether to follow HTTP redirects. */
|
|
939
|
+
allow_redirects?: boolean;
|
|
940
|
+
/** Whether to bypass TLS certificate verification. */
|
|
941
|
+
allow_insecure_ssl?: boolean;
|
|
942
|
+
/** Whether to route the request through Browserbase proxies. */
|
|
943
|
+
proxies?: boolean;
|
|
944
|
+
/** Output format for the response content. */
|
|
945
|
+
format?: BrowserbaseFetchFormat;
|
|
946
|
+
/**
|
|
947
|
+
* JSON Schema describing the desired response content. Only used when format
|
|
948
|
+
* is json.
|
|
949
|
+
*/
|
|
950
|
+
schema?: Record<string, unknown>;
|
|
951
|
+
}
|
|
952
|
+
interface BrowserbaseFetchResponse {
|
|
953
|
+
/** Unique identifier for the fetch request. */
|
|
954
|
+
id: string;
|
|
955
|
+
/**
|
|
956
|
+
* Response body. Raw and markdown responses return strings; JSON extraction
|
|
957
|
+
* returns an object matching the requested schema.
|
|
958
|
+
*/
|
|
959
|
+
content: string | Record<string, unknown>;
|
|
960
|
+
/** MIME type of the response. */
|
|
961
|
+
contentType: string;
|
|
962
|
+
/** Character encoding of the response. */
|
|
963
|
+
encoding: string;
|
|
964
|
+
/** Response headers from the fetched page. */
|
|
965
|
+
headers: Record<string, string>;
|
|
966
|
+
/** HTTP status code returned by the fetched page. */
|
|
967
|
+
statusCode: number;
|
|
968
|
+
}
|
|
969
|
+
interface BrowserbaseFetchError {
|
|
970
|
+
error: 'api_error' | 'configuration_error' | 'execution_error' | 'invalid_input' | 'rate_limit' | 'timeout' | 'unknown';
|
|
971
|
+
statusCode?: number;
|
|
972
|
+
message: string;
|
|
973
|
+
}
|
|
974
|
+
type BrowserbaseFetchOutput = BrowserbaseFetchError | BrowserbaseFetchResponse;
|
|
975
|
+
declare const browserbaseFetchToolFactory: _ai_sdk_provider_utils.ProviderExecutedToolFactory<BrowserbaseFetchInput, BrowserbaseFetchOutput, BrowserbaseFetchConfig, {}>;
|
|
976
|
+
|
|
871
977
|
/**
|
|
872
978
|
* Gateway-specific provider-defined tools.
|
|
873
979
|
*/
|
|
874
980
|
declare const gatewayTools: {
|
|
981
|
+
/**
|
|
982
|
+
* Fetch page content using Browserbase's lightweight Fetch API.
|
|
983
|
+
*
|
|
984
|
+
* Supports raw, Markdown, and schema-driven JSON output as well as redirects,
|
|
985
|
+
* proxy routing, and TLS controls.
|
|
986
|
+
*/
|
|
987
|
+
browserbaseFetch: (config?: BrowserbaseFetchConfig) => ReturnType<typeof browserbaseFetchToolFactory>;
|
|
988
|
+
/**
|
|
989
|
+
* Search the web using Browserbase's Search API for fast, structured results.
|
|
990
|
+
*
|
|
991
|
+
* Returns titles, URLs, and available publication metadata without requiring
|
|
992
|
+
* a browser session.
|
|
993
|
+
*/
|
|
994
|
+
browserbaseSearch: (config?: BrowserbaseSearchConfig) => ReturnType<typeof browserbaseSearchToolFactory>;
|
|
875
995
|
/**
|
|
876
996
|
* Search the web using Exa for current information and token-efficient
|
|
877
997
|
* excerpts optimized for agent workflows.
|
|
@@ -1123,14 +1243,15 @@ type GatewayProviderOptions = {
|
|
|
1123
1243
|
* Restrict routing to provider models that satisfy every given entry.
|
|
1124
1244
|
*
|
|
1125
1245
|
* Entries are capability tags (`'implicit-caching'`, `'reasoning'`,
|
|
1126
|
-
* `'tool-use'`, `'vision'`
|
|
1127
|
-
*
|
|
1128
|
-
* `'
|
|
1129
|
-
*
|
|
1130
|
-
*
|
|
1131
|
-
*
|
|
1132
|
-
|
|
1133
|
-
|
|
1246
|
+
* `'tool-use'`, `'vision'` (image input), `'structured-output'`
|
|
1247
|
+
* (schema-constrained output)) or weight-format conditions:
|
|
1248
|
+
* `'quantization:fp8'` requires the serving provider to report that weight
|
|
1249
|
+
* format, `'!quantization:fp8'` excludes it (providers with no recorded
|
|
1250
|
+
* format still pass an exclusion). Format values are an open space but must
|
|
1251
|
+
* match `[a-zA-Z0-9._-]{1,32}` and compare case-insensitively. Unknown
|
|
1252
|
+
* capability names are rejected by the Gateway with a 400.
|
|
1253
|
+
*/
|
|
1254
|
+
has?: Array<'implicit-caching' | 'reasoning' | 'structured-output' | 'tool-use' | 'vision' | `quantization:${string}` | `!quantization:${string}`>;
|
|
1134
1255
|
/**
|
|
1135
1256
|
* Idempotency key for `experimental_startBatch`: retries with the same
|
|
1136
1257
|
* key replay the original batch instead of creating a duplicate.
|