@ai-sdk/gateway 4.0.98 → 4.0.101
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 +26 -0
- package/dist/index.d.ts +1335 -1303
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3143 -4013
- package/dist/index.js.map +1 -1
- package/docs/00-ai-gateway.mdx +15 -11
- package/package.json +8 -8
- package/src/gateway-language-model-settings.ts +3 -3
- package/src/gateway-provider-options.ts +8 -6
- package/src/gateway-provider.ts +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { FetchFunction, InferSchema, WebSocketConstructor } from "@ai-sdk/provider-utils";
|
|
2
|
+
import { APICallError, EmbeddingModelV4, Experimental_BatchV4, Experimental_EvaluationModelV4, Experimental_RealtimeFactoryV4, Experimental_VideoModelV4, ImageModelV4, JSONValue, LanguageModelV4, ProviderV4, RerankingModelV4, SpeechModelV4, TranscriptionModelV4, TypeValidationError } from "@ai-sdk/provider";
|
|
3
|
+
//#region src/gateway-embedding-model-settings.d.ts
|
|
5
4
|
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
|
-
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region src/gateway-evaluation-model-settings.d.ts
|
|
7
7
|
type GatewayEvaluationModelId = 'typesafe-ai/jev' | (string & {});
|
|
8
|
-
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/gateway-image-model-settings.d.ts
|
|
9
10
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/gateway-language-model-settings.d.ts
|
|
13
|
+
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' | 'anthropic/claude-sonnet-5.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-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' | 'meituan/longcat-2.5-preview' | '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.1-sol' | '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' | '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' | 'stealth/pixel-canary' | '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 & {});
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/gateway-realtime-auth.d.ts
|
|
13
16
|
/**
|
|
14
17
|
* Shared WebSocket subprotocol contract for AI Gateway realtime and streaming
|
|
15
18
|
* transcription auth.
|
|
@@ -36,29 +39,29 @@ type GatewayModelId = 'alibaba/qwen-3-14b' | 'alibaba/qwen-3-235b' | 'alibaba/qw
|
|
|
36
39
|
* echo a negotiated subprotocol on the 101 response (some clients require the
|
|
37
40
|
* server to select one of the offered subprotocols).
|
|
38
41
|
*/
|
|
39
|
-
declare const GATEWAY_REALTIME_SUBPROTOCOL = "ai-gateway-realtime.v1";
|
|
42
|
+
export declare const GATEWAY_REALTIME_SUBPROTOCOL = "ai-gateway-realtime.v1";
|
|
40
43
|
/**
|
|
41
44
|
* Marker subprotocol for streaming transcription handshakes (same negotiation
|
|
42
45
|
* purpose as `GATEWAY_REALTIME_SUBPROTOCOL`).
|
|
43
46
|
*/
|
|
44
|
-
declare const GATEWAY_TRANSCRIPTION_SUBPROTOCOL = "ai-gateway-transcription.v1";
|
|
47
|
+
export declare const GATEWAY_TRANSCRIPTION_SUBPROTOCOL = "ai-gateway-transcription.v1";
|
|
45
48
|
/** Subprotocol prefix that carries the Gateway auth (bearer) token. */
|
|
46
|
-
declare const GATEWAY_AUTH_SUBPROTOCOL_PREFIX = "ai-gateway-auth.";
|
|
49
|
+
export declare const GATEWAY_AUTH_SUBPROTOCOL_PREFIX = "ai-gateway-auth.";
|
|
47
50
|
/** Subprotocol prefix that carries optional Vercel team scoping. */
|
|
48
|
-
declare const GATEWAY_TEAM_SUBPROTOCOL_PREFIX = "ai-gateway-team.";
|
|
51
|
+
export declare const GATEWAY_TEAM_SUBPROTOCOL_PREFIX = "ai-gateway-team.";
|
|
49
52
|
/**
|
|
50
53
|
* Client-side: build the WebSocket subprotocols that carry `token` to the
|
|
51
54
|
* Gateway. Pass the result as the second argument to `new WebSocket(url, ...)`.
|
|
52
55
|
*/
|
|
53
|
-
declare function getGatewayRealtimeProtocols(token: string, options?: {
|
|
54
|
-
|
|
56
|
+
export declare function getGatewayRealtimeProtocols(token: string, options?: {
|
|
57
|
+
teamIdOrSlug?: string;
|
|
55
58
|
}): string[];
|
|
56
59
|
/**
|
|
57
60
|
* Client-side: `getGatewayRealtimeProtocols`, but with the streaming
|
|
58
61
|
* transcription marker subprotocol.
|
|
59
62
|
*/
|
|
60
|
-
declare function getGatewayTranscriptionProtocols(token: string, options?: {
|
|
61
|
-
|
|
63
|
+
export declare function getGatewayTranscriptionProtocols(token: string, options?: {
|
|
64
|
+
teamIdOrSlug?: string;
|
|
62
65
|
}): string[];
|
|
63
66
|
/**
|
|
64
67
|
* Server-side: extract the Gateway auth (bearer) token from a
|
|
@@ -69,1086 +72,1103 @@ declare function getGatewayTranscriptionProtocols(token: string, options?: {
|
|
|
69
72
|
* Accepts the raw header value (subprotocols are comma-separated and may carry
|
|
70
73
|
* surrounding whitespace).
|
|
71
74
|
*/
|
|
72
|
-
declare function getGatewayRealtimeAuthToken(secWebSocketProtocol: string | null | undefined): string | undefined;
|
|
75
|
+
export declare function getGatewayRealtimeAuthToken(secWebSocketProtocol: string | null | undefined): string | undefined;
|
|
73
76
|
/**
|
|
74
77
|
* Server-side: extract the optional Vercel team ID or slug from the
|
|
75
78
|
* `Sec-WebSocket-Protocol` header value. Team scoping is base64url-encoded so
|
|
76
79
|
* arbitrary team slugs stay within the WebSocket subprotocol token grammar.
|
|
77
80
|
*/
|
|
78
|
-
declare function getGatewayRealtimeTeamIdOrSlug(secWebSocketProtocol: string | null | undefined): string | undefined;
|
|
79
|
-
|
|
81
|
+
export declare function getGatewayRealtimeTeamIdOrSlug(secWebSocketProtocol: string | null | undefined): string | undefined;
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/gateway-realtime-model-settings.d.ts
|
|
80
84
|
type GatewayRealtimeModelId = 'google/gemini-3.8-live' | 'google/gemini-3.8-live-extended-thinking' | 'openai/gpt-live-1' | 'openai/gpt-realtime-1.5' | 'openai/gpt-realtime-2' | 'openai/gpt-realtime-2.1' | 'openai/gpt-realtime-mini' | 'spacexai/grok-voice-think-fast-1.0' | 'spacexai/grok-voice-think-fast-2.0' | (string & {});
|
|
81
|
-
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region src/gateway-reranking-model-settings.d.ts
|
|
82
87
|
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
|
-
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/gateway-speech-model-settings.d.ts
|
|
84
90
|
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
|
-
|
|
91
|
+
//#endregion
|
|
92
|
+
//#region src/gateway-transcription-model-settings.d.ts
|
|
86
93
|
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
|
-
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region src/gateway-video-model-settings.d.ts
|
|
88
96
|
type GatewayVideoModelId = 'alibaba/wan-v2.5-t2v-preview' | 'alibaba/wan-v2.6-i2v' | 'alibaba/wan-v2.6-i2v-flash' | 'alibaba/wan-v2.6-r2v' | 'alibaba/wan-v2.6-r2v-flash' | 'alibaba/wan-v2.6-t2v' | 'alibaba/wan-v2.7-r2v' | 'alibaba/wan-v2.7-t2v' | 'alibaba/wan-v3.0-video' | 'alibaba/wan-v3.0-video-prime' | 'bfl/flux-3-video' | 'bytedance/seedance-2.0' | 'bytedance/seedance-2.0-fast' | 'bytedance/seedance-2.0-mini' | 'bytedance/seedance-2.5' | 'bytedance/seedance-v1.0-pro' | 'bytedance/seedance-v1.0-pro-fast' | 'bytedance/seedance-v1.5-pro' | 'google/veo-3.0-fast-generate-001' | 'google/veo-3.0-generate-001' | 'google/veo-3.1-fast-generate-001' | 'google/veo-3.1-generate-001' | 'google/veo-3.1-lite-generate-001' | 'klingai/kling-v2.5-turbo-i2v' | 'klingai/kling-v2.5-turbo-t2v' | 'klingai/kling-v2.6-i2v' | 'klingai/kling-v2.6-motion-control' | 'klingai/kling-v2.6-t2v' | 'klingai/kling-v3.0-i2v' | 'klingai/kling-v3.0-motion-control' | 'klingai/kling-v3.0-t2v' | 'minimax/minimax-h3' | 'minimax/minimax-h3-max' | 'spacexai/grok-imagine-video' | 'spacexai/grok-imagine-video-1.5' | (string & {});
|
|
89
|
-
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region src/gateway-model-entry.d.ts
|
|
90
99
|
declare const KNOWN_MODEL_TYPES: readonly ["embedding", "evaluation", "image", "language", "realtime", "reranking", "speech", "transcription", "video"];
|
|
91
100
|
type KnownModelType = (typeof KNOWN_MODEL_TYPES)[number];
|
|
92
101
|
interface GatewayLanguageModelEntry {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
102
|
+
/**
|
|
103
|
+
* The model id used by the remote provider in model settings and for specifying the
|
|
104
|
+
* intended model for text generation.
|
|
105
|
+
*/
|
|
106
|
+
id: string;
|
|
107
|
+
/**
|
|
108
|
+
* The display name of the model for presentation in user-facing contexts.
|
|
109
|
+
*/
|
|
110
|
+
name: string;
|
|
111
|
+
/**
|
|
112
|
+
* Optional description of the model.
|
|
113
|
+
*/
|
|
114
|
+
description?: string | null;
|
|
115
|
+
/**
|
|
116
|
+
* Optional pricing information for the model.
|
|
117
|
+
*/
|
|
118
|
+
pricing?: {
|
|
119
|
+
/**
|
|
120
|
+
* Cost per input token in USD.
|
|
121
|
+
*/
|
|
122
|
+
input: string;
|
|
123
|
+
/**
|
|
124
|
+
* Cost per output token in USD.
|
|
125
|
+
*/
|
|
126
|
+
output: string;
|
|
127
|
+
/**
|
|
128
|
+
* Cost per cached input token in USD.
|
|
129
|
+
* Only present for providers/models that support prompt caching.
|
|
130
|
+
*/
|
|
131
|
+
cachedInputTokens?: string;
|
|
132
|
+
/**
|
|
133
|
+
* Cost per input token to create/write cache entries in USD.
|
|
134
|
+
* Only present for providers/models that support prompt caching.
|
|
135
|
+
*/
|
|
136
|
+
cacheCreationInputTokens?: string;
|
|
137
|
+
} | null;
|
|
138
|
+
/**
|
|
139
|
+
* Additional AI SDK language model specifications for the model.
|
|
140
|
+
*/
|
|
141
|
+
specification: GatewayLanguageModelSpecification;
|
|
142
|
+
/**
|
|
143
|
+
* Optional field to differentiate between model types.
|
|
144
|
+
*/
|
|
145
|
+
modelType?: KnownModelType | null;
|
|
137
146
|
}
|
|
138
147
|
type GatewayLanguageModelSpecification = Pick<LanguageModelV4, 'specificationVersion' | 'provider' | 'modelId'>;
|
|
139
|
-
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region src/gateway-fetch-metadata.d.ts
|
|
140
150
|
interface GatewayFetchMetadataResponse {
|
|
141
|
-
|
|
151
|
+
models: GatewayLanguageModelEntry[];
|
|
142
152
|
}
|
|
143
153
|
interface GatewayCreditsResponse {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
154
|
+
/** The remaining gateway credit balance available for API usage */
|
|
155
|
+
balance: string;
|
|
156
|
+
/** The total amount of gateway credits that have been consumed */
|
|
157
|
+
totalUsed: string;
|
|
148
158
|
}
|
|
149
|
-
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/gateway-spend-report.d.ts
|
|
150
161
|
interface GatewaySpendReportParams {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
162
|
+
/** Start date in YYYY-MM-DD format (inclusive) */
|
|
163
|
+
startDate: string;
|
|
164
|
+
/** End date in YYYY-MM-DD format (inclusive) */
|
|
165
|
+
endDate: string;
|
|
166
|
+
/** Primary aggregation dimension. Defaults to 'day'. */
|
|
167
|
+
groupBy?: 'day' | 'user' | 'model' | 'tag' | 'provider' | 'credential_type';
|
|
168
|
+
/** Time granularity when groupBy is 'day'. */
|
|
169
|
+
datePart?: 'day' | 'hour';
|
|
170
|
+
/** Filter to a specific user's spend. */
|
|
171
|
+
userId?: string;
|
|
172
|
+
/** Filter to a specific model (e.g. 'anthropic/claude-sonnet-4.5'). */
|
|
173
|
+
model?: string;
|
|
174
|
+
/** Filter to a specific provider (e.g. 'anthropic'). */
|
|
175
|
+
provider?: string;
|
|
176
|
+
/** Filter to BYOK or system credentials. */
|
|
177
|
+
credentialType?: 'byok' | 'system';
|
|
178
|
+
/** Filter to requests with these tags. */
|
|
179
|
+
tags?: string[];
|
|
169
180
|
}
|
|
170
181
|
interface GatewaySpendReportRow {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
182
|
+
/** Date string (present when groupBy is 'day') */
|
|
183
|
+
day?: string;
|
|
184
|
+
/** Hour timestamp (present when groupBy is 'day' and datePart is 'hour') */
|
|
185
|
+
hour?: string;
|
|
186
|
+
/** User identifier (present when groupBy is 'user') */
|
|
187
|
+
user?: string;
|
|
188
|
+
/** Model identifier (present when groupBy is 'model') */
|
|
189
|
+
model?: string;
|
|
190
|
+
/** Tag value (present when groupBy is 'tag') */
|
|
191
|
+
tag?: string;
|
|
192
|
+
/** Provider name (present when groupBy is 'provider') */
|
|
193
|
+
provider?: string;
|
|
194
|
+
/** Credential type (present when groupBy is 'credential_type') */
|
|
195
|
+
credentialType?: 'byok' | 'system';
|
|
196
|
+
/** Total cost in USD */
|
|
197
|
+
totalCost: number;
|
|
198
|
+
/** Market cost in USD */
|
|
199
|
+
marketCost?: number;
|
|
200
|
+
/** Number of input tokens */
|
|
201
|
+
inputTokens?: number;
|
|
202
|
+
/** Number of output tokens */
|
|
203
|
+
outputTokens?: number;
|
|
204
|
+
/** Number of cached input tokens */
|
|
205
|
+
cachedInputTokens?: number;
|
|
206
|
+
/** Number of cache creation input tokens */
|
|
207
|
+
cacheCreationInputTokens?: number;
|
|
208
|
+
/** Number of reasoning tokens */
|
|
209
|
+
reasoningTokens?: number;
|
|
210
|
+
/** Number of requests */
|
|
211
|
+
requestCount?: number;
|
|
201
212
|
}
|
|
202
213
|
interface GatewaySpendReportResponse {
|
|
203
|
-
|
|
214
|
+
results: GatewaySpendReportRow[];
|
|
204
215
|
}
|
|
205
|
-
|
|
216
|
+
//#endregion
|
|
217
|
+
//#region src/gateway-generation-info.d.ts
|
|
206
218
|
interface GatewayGenerationInfoParams {
|
|
207
|
-
|
|
208
|
-
|
|
219
|
+
/** The generation ID to look up (format: gen_<ulid>) */
|
|
220
|
+
id: string;
|
|
209
221
|
}
|
|
210
222
|
interface GatewayGenerationInfo {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
223
|
+
/** The generation ID */
|
|
224
|
+
id: string;
|
|
225
|
+
/** Total cost in USD */
|
|
226
|
+
totalCost: number;
|
|
227
|
+
/** Upstream inference cost in USD (BYOK only) */
|
|
228
|
+
upstreamInferenceCost: number;
|
|
229
|
+
/** Usage cost in USD (same as totalCost) */
|
|
230
|
+
usage: number;
|
|
231
|
+
/** ISO 8601 timestamp when the generation was created */
|
|
232
|
+
createdAt: string;
|
|
233
|
+
/** Model identifier */
|
|
234
|
+
model: string;
|
|
235
|
+
/** Whether BYOK credentials were used */
|
|
236
|
+
isByok: boolean;
|
|
237
|
+
/** Provider that served this generation */
|
|
238
|
+
providerName: string;
|
|
239
|
+
/** Whether streaming was used */
|
|
240
|
+
streamed: boolean;
|
|
241
|
+
/** Finish reason (e.g. 'stop') */
|
|
242
|
+
finishReason: string;
|
|
243
|
+
/** Time to first token in milliseconds */
|
|
244
|
+
latency: number;
|
|
245
|
+
/** Total generation time in milliseconds */
|
|
246
|
+
generationTime: number;
|
|
247
|
+
/** Number of prompt tokens */
|
|
248
|
+
promptTokens: number;
|
|
249
|
+
/** Number of completion tokens */
|
|
250
|
+
completionTokens: number;
|
|
251
|
+
/** Reasoning tokens used */
|
|
252
|
+
reasoningTokens: number;
|
|
253
|
+
/** Cached tokens used */
|
|
254
|
+
cachedTokens: number;
|
|
255
|
+
/** Cache creation input tokens */
|
|
256
|
+
cacheCreationTokens: number;
|
|
257
|
+
/** Billable web search calls */
|
|
258
|
+
billableWebSearchCalls: number;
|
|
247
259
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
type
|
|
251
|
-
interface
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
/** Requested delivery mode for card data. Search cards are always inlined. */
|
|
266
|
-
mode?: 'inline' | 'url';
|
|
267
|
-
/** Serialization for inlined card data. */
|
|
268
|
-
contentFormat?: TakoContentFormat;
|
|
269
|
-
/**
|
|
270
|
-
* Maximum rows to inline per result. Omit to use the allowance in
|
|
271
|
-
* cards.content.export_pricing. A data surcharge applies per 1,000 exported
|
|
272
|
-
* rows; lower values reduce cost.
|
|
273
|
-
*/
|
|
274
|
-
maxRows?: number;
|
|
275
|
-
/** Data Graph node IDs to prioritize. */
|
|
276
|
-
nodeIds?: string[];
|
|
277
|
-
/** Return only cards matching nodeIds. Requires at least one node ID. */
|
|
278
|
-
strict?: boolean;
|
|
260
|
+
//#endregion
|
|
261
|
+
//#region src/tool/browserbase-fetch.d.ts
|
|
262
|
+
type BrowserbaseFetchFormat = 'raw' | 'json' | 'markdown';
|
|
263
|
+
interface BrowserbaseFetchConfig {
|
|
264
|
+
/** Whether to follow HTTP redirects (default: false). */
|
|
265
|
+
allowRedirects?: boolean;
|
|
266
|
+
/** Whether to bypass TLS certificate verification (default: false). */
|
|
267
|
+
allowInsecureSsl?: boolean;
|
|
268
|
+
/** Whether to route the request through Browserbase proxies (default: false). */
|
|
269
|
+
proxies?: boolean;
|
|
270
|
+
/** Output format for the response content (default: raw). */
|
|
271
|
+
format?: BrowserbaseFetchFormat;
|
|
272
|
+
/**
|
|
273
|
+
* JSON Schema describing the desired response content. Only used when format
|
|
274
|
+
* is json.
|
|
275
|
+
*/
|
|
276
|
+
schema?: Record<string, unknown>;
|
|
279
277
|
}
|
|
280
|
-
interface
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
articleContentMaxChars?: number;
|
|
297
|
-
/** Keep results published on or after this ISO date. */
|
|
298
|
-
publishedAfter?: string;
|
|
299
|
-
/** Keep results published on or before this ISO date. */
|
|
300
|
-
publishedBefore?: string;
|
|
278
|
+
interface BrowserbaseFetchInput {
|
|
279
|
+
/** URL of the page to fetch. */
|
|
280
|
+
url: string;
|
|
281
|
+
/** Whether to follow HTTP redirects. */
|
|
282
|
+
allow_redirects?: boolean;
|
|
283
|
+
/** Whether to bypass TLS certificate verification. */
|
|
284
|
+
allow_insecure_ssl?: boolean;
|
|
285
|
+
/** Whether to route the request through Browserbase proxies. */
|
|
286
|
+
proxies?: boolean;
|
|
287
|
+
/** Output format for the response content. */
|
|
288
|
+
format?: BrowserbaseFetchFormat;
|
|
289
|
+
/**
|
|
290
|
+
* JSON Schema describing the desired response content. Only used when format
|
|
291
|
+
* is json.
|
|
292
|
+
*/
|
|
293
|
+
schema?: Record<string, unknown>;
|
|
301
294
|
}
|
|
302
|
-
interface
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
locale?: string;
|
|
319
|
-
/** IANA timezone. */
|
|
320
|
-
timezone?: string;
|
|
321
|
-
/** Settings that control card rendering. */
|
|
322
|
-
outputSettings?: {
|
|
323
|
-
imageDarkMode?: boolean;
|
|
324
|
-
/** Instant-effort only. */
|
|
325
|
-
forceRefresh?: boolean;
|
|
326
|
-
};
|
|
327
|
-
/** Maximum related search suggestions to include (1-20). */
|
|
328
|
-
includeRelated?: number;
|
|
295
|
+
interface BrowserbaseFetchResponse {
|
|
296
|
+
/** Unique identifier for the fetch request. */
|
|
297
|
+
id: string;
|
|
298
|
+
/**
|
|
299
|
+
* Response body. Raw and markdown responses return strings; JSON extraction
|
|
300
|
+
* returns an object matching the requested schema.
|
|
301
|
+
*/
|
|
302
|
+
content: string | Record<string, unknown>;
|
|
303
|
+
/** MIME type of the response. */
|
|
304
|
+
contentType: string;
|
|
305
|
+
/** Character encoding of the response. */
|
|
306
|
+
encoding: string;
|
|
307
|
+
/** Response headers from the fetched page. */
|
|
308
|
+
headers: Record<string, string>;
|
|
309
|
+
/** HTTP status code returned by the fetched page. */
|
|
310
|
+
statusCode: number;
|
|
329
311
|
}
|
|
330
|
-
interface
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
data?: {
|
|
335
|
-
count?: number;
|
|
336
|
-
include_contents?: boolean;
|
|
337
|
-
mode?: 'inline' | 'url';
|
|
338
|
-
content_format?: TakoContentFormat;
|
|
339
|
-
max_rows?: number;
|
|
340
|
-
node_ids?: string[];
|
|
341
|
-
strict?: boolean;
|
|
342
|
-
};
|
|
343
|
-
web?: {
|
|
344
|
-
count?: number;
|
|
345
|
-
include_contents?: boolean;
|
|
346
|
-
category?: 'finance' | 'news' | 'sports';
|
|
347
|
-
include_domains?: string[];
|
|
348
|
-
exclude_domains?: string[];
|
|
349
|
-
snippet_max_chars?: number;
|
|
350
|
-
highlights?: boolean;
|
|
351
|
-
article_content_max_chars?: number;
|
|
352
|
-
published_after?: string;
|
|
353
|
-
published_before?: string;
|
|
354
|
-
};
|
|
355
|
-
};
|
|
356
|
-
location?: {
|
|
357
|
-
latitude: number;
|
|
358
|
-
longitude: number;
|
|
359
|
-
};
|
|
360
|
-
country_code?: string;
|
|
361
|
-
locale?: string;
|
|
362
|
-
timezone?: string;
|
|
363
|
-
output_settings?: {
|
|
364
|
-
image_dark_mode?: boolean;
|
|
365
|
-
force_refresh?: boolean;
|
|
366
|
-
};
|
|
367
|
-
include_related?: number;
|
|
312
|
+
interface BrowserbaseFetchError {
|
|
313
|
+
error: 'api_error' | 'configuration_error' | 'execution_error' | 'invalid_input' | 'rate_limit' | 'timeout' | 'unknown';
|
|
314
|
+
statusCode?: number;
|
|
315
|
+
message: string;
|
|
368
316
|
}
|
|
369
|
-
type
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
type: 'boolean' | 'date' | 'datetime' | 'number' | 'string';
|
|
379
|
-
unit?: string | null;
|
|
380
|
-
}>;
|
|
381
|
-
rows: TakoDatasetCell[][];
|
|
382
|
-
total_rows: number;
|
|
383
|
-
truncated: boolean;
|
|
384
|
-
ref: string;
|
|
385
|
-
sources: Array<{
|
|
386
|
-
name: string;
|
|
387
|
-
index?: 'data' | 'web';
|
|
388
|
-
}>;
|
|
389
|
-
provenance?: 'query' | 'web_extraction';
|
|
390
|
-
} | null;
|
|
391
|
-
card_data?: Record<string, unknown> | null;
|
|
392
|
-
card_data_schema?: Record<string, unknown> | null;
|
|
393
|
-
url?: string | null;
|
|
394
|
-
expires_at?: string | null;
|
|
395
|
-
total_rows?: number | null;
|
|
396
|
-
truncated?: boolean;
|
|
397
|
-
export_pricing?: {
|
|
398
|
-
baseline_usd: number;
|
|
399
|
-
free_rows: number;
|
|
400
|
-
max_rows_ceiling: number;
|
|
401
|
-
row_cpm_usd: number;
|
|
402
|
-
} | null;
|
|
403
|
-
manifest?: Array<{
|
|
404
|
-
dtype?: 'boolean' | 'date' | 'datetime' | 'number' | 'string' | null;
|
|
405
|
-
entity?: string | null;
|
|
406
|
-
metric?: string | null;
|
|
407
|
-
name?: string | null;
|
|
408
|
-
unit?: string | null;
|
|
409
|
-
}> | null;
|
|
317
|
+
type BrowserbaseFetchOutput = BrowserbaseFetchError | BrowserbaseFetchResponse;
|
|
318
|
+
declare const browserbaseFetchToolFactory: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<BrowserbaseFetchInput, BrowserbaseFetchOutput, BrowserbaseFetchConfig, {}>;
|
|
319
|
+
//#endregion
|
|
320
|
+
//#region src/tool/browserbase-search.d.ts
|
|
321
|
+
interface BrowserbaseSearchConfig {
|
|
322
|
+
/**
|
|
323
|
+
* Default maximum number of results to return (1-25, default: 10).
|
|
324
|
+
*/
|
|
325
|
+
numResults?: number;
|
|
410
326
|
}
|
|
411
|
-
interface
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
source_name?: string | null;
|
|
421
|
-
source_description?: string | null;
|
|
422
|
-
source_index: 'data' | 'web';
|
|
423
|
-
source_text?: string | null;
|
|
424
|
-
url?: string | null;
|
|
425
|
-
}> | null;
|
|
426
|
-
methodologies?: Array<{
|
|
427
|
-
methodology_name: string | null;
|
|
428
|
-
methodology_description: string | null;
|
|
429
|
-
}> | null;
|
|
430
|
-
source_indexes?: Array<'data' | 'web'> | null;
|
|
431
|
-
card_type?: string | null;
|
|
432
|
-
relevance?: 'High' | 'Low' | 'Medium' | null;
|
|
433
|
-
content?: TakoResultContent | null;
|
|
434
|
-
exportable?: boolean;
|
|
435
|
-
nodes?: Array<{
|
|
436
|
-
id: string;
|
|
437
|
-
type: 'entity' | 'metric';
|
|
438
|
-
name: string;
|
|
439
|
-
description?: string | null;
|
|
440
|
-
}> | null;
|
|
441
|
-
metric_definitions?: Array<{
|
|
442
|
-
name: string;
|
|
443
|
-
definition: string;
|
|
444
|
-
}> | null;
|
|
445
|
-
data_freshness?: {
|
|
446
|
-
coverage_end?: string | null;
|
|
447
|
-
data_as_of?: string | null;
|
|
448
|
-
last_updated?: string | null;
|
|
449
|
-
} | null;
|
|
327
|
+
interface BrowserbaseSearchInput {
|
|
328
|
+
/**
|
|
329
|
+
* Web search query (1-200 characters).
|
|
330
|
+
*/
|
|
331
|
+
query: string;
|
|
332
|
+
/**
|
|
333
|
+
* Maximum number of results to return (1-25, default: 10).
|
|
334
|
+
*/
|
|
335
|
+
num_results?: number;
|
|
450
336
|
}
|
|
451
|
-
interface
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
337
|
+
interface BrowserbaseSearchResult {
|
|
338
|
+
/** Unique identifier for the result. */
|
|
339
|
+
id: string;
|
|
340
|
+
/** Title of the search result. */
|
|
341
|
+
title: string;
|
|
342
|
+
/** URL of the search result. */
|
|
343
|
+
url: string;
|
|
344
|
+
/** Author of the content, when available. */
|
|
345
|
+
author?: string;
|
|
346
|
+
/** Favicon URL, when available. */
|
|
347
|
+
favicon?: string;
|
|
348
|
+
/** Image URL, when available. */
|
|
349
|
+
image?: string;
|
|
350
|
+
/** Publication date in ISO 8601 format, when available. */
|
|
351
|
+
publishedDate?: string;
|
|
458
352
|
}
|
|
459
|
-
interface
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
cost_usd: number;
|
|
467
|
-
} | null;
|
|
468
|
-
data?: {
|
|
469
|
-
cost_usd: number;
|
|
470
|
-
datasets: number;
|
|
471
|
-
} | null;
|
|
472
|
-
} | null;
|
|
473
|
-
related?: Array<Record<string, unknown>> | null;
|
|
353
|
+
interface BrowserbaseSearchResponse {
|
|
354
|
+
/** The search query that was executed. */
|
|
355
|
+
query: string;
|
|
356
|
+
/** Unique identifier for the request. */
|
|
357
|
+
requestId: string;
|
|
358
|
+
/** Search results. */
|
|
359
|
+
results: BrowserbaseSearchResult[];
|
|
474
360
|
}
|
|
475
|
-
interface
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
361
|
+
interface BrowserbaseSearchError {
|
|
362
|
+
error: 'api_error' | 'configuration_error' | 'execution_error' | 'invalid_input' | 'rate_limit' | 'timeout' | 'unknown';
|
|
363
|
+
statusCode?: number;
|
|
364
|
+
message: string;
|
|
479
365
|
}
|
|
480
|
-
type
|
|
481
|
-
declare const
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
* Default maximum total tokens across all search results (default: 25000, max: 1000000).
|
|
494
|
-
*/
|
|
495
|
-
maxTokens?: number;
|
|
496
|
-
/**
|
|
497
|
-
* Default two-letter ISO 3166-1 alpha-2 country code for regional search results.
|
|
498
|
-
* Examples: 'US', 'GB', 'FR'
|
|
499
|
-
*/
|
|
500
|
-
country?: string;
|
|
501
|
-
/**
|
|
502
|
-
* Default list of domains to include or exclude from search results (max 20).
|
|
503
|
-
* To include: ['nature.com', 'science.org']
|
|
504
|
-
* To exclude: ['-example.com', '-spam.net']
|
|
505
|
-
*/
|
|
506
|
-
searchDomainFilter?: string[];
|
|
507
|
-
/**
|
|
508
|
-
* Default list of ISO 639-1 language codes to filter results (max 10, lowercase).
|
|
509
|
-
* Examples: ['en', 'fr', 'de']
|
|
510
|
-
*/
|
|
511
|
-
searchLanguageFilter?: string[];
|
|
512
|
-
/**
|
|
513
|
-
* Default recency filter for results.
|
|
514
|
-
* Cannot be combined with searchAfterDate/searchBeforeDate at runtime.
|
|
515
|
-
*/
|
|
516
|
-
searchRecencyFilter?: 'day' | 'week' | 'month' | 'year';
|
|
366
|
+
type BrowserbaseSearchOutput = BrowserbaseSearchError | BrowserbaseSearchResponse;
|
|
367
|
+
declare const browserbaseSearchToolFactory: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<BrowserbaseSearchInput, BrowserbaseSearchOutput, BrowserbaseSearchConfig, {}>;
|
|
368
|
+
//#endregion
|
|
369
|
+
//#region src/tool/exa-search.d.ts
|
|
370
|
+
type ExaSearchType = 'auto' | 'fast' | 'instant';
|
|
371
|
+
type ExaSearchCategory = 'company' | 'people' | 'research paper' | 'news' | 'personal site' | 'financial report';
|
|
372
|
+
type ExaTextSection = 'header' | 'navigation' | 'banner' | 'body' | 'sidebar' | 'footer' | 'metadata';
|
|
373
|
+
interface ExaSearchTextConfig {
|
|
374
|
+
maxCharacters?: number;
|
|
375
|
+
includeHtmlTags?: boolean;
|
|
376
|
+
verbosity?: 'compact' | 'standard' | 'full';
|
|
377
|
+
includeSections?: ExaTextSection[];
|
|
378
|
+
excludeSections?: ExaTextSection[];
|
|
517
379
|
}
|
|
518
|
-
interface
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
/** URL of the search result */
|
|
522
|
-
url: string;
|
|
523
|
-
/** Text snippet/preview of the content */
|
|
524
|
-
snippet: string;
|
|
525
|
-
/** Publication date of the content */
|
|
526
|
-
date?: string;
|
|
527
|
-
/** Last updated date of the content */
|
|
528
|
-
lastUpdated?: string;
|
|
380
|
+
interface ExaSearchHighlightsConfig {
|
|
381
|
+
query?: string;
|
|
382
|
+
maxCharacters?: number;
|
|
529
383
|
}
|
|
530
|
-
interface
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
/** Unique identifier for this search request */
|
|
534
|
-
id: string;
|
|
384
|
+
interface ExaSearchExtrasConfig {
|
|
385
|
+
links?: number;
|
|
386
|
+
imageLinks?: number;
|
|
535
387
|
}
|
|
536
|
-
interface
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
388
|
+
interface ExaSearchContentsConfig {
|
|
389
|
+
text?: boolean | ExaSearchTextConfig;
|
|
390
|
+
highlights?: boolean | ExaSearchHighlightsConfig;
|
|
391
|
+
maxAgeHours?: number;
|
|
392
|
+
livecrawlTimeout?: number;
|
|
393
|
+
subpages?: number;
|
|
394
|
+
subpageTarget?: string | string[];
|
|
395
|
+
extras?: ExaSearchExtrasConfig;
|
|
543
396
|
}
|
|
544
|
-
interface
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
* Examples: ['en', 'fr', 'de']
|
|
576
|
-
*/
|
|
577
|
-
search_language_filter?: string[];
|
|
578
|
-
/**
|
|
579
|
-
* Include only results published after this date.
|
|
580
|
-
* Format: 'MM/DD/YYYY' (e.g., '3/1/2025')
|
|
581
|
-
* Cannot be used with search_recency_filter.
|
|
582
|
-
*/
|
|
583
|
-
search_after_date?: string;
|
|
584
|
-
/**
|
|
585
|
-
* Include only results published before this date.
|
|
586
|
-
* Format: 'MM/DD/YYYY' (e.g., '3/15/2025')
|
|
587
|
-
* Cannot be used with search_recency_filter.
|
|
588
|
-
*/
|
|
589
|
-
search_before_date?: string;
|
|
590
|
-
/**
|
|
591
|
-
* Include only results last updated after this date.
|
|
592
|
-
* Format: 'MM/DD/YYYY' (e.g., '3/1/2025')
|
|
593
|
-
* Cannot be used with search_recency_filter.
|
|
594
|
-
*/
|
|
595
|
-
last_updated_after_filter?: string;
|
|
596
|
-
/**
|
|
597
|
-
* Include only results last updated before this date.
|
|
598
|
-
* Format: 'MM/DD/YYYY' (e.g., '3/15/2025')
|
|
599
|
-
* Cannot be used with search_recency_filter.
|
|
600
|
-
*/
|
|
601
|
-
last_updated_before_filter?: string;
|
|
602
|
-
/**
|
|
603
|
-
* Filter results by relative time period.
|
|
604
|
-
* Cannot be used with search_after_date or search_before_date.
|
|
605
|
-
*/
|
|
606
|
-
search_recency_filter?: 'day' | 'week' | 'month' | 'year';
|
|
397
|
+
interface ExaSearchConfig {
|
|
398
|
+
/**
|
|
399
|
+
* Default search method. Exa defaults to auto when omitted.
|
|
400
|
+
*/
|
|
401
|
+
type?: ExaSearchType;
|
|
402
|
+
/**
|
|
403
|
+
* Default maximum number of results to return (1-100, default: 10).
|
|
404
|
+
*/
|
|
405
|
+
numResults?: number;
|
|
406
|
+
/**
|
|
407
|
+
* Default category filter for result types.
|
|
408
|
+
*/
|
|
409
|
+
category?: ExaSearchCategory;
|
|
410
|
+
/**
|
|
411
|
+
* Default two-letter ISO country code for location-aware search.
|
|
412
|
+
*/
|
|
413
|
+
userLocation?: string;
|
|
414
|
+
/**
|
|
415
|
+
* Default domains to include or exclude.
|
|
416
|
+
*/
|
|
417
|
+
includeDomains?: string[];
|
|
418
|
+
excludeDomains?: string[];
|
|
419
|
+
/**
|
|
420
|
+
* Default published date filters in ISO 8601 format.
|
|
421
|
+
*/
|
|
422
|
+
startPublishedDate?: string;
|
|
423
|
+
endPublishedDate?: string;
|
|
424
|
+
/**
|
|
425
|
+
* Default content extraction controls.
|
|
426
|
+
*/
|
|
427
|
+
contents?: ExaSearchContentsConfig;
|
|
607
428
|
}
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
429
|
+
interface ExaSearchResult {
|
|
430
|
+
title: string;
|
|
431
|
+
url: string;
|
|
432
|
+
id: string;
|
|
433
|
+
publishedDate?: string | null;
|
|
434
|
+
author?: string | null;
|
|
435
|
+
image?: string | null;
|
|
436
|
+
favicon?: string | null;
|
|
437
|
+
text?: string;
|
|
438
|
+
highlights?: string[];
|
|
439
|
+
highlightScores?: number[];
|
|
440
|
+
summary?: string;
|
|
441
|
+
subpages?: ExaSearchResult[];
|
|
442
|
+
extras?: {
|
|
443
|
+
links?: string[];
|
|
444
|
+
imageLinks?: string[];
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
interface ExaSearchResponse {
|
|
448
|
+
requestId: string;
|
|
449
|
+
searchType?: string;
|
|
450
|
+
resolvedSearchType?: string;
|
|
451
|
+
results: ExaSearchResult[];
|
|
452
|
+
costDollars?: {
|
|
453
|
+
total?: number;
|
|
454
|
+
search?: Record<string, number>;
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
interface ExaSearchError {
|
|
458
|
+
error: 'api_error' | 'rate_limit' | 'timeout' | 'invalid_input' | 'configuration_error' | 'execution_error' | 'unknown';
|
|
459
|
+
statusCode?: number;
|
|
460
|
+
message: string;
|
|
461
|
+
}
|
|
462
|
+
interface ExaSearchInput {
|
|
463
|
+
query: string;
|
|
464
|
+
type?: ExaSearchType;
|
|
465
|
+
num_results?: number;
|
|
466
|
+
category?: ExaSearchCategory;
|
|
467
|
+
user_location?: string;
|
|
468
|
+
include_domains?: string[];
|
|
469
|
+
exclude_domains?: string[];
|
|
470
|
+
start_published_date?: string;
|
|
471
|
+
end_published_date?: string;
|
|
472
|
+
contents?: {
|
|
473
|
+
text?: boolean | {
|
|
474
|
+
max_characters?: number;
|
|
475
|
+
include_html_tags?: boolean;
|
|
476
|
+
verbosity?: 'compact' | 'standard' | 'full';
|
|
477
|
+
include_sections?: ExaTextSection[];
|
|
478
|
+
exclude_sections?: ExaTextSection[];
|
|
479
|
+
};
|
|
480
|
+
highlights?: boolean | {
|
|
481
|
+
query?: string;
|
|
482
|
+
max_characters?: number;
|
|
483
|
+
};
|
|
484
|
+
max_age_hours?: number;
|
|
485
|
+
livecrawl_timeout?: number;
|
|
486
|
+
subpages?: number;
|
|
487
|
+
subpage_target?: string | string[];
|
|
488
|
+
extras?: {
|
|
489
|
+
links?: number;
|
|
490
|
+
image_links?: number;
|
|
491
|
+
};
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
type ExaSearchOutput = ExaSearchResponse | ExaSearchError;
|
|
495
|
+
declare const exaSearchToolFactory: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<ExaSearchInput, ExaSearchOutput, ExaSearchConfig, {}>;
|
|
496
|
+
//#endregion
|
|
497
|
+
//#region src/tool/parallel-search.d.ts
|
|
611
498
|
interface ParallelSearchSourcePolicy {
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
499
|
+
/**
|
|
500
|
+
* List of domains to include in search results.
|
|
501
|
+
* Example: ['wikipedia.org', 'nature.com']
|
|
502
|
+
*/
|
|
503
|
+
includeDomains?: string[];
|
|
504
|
+
/**
|
|
505
|
+
* List of domains to exclude from search results.
|
|
506
|
+
* Example: ['reddit.com', 'twitter.com']
|
|
507
|
+
*/
|
|
508
|
+
excludeDomains?: string[];
|
|
509
|
+
/**
|
|
510
|
+
* Only include results published after this date (ISO 8601 format).
|
|
511
|
+
* Example: '2024-01-01'
|
|
512
|
+
*/
|
|
513
|
+
afterDate?: string;
|
|
627
514
|
}
|
|
628
515
|
interface ParallelSearchExcerpts {
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
516
|
+
/**
|
|
517
|
+
* Maximum characters per result.
|
|
518
|
+
*/
|
|
519
|
+
maxCharsPerResult?: number;
|
|
520
|
+
/**
|
|
521
|
+
* Maximum total characters across all results.
|
|
522
|
+
*/
|
|
523
|
+
maxCharsTotal?: number;
|
|
637
524
|
}
|
|
638
525
|
interface ParallelSearchFetchPolicy {
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
526
|
+
/**
|
|
527
|
+
* Maximum age in seconds for cached content.
|
|
528
|
+
* Set to 0 to always fetch fresh content.
|
|
529
|
+
*/
|
|
530
|
+
maxAgeSeconds?: number;
|
|
644
531
|
}
|
|
645
532
|
interface ParallelSearchConfig {
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
533
|
+
/**
|
|
534
|
+
* Mode preset for different use cases:
|
|
535
|
+
* - "one-shot": Comprehensive results with longer excerpts for single-response answers (default)
|
|
536
|
+
* - "agentic": Concise, token-efficient results for multi-step agentic workflows
|
|
537
|
+
*/
|
|
538
|
+
mode?: 'one-shot' | 'agentic';
|
|
539
|
+
/**
|
|
540
|
+
* Default maximum number of results to return (1-20).
|
|
541
|
+
* Defaults to 10 if not specified.
|
|
542
|
+
*/
|
|
543
|
+
maxResults?: number;
|
|
544
|
+
/**
|
|
545
|
+
* Default source policy for controlling which domains to include/exclude.
|
|
546
|
+
*/
|
|
547
|
+
sourcePolicy?: ParallelSearchSourcePolicy;
|
|
548
|
+
/**
|
|
549
|
+
* Default excerpt configuration for controlling result length.
|
|
550
|
+
*/
|
|
551
|
+
excerpts?: ParallelSearchExcerpts;
|
|
552
|
+
/**
|
|
553
|
+
* Default fetch policy for controlling content freshness.
|
|
554
|
+
*/
|
|
555
|
+
fetchPolicy?: ParallelSearchFetchPolicy;
|
|
669
556
|
}
|
|
670
557
|
interface ParallelSearchResult {
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
558
|
+
/** URL of the search result */
|
|
559
|
+
url: string;
|
|
560
|
+
/** Title of the search result */
|
|
561
|
+
title: string;
|
|
562
|
+
/** Extracted text excerpt/content from the page */
|
|
563
|
+
excerpt: string;
|
|
564
|
+
/** Publication date of the content (may be null) */
|
|
565
|
+
publishDate?: string | null;
|
|
566
|
+
/** Relevance score for the result */
|
|
567
|
+
relevanceScore?: number;
|
|
681
568
|
}
|
|
682
569
|
interface ParallelSearchResponse {
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
570
|
+
/** Unique identifier for this search request */
|
|
571
|
+
searchId: string;
|
|
572
|
+
/** Array of search results */
|
|
573
|
+
results: ParallelSearchResult[];
|
|
687
574
|
}
|
|
688
575
|
interface ParallelSearchError {
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
576
|
+
/** Error type */
|
|
577
|
+
error: 'api_error' | 'rate_limit' | 'timeout' | 'invalid_input' | 'configuration_error' | 'unknown';
|
|
578
|
+
/** HTTP status code if applicable */
|
|
579
|
+
statusCode?: number;
|
|
580
|
+
/** Human-readable error message */
|
|
581
|
+
message: string;
|
|
695
582
|
}
|
|
696
583
|
interface ParallelSearchInput {
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
584
|
+
/**
|
|
585
|
+
* Natural-language description of the web research goal.
|
|
586
|
+
* Include source or freshness guidance and broader context from the task.
|
|
587
|
+
* Maximum 5000 characters.
|
|
588
|
+
*/
|
|
589
|
+
objective: string;
|
|
590
|
+
/**
|
|
591
|
+
* Optional search queries to supplement the objective.
|
|
592
|
+
* Maximum 200 characters per query.
|
|
593
|
+
*/
|
|
594
|
+
search_queries?: string[];
|
|
595
|
+
/**
|
|
596
|
+
* Mode preset for different use cases:
|
|
597
|
+
* - "one-shot": Comprehensive results with longer excerpts
|
|
598
|
+
* - "agentic": Concise, token-efficient results for multi-step workflows
|
|
599
|
+
*/
|
|
600
|
+
mode?: 'one-shot' | 'agentic';
|
|
601
|
+
/**
|
|
602
|
+
* Maximum number of results to return (1-20).
|
|
603
|
+
* Defaults to 10 if not specified.
|
|
604
|
+
*/
|
|
605
|
+
max_results?: number;
|
|
606
|
+
/**
|
|
607
|
+
* Source policy for controlling which domains to include/exclude.
|
|
608
|
+
*/
|
|
609
|
+
source_policy?: {
|
|
610
|
+
include_domains?: string[];
|
|
611
|
+
exclude_domains?: string[];
|
|
612
|
+
after_date?: string;
|
|
613
|
+
};
|
|
614
|
+
/**
|
|
615
|
+
* Excerpt configuration for controlling result length.
|
|
616
|
+
*/
|
|
617
|
+
excerpts?: {
|
|
618
|
+
max_chars_per_result?: number;
|
|
619
|
+
max_chars_total?: number;
|
|
620
|
+
};
|
|
621
|
+
/**
|
|
622
|
+
* Fetch policy for controlling content freshness.
|
|
623
|
+
*/
|
|
624
|
+
fetch_policy?: {
|
|
625
|
+
max_age_seconds?: number;
|
|
626
|
+
};
|
|
740
627
|
}
|
|
741
628
|
type ParallelSearchOutput = ParallelSearchResponse | ParallelSearchError;
|
|
742
|
-
declare const parallelSearchToolFactory:
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
629
|
+
declare const parallelSearchToolFactory: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<ParallelSearchInput, ParallelSearchOutput, ParallelSearchConfig, {}>;
|
|
630
|
+
//#endregion
|
|
631
|
+
//#region src/tool/perplexity-search.d.ts
|
|
632
|
+
interface PerplexitySearchConfig {
|
|
633
|
+
/**
|
|
634
|
+
* Default maximum number of search results to return (1-20, default: 10).
|
|
635
|
+
*/
|
|
636
|
+
maxResults?: number;
|
|
637
|
+
/**
|
|
638
|
+
* Default maximum tokens to extract per search result page (256-2048, default: 2048).
|
|
639
|
+
*/
|
|
640
|
+
maxTokensPerPage?: number;
|
|
641
|
+
/**
|
|
642
|
+
* Default maximum total tokens across all search results (default: 25000, max: 1000000).
|
|
643
|
+
*/
|
|
644
|
+
maxTokens?: number;
|
|
645
|
+
/**
|
|
646
|
+
* Default two-letter ISO 3166-1 alpha-2 country code for regional search results.
|
|
647
|
+
* Examples: 'US', 'GB', 'FR'
|
|
648
|
+
*/
|
|
649
|
+
country?: string;
|
|
650
|
+
/**
|
|
651
|
+
* Default list of domains to include or exclude from search results (max 20).
|
|
652
|
+
* To include: ['nature.com', 'science.org']
|
|
653
|
+
* To exclude: ['-example.com', '-spam.net']
|
|
654
|
+
*/
|
|
655
|
+
searchDomainFilter?: string[];
|
|
656
|
+
/**
|
|
657
|
+
* Default list of ISO 639-1 language codes to filter results (max 10, lowercase).
|
|
658
|
+
* Examples: ['en', 'fr', 'de']
|
|
659
|
+
*/
|
|
660
|
+
searchLanguageFilter?: string[];
|
|
661
|
+
/**
|
|
662
|
+
* Default recency filter for results.
|
|
663
|
+
* Cannot be combined with searchAfterDate/searchBeforeDate at runtime.
|
|
664
|
+
*/
|
|
665
|
+
searchRecencyFilter?: 'day' | 'week' | 'month' | 'year';
|
|
753
666
|
}
|
|
754
|
-
interface
|
|
755
|
-
|
|
756
|
-
|
|
667
|
+
interface PerplexitySearchResult {
|
|
668
|
+
/** Title of the search result */
|
|
669
|
+
title: string;
|
|
670
|
+
/** URL of the search result */
|
|
671
|
+
url: string;
|
|
672
|
+
/** Text snippet/preview of the content */
|
|
673
|
+
snippet: string;
|
|
674
|
+
/** Publication date of the content */
|
|
675
|
+
date?: string;
|
|
676
|
+
/** Last updated date of the content */
|
|
677
|
+
lastUpdated?: string;
|
|
757
678
|
}
|
|
758
|
-
interface
|
|
759
|
-
|
|
760
|
-
|
|
679
|
+
interface PerplexitySearchResponse {
|
|
680
|
+
/** Array of search results */
|
|
681
|
+
results: PerplexitySearchResult[];
|
|
682
|
+
/** Unique identifier for this search request */
|
|
683
|
+
id: string;
|
|
761
684
|
}
|
|
762
|
-
interface
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
extras?: ExaSearchExtrasConfig;
|
|
685
|
+
interface PerplexitySearchError {
|
|
686
|
+
/** Error type */
|
|
687
|
+
error: 'api_error' | 'rate_limit' | 'timeout' | 'invalid_input' | 'unknown';
|
|
688
|
+
/** HTTP status code if applicable */
|
|
689
|
+
statusCode?: number;
|
|
690
|
+
/** Human-readable error message */
|
|
691
|
+
message: string;
|
|
770
692
|
}
|
|
771
|
-
interface
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
693
|
+
interface PerplexitySearchInput {
|
|
694
|
+
/**
|
|
695
|
+
* Search query (string) or multiple queries (array of up to 5 strings).
|
|
696
|
+
* Multi-query searches return combined results from all queries.
|
|
697
|
+
*/
|
|
698
|
+
query: string | string[];
|
|
699
|
+
/**
|
|
700
|
+
* Maximum number of search results to return (1-20, default: 10).
|
|
701
|
+
*/
|
|
702
|
+
max_results?: number;
|
|
703
|
+
/**
|
|
704
|
+
* Maximum number of tokens to extract per search result page (256-2048, default: 2048).
|
|
705
|
+
*/
|
|
706
|
+
max_tokens_per_page?: number;
|
|
707
|
+
/**
|
|
708
|
+
* Maximum total tokens across all search results (default: 25000, max: 1000000).
|
|
709
|
+
*/
|
|
710
|
+
max_tokens?: number;
|
|
711
|
+
/**
|
|
712
|
+
* Two-letter ISO 3166-1 alpha-2 country code for regional search results.
|
|
713
|
+
* Examples: 'US', 'GB', 'FR'
|
|
714
|
+
*/
|
|
715
|
+
country?: string;
|
|
716
|
+
/**
|
|
717
|
+
* List of domains to include or exclude from search results (max 20).
|
|
718
|
+
* To include: ['nature.com', 'science.org']
|
|
719
|
+
* To exclude: ['-example.com', '-spam.net']
|
|
720
|
+
*/
|
|
721
|
+
search_domain_filter?: string[];
|
|
722
|
+
/**
|
|
723
|
+
* List of ISO 639-1 language codes to filter results (max 10, lowercase).
|
|
724
|
+
* Examples: ['en', 'fr', 'de']
|
|
725
|
+
*/
|
|
726
|
+
search_language_filter?: string[];
|
|
727
|
+
/**
|
|
728
|
+
* Include only results published after this date.
|
|
729
|
+
* Format: 'MM/DD/YYYY' (e.g., '3/1/2025')
|
|
730
|
+
* Cannot be used with search_recency_filter.
|
|
731
|
+
*/
|
|
732
|
+
search_after_date?: string;
|
|
733
|
+
/**
|
|
734
|
+
* Include only results published before this date.
|
|
735
|
+
* Format: 'MM/DD/YYYY' (e.g., '3/15/2025')
|
|
736
|
+
* Cannot be used with search_recency_filter.
|
|
737
|
+
*/
|
|
738
|
+
search_before_date?: string;
|
|
739
|
+
/**
|
|
740
|
+
* Include only results last updated after this date.
|
|
741
|
+
* Format: 'MM/DD/YYYY' (e.g., '3/1/2025')
|
|
742
|
+
* Cannot be used with search_recency_filter.
|
|
743
|
+
*/
|
|
744
|
+
last_updated_after_filter?: string;
|
|
745
|
+
/**
|
|
746
|
+
* Include only results last updated before this date.
|
|
747
|
+
* Format: 'MM/DD/YYYY' (e.g., '3/15/2025')
|
|
748
|
+
* Cannot be used with search_recency_filter.
|
|
749
|
+
*/
|
|
750
|
+
last_updated_before_filter?: string;
|
|
751
|
+
/**
|
|
752
|
+
* Filter results by relative time period.
|
|
753
|
+
* Cannot be used with search_after_date or search_before_date.
|
|
754
|
+
*/
|
|
755
|
+
search_recency_filter?: 'day' | 'week' | 'month' | 'year';
|
|
802
756
|
}
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
757
|
+
type PerplexitySearchOutput = PerplexitySearchResponse | PerplexitySearchError;
|
|
758
|
+
declare const perplexitySearchToolFactory: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<PerplexitySearchInput, PerplexitySearchOutput, PerplexitySearchConfig, {}>;
|
|
759
|
+
//#endregion
|
|
760
|
+
//#region src/tool/tako-search.d.ts
|
|
761
|
+
type TakoSearchEffort = 'deep' | 'fast' | 'instant';
|
|
762
|
+
type TakoContentFormat = 'card_json' | 'csv' | 'json_compact' | 'json_records';
|
|
763
|
+
interface TakoDataSourceConfig {
|
|
764
|
+
/**
|
|
765
|
+
* Maximum number of data results to return (1-20). When includeContents is
|
|
766
|
+
* true, each additional result adds its own data surcharge.
|
|
767
|
+
*/
|
|
768
|
+
count?: number;
|
|
769
|
+
/**
|
|
770
|
+
* Inline rows for each data result. This adds a data surcharge based on row
|
|
771
|
+
* count and dataset source. To estimate cost, search with includeContents
|
|
772
|
+
* disabled and inspect cards.content.export_pricing. This applies to every
|
|
773
|
+
* returned card; limit sources.data.count and sources.data.maxRows to control
|
|
774
|
+
* cost.
|
|
775
|
+
*/
|
|
776
|
+
includeContents?: boolean;
|
|
777
|
+
/** Requested delivery mode for card data. Search cards are always inlined. */
|
|
778
|
+
mode?: 'inline' | 'url';
|
|
779
|
+
/** Serialization for inlined card data. */
|
|
780
|
+
contentFormat?: TakoContentFormat;
|
|
781
|
+
/**
|
|
782
|
+
* Maximum rows to inline per result. Omit to use the allowance in
|
|
783
|
+
* cards.content.export_pricing. A data surcharge applies per 1,000 exported
|
|
784
|
+
* rows; lower values reduce cost.
|
|
785
|
+
*/
|
|
786
|
+
maxRows?: number;
|
|
787
|
+
/** Data Graph node IDs to prioritize. */
|
|
788
|
+
nodeIds?: string[];
|
|
789
|
+
/** Return only cards matching nodeIds. Requires at least one node ID. */
|
|
790
|
+
strict?: boolean;
|
|
820
791
|
}
|
|
821
|
-
interface
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
792
|
+
interface TakoWebSourceConfig {
|
|
793
|
+
/** Maximum number of web results to return (1-20). */
|
|
794
|
+
count?: number;
|
|
795
|
+
/** Inline extracted web page text. This can add a data charge. */
|
|
796
|
+
includeContents?: boolean;
|
|
797
|
+
/** Optional web-result category filter. */
|
|
798
|
+
category?: 'finance' | 'news' | 'sports';
|
|
799
|
+
/** Only return results from these bare domains. */
|
|
800
|
+
includeDomains?: string[];
|
|
801
|
+
/** Exclude results from these bare domains. */
|
|
802
|
+
excludeDomains?: string[];
|
|
803
|
+
/** Maximum characters in each web-result snippet. */
|
|
804
|
+
snippetMaxChars?: number;
|
|
805
|
+
/** Include highlighted passages in web results. Defaults to true in AI Gateway. */
|
|
806
|
+
highlights?: boolean;
|
|
807
|
+
/** Maximum extracted characters per web page when including contents. */
|
|
808
|
+
articleContentMaxChars?: number;
|
|
809
|
+
/** Keep results published on or after this ISO date. */
|
|
810
|
+
publishedAfter?: string;
|
|
811
|
+
/** Keep results published on or before this ISO date. */
|
|
812
|
+
publishedBefore?: string;
|
|
830
813
|
}
|
|
831
|
-
interface
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
814
|
+
interface TakoSearchConfig {
|
|
815
|
+
/** Search effort. fast is the default balanced option. */
|
|
816
|
+
effort?: TakoSearchEffort;
|
|
817
|
+
/** Sources to search. Omit to search both curated data and the web. */
|
|
818
|
+
sources?: {
|
|
819
|
+
data?: TakoDataSourceConfig;
|
|
820
|
+
web?: TakoWebSourceConfig;
|
|
821
|
+
};
|
|
822
|
+
/** End-user coordinates for localized results. */
|
|
823
|
+
location?: {
|
|
824
|
+
latitude: number;
|
|
825
|
+
longitude: number;
|
|
826
|
+
};
|
|
827
|
+
/** ISO 3166-1 alpha-2 country code. */
|
|
828
|
+
countryCode?: string;
|
|
829
|
+
/** BCP-47 locale. */
|
|
830
|
+
locale?: string;
|
|
831
|
+
/** IANA timezone. */
|
|
832
|
+
timezone?: string;
|
|
833
|
+
/** Settings that control card rendering. */
|
|
834
|
+
outputSettings?: {
|
|
835
|
+
imageDarkMode?: boolean;
|
|
836
|
+
/** Instant-effort only. */
|
|
837
|
+
forceRefresh?: boolean;
|
|
838
|
+
};
|
|
839
|
+
/** Maximum related search suggestions to include (1-20). */
|
|
840
|
+
includeRelated?: number;
|
|
835
841
|
}
|
|
836
|
-
interface
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
max_characters?: number;
|
|
849
|
-
include_html_tags?: boolean;
|
|
850
|
-
verbosity?: 'compact' | 'standard' | 'full';
|
|
851
|
-
include_sections?: ExaTextSection[];
|
|
852
|
-
exclude_sections?: ExaTextSection[];
|
|
853
|
-
};
|
|
854
|
-
highlights?: boolean | {
|
|
855
|
-
query?: string;
|
|
856
|
-
max_characters?: number;
|
|
857
|
-
};
|
|
858
|
-
max_age_hours?: number;
|
|
859
|
-
livecrawl_timeout?: number;
|
|
860
|
-
subpages?: number;
|
|
861
|
-
subpage_target?: string | string[];
|
|
862
|
-
extras?: {
|
|
863
|
-
links?: number;
|
|
864
|
-
image_links?: number;
|
|
865
|
-
};
|
|
842
|
+
interface TakoSearchInput {
|
|
843
|
+
query: string;
|
|
844
|
+
effort?: TakoSearchEffort;
|
|
845
|
+
sources?: {
|
|
846
|
+
data?: {
|
|
847
|
+
count?: number;
|
|
848
|
+
include_contents?: boolean;
|
|
849
|
+
mode?: 'inline' | 'url';
|
|
850
|
+
content_format?: TakoContentFormat;
|
|
851
|
+
max_rows?: number;
|
|
852
|
+
node_ids?: string[];
|
|
853
|
+
strict?: boolean;
|
|
866
854
|
};
|
|
855
|
+
web?: {
|
|
856
|
+
count?: number;
|
|
857
|
+
include_contents?: boolean;
|
|
858
|
+
category?: 'finance' | 'news' | 'sports';
|
|
859
|
+
include_domains?: string[];
|
|
860
|
+
exclude_domains?: string[];
|
|
861
|
+
snippet_max_chars?: number;
|
|
862
|
+
highlights?: boolean;
|
|
863
|
+
article_content_max_chars?: number;
|
|
864
|
+
published_after?: string;
|
|
865
|
+
published_before?: string;
|
|
866
|
+
};
|
|
867
|
+
};
|
|
868
|
+
location?: {
|
|
869
|
+
latitude: number;
|
|
870
|
+
longitude: number;
|
|
871
|
+
};
|
|
872
|
+
country_code?: string;
|
|
873
|
+
locale?: string;
|
|
874
|
+
timezone?: string;
|
|
875
|
+
output_settings?: {
|
|
876
|
+
image_dark_mode?: boolean;
|
|
877
|
+
force_refresh?: boolean;
|
|
878
|
+
};
|
|
879
|
+
include_related?: number;
|
|
867
880
|
}
|
|
868
|
-
type
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
881
|
+
type TakoDatasetCell = boolean | number | string | null;
|
|
882
|
+
interface TakoResultContent {
|
|
883
|
+
content_format?: TakoContentFormat | null;
|
|
884
|
+
cost?: number;
|
|
885
|
+
data?: string | null;
|
|
886
|
+
records?: Array<Record<string, TakoDatasetCell>> | null;
|
|
887
|
+
dataset?: {
|
|
888
|
+
columns: Array<{
|
|
889
|
+
name: string;
|
|
890
|
+
type: 'boolean' | 'date' | 'datetime' | 'number' | 'string';
|
|
891
|
+
unit?: string | null;
|
|
892
|
+
}>;
|
|
893
|
+
rows: TakoDatasetCell[][];
|
|
894
|
+
total_rows: number;
|
|
895
|
+
truncated: boolean;
|
|
896
|
+
ref: string;
|
|
897
|
+
sources: Array<{
|
|
898
|
+
name: string;
|
|
899
|
+
index?: 'data' | 'web';
|
|
900
|
+
}>;
|
|
901
|
+
provenance?: 'query' | 'web_extraction';
|
|
902
|
+
} | null;
|
|
903
|
+
card_data?: Record<string, unknown> | null;
|
|
904
|
+
card_data_schema?: Record<string, unknown> | null;
|
|
905
|
+
url?: string | null;
|
|
906
|
+
expires_at?: string | null;
|
|
907
|
+
total_rows?: number | null;
|
|
908
|
+
truncated?: boolean;
|
|
909
|
+
export_pricing?: {
|
|
910
|
+
baseline_usd: number;
|
|
911
|
+
free_rows: number;
|
|
912
|
+
max_rows_ceiling: number;
|
|
913
|
+
row_cpm_usd: number;
|
|
914
|
+
} | null;
|
|
915
|
+
manifest?: Array<{
|
|
916
|
+
dtype?: 'boolean' | 'date' | 'datetime' | 'number' | 'string' | null;
|
|
917
|
+
entity?: string | null;
|
|
918
|
+
metric?: string | null;
|
|
919
|
+
name?: string | null;
|
|
920
|
+
unit?: string | null;
|
|
921
|
+
}> | null;
|
|
886
922
|
}
|
|
887
|
-
interface
|
|
888
|
-
|
|
923
|
+
interface TakoCard {
|
|
924
|
+
card_id?: string | null;
|
|
925
|
+
title?: string | null;
|
|
926
|
+
description?: string | null;
|
|
927
|
+
semantic_description?: string | null;
|
|
928
|
+
webpage_url?: string | null;
|
|
929
|
+
image_url?: string | null;
|
|
930
|
+
embed_url?: string | null;
|
|
931
|
+
sources?: Array<{
|
|
932
|
+
source_name?: string | null;
|
|
933
|
+
source_description?: string | null;
|
|
934
|
+
source_index: 'data' | 'web';
|
|
935
|
+
source_text?: string | null;
|
|
936
|
+
url?: string | null;
|
|
937
|
+
}> | null;
|
|
938
|
+
methodologies?: Array<{
|
|
939
|
+
methodology_name: string | null;
|
|
940
|
+
methodology_description: string | null;
|
|
941
|
+
}> | null;
|
|
942
|
+
source_indexes?: Array<'data' | 'web'> | null;
|
|
943
|
+
card_type?: string | null;
|
|
944
|
+
relevance?: 'High' | 'Low' | 'Medium' | null;
|
|
945
|
+
content?: TakoResultContent | null;
|
|
946
|
+
exportable?: boolean;
|
|
947
|
+
nodes?: Array<{
|
|
889
948
|
id: string;
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
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>;
|
|
949
|
+
type: 'entity' | 'metric';
|
|
950
|
+
name: string;
|
|
951
|
+
description?: string | null;
|
|
952
|
+
}> | null;
|
|
953
|
+
metric_definitions?: Array<{
|
|
954
|
+
name: string;
|
|
955
|
+
definition: string;
|
|
956
|
+
}> | null;
|
|
957
|
+
data_freshness?: {
|
|
958
|
+
coverage_end?: string | null;
|
|
959
|
+
data_as_of?: string | null;
|
|
960
|
+
last_updated?: string | null;
|
|
961
|
+
} | null;
|
|
934
962
|
}
|
|
935
|
-
interface
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
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>;
|
|
963
|
+
interface TakoWebResult {
|
|
964
|
+
title: string;
|
|
965
|
+
url: string;
|
|
966
|
+
snippet?: string | null;
|
|
967
|
+
source_name?: string | null;
|
|
968
|
+
publish_date?: string | null;
|
|
969
|
+
content?: TakoResultContent | null;
|
|
951
970
|
}
|
|
952
|
-
interface
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
statusCode: number;
|
|
971
|
+
interface TakoSearchResponse {
|
|
972
|
+
request_id: string;
|
|
973
|
+
cards?: TakoCard[];
|
|
974
|
+
web_results?: TakoWebResult[];
|
|
975
|
+
usage?: {
|
|
976
|
+
total_cost_usd: number;
|
|
977
|
+
compute?: {
|
|
978
|
+
cost_usd: number;
|
|
979
|
+
} | null;
|
|
980
|
+
data?: {
|
|
981
|
+
cost_usd: number;
|
|
982
|
+
datasets: number;
|
|
983
|
+
} | null;
|
|
984
|
+
} | null;
|
|
985
|
+
related?: Array<Record<string, unknown>> | null;
|
|
968
986
|
}
|
|
969
|
-
interface
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
987
|
+
interface TakoSearchError {
|
|
988
|
+
error: 'api_error' | 'configuration_error' | 'execution_error' | 'invalid_input' | 'rate_limit' | 'timeout' | 'unknown_tool';
|
|
989
|
+
statusCode?: number;
|
|
990
|
+
message: string;
|
|
973
991
|
}
|
|
974
|
-
type
|
|
975
|
-
declare const
|
|
976
|
-
|
|
992
|
+
type TakoSearchOutput = TakoSearchError | TakoSearchResponse;
|
|
993
|
+
declare const takoSearchToolFactory: import("@ai-sdk/provider-utils").ProviderExecutedToolFactory<TakoSearchInput, TakoSearchOutput, TakoSearchConfig, {}>;
|
|
994
|
+
//#endregion
|
|
995
|
+
//#region src/gateway-tools.d.ts
|
|
977
996
|
/**
|
|
978
997
|
* Gateway-specific provider-defined tools.
|
|
979
998
|
*/
|
|
980
999
|
declare const gatewayTools: {
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1000
|
+
/**
|
|
1001
|
+
* Fetch page content using Browserbase's lightweight Fetch API.
|
|
1002
|
+
*
|
|
1003
|
+
* Supports raw, Markdown, and schema-driven JSON output as well as redirects,
|
|
1004
|
+
* proxy routing, and TLS controls.
|
|
1005
|
+
*/
|
|
1006
|
+
browserbaseFetch: (config?: BrowserbaseFetchConfig) => ReturnType<typeof browserbaseFetchToolFactory>;
|
|
1007
|
+
/**
|
|
1008
|
+
* Search the web using Browserbase's Search API for fast, structured results.
|
|
1009
|
+
*
|
|
1010
|
+
* Returns titles, URLs, and available publication metadata without requiring
|
|
1011
|
+
* a browser session.
|
|
1012
|
+
*/
|
|
1013
|
+
browserbaseSearch: (config?: BrowserbaseSearchConfig) => ReturnType<typeof browserbaseSearchToolFactory>;
|
|
1014
|
+
/**
|
|
1015
|
+
* Search the web using Exa for current information and token-efficient
|
|
1016
|
+
* excerpts optimized for agent workflows.
|
|
1017
|
+
*
|
|
1018
|
+
* Supports search type, category, domain, date, location, and content
|
|
1019
|
+
* extraction controls.
|
|
1020
|
+
*/
|
|
1021
|
+
exaSearch: (config?: ExaSearchConfig) => ReturnType<typeof exaSearchToolFactory>;
|
|
1022
|
+
/**
|
|
1023
|
+
* Search the web using Parallel AI's Search API for LLM-optimized excerpts.
|
|
1024
|
+
*
|
|
1025
|
+
* Takes a natural language objective and returns relevant excerpts,
|
|
1026
|
+
* replacing multiple keyword searches with a single call for broad
|
|
1027
|
+
* or complex queries. Supports different search types for depth vs
|
|
1028
|
+
* breadth tradeoffs.
|
|
1029
|
+
*/
|
|
1030
|
+
parallelSearch: (config?: ParallelSearchConfig) => ReturnType<typeof parallelSearchToolFactory>;
|
|
1031
|
+
/**
|
|
1032
|
+
* Search the web using Perplexity's Search API for real-time information,
|
|
1033
|
+
* news, research papers, and articles.
|
|
1034
|
+
*
|
|
1035
|
+
* Provides ranked search results with advanced filtering options including
|
|
1036
|
+
* domain, language, date range, and recency filters.
|
|
1037
|
+
*/
|
|
1038
|
+
perplexitySearch: (config?: PerplexitySearchConfig) => ReturnType<typeof perplexitySearchToolFactory>;
|
|
1039
|
+
/**
|
|
1040
|
+
* Search the web and Tako's curated knowledge graph in one call for
|
|
1041
|
+
* token-efficient web excerpts and structured data results grounded in
|
|
1042
|
+
* premium sources, each with an embed-ready visualization.
|
|
1043
|
+
*
|
|
1044
|
+
* Supports effort, per-source web and data controls, localization, and inline
|
|
1045
|
+
* contents for agents that need to reason over underlying data.
|
|
1046
|
+
*/
|
|
1047
|
+
takoSearch: (config?: TakoSearchConfig) => ReturnType<typeof takoSearchToolFactory>;
|
|
1029
1048
|
};
|
|
1030
|
-
|
|
1049
|
+
//#endregion
|
|
1050
|
+
//#region src/gateway-provider.d.ts
|
|
1031
1051
|
interface GatewayProvider extends ProviderV4 {
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1052
|
+
(modelId: GatewayModelId): LanguageModelV4;
|
|
1053
|
+
/**
|
|
1054
|
+
* Creates a model for text generation.
|
|
1055
|
+
*/
|
|
1056
|
+
chat(modelId: GatewayModelId): LanguageModelV4;
|
|
1057
|
+
/**
|
|
1058
|
+
* Creates a model for text generation.
|
|
1059
|
+
*/
|
|
1060
|
+
languageModel(modelId: GatewayModelId): LanguageModelV4;
|
|
1061
|
+
/** Returns a BatchV4 interface for processing batches with AI Gateway. */
|
|
1062
|
+
experimental_batch(): Experimental_BatchV4<{
|
|
1063
|
+
text: GatewayModelId;
|
|
1064
|
+
}>;
|
|
1065
|
+
/**
|
|
1066
|
+
* Returns available providers and models for use with the remote provider.
|
|
1067
|
+
*/
|
|
1068
|
+
getAvailableModels(): Promise<GatewayFetchMetadataResponse>;
|
|
1069
|
+
/**
|
|
1070
|
+
* Returns credit information for the authenticated user.
|
|
1071
|
+
*/
|
|
1072
|
+
getCredits(): Promise<GatewayCreditsResponse>;
|
|
1073
|
+
/**
|
|
1074
|
+
* Returns a spend report with cost, token, and request count data,
|
|
1075
|
+
* aggregated by the specified dimension.
|
|
1076
|
+
*/
|
|
1077
|
+
getSpendReport(params: GatewaySpendReportParams): Promise<GatewaySpendReportResponse>;
|
|
1078
|
+
/**
|
|
1079
|
+
* Returns detailed information about a specific generation by its ID,
|
|
1080
|
+
* including cost, token usage, latency, and provider details.
|
|
1081
|
+
*/
|
|
1082
|
+
getGenerationInfo(params: GatewayGenerationInfoParams): Promise<GatewayGenerationInfo>;
|
|
1083
|
+
/**
|
|
1084
|
+
* Creates a model for generating text embeddings.
|
|
1085
|
+
*/
|
|
1086
|
+
embedding(modelId: GatewayEmbeddingModelId): EmbeddingModelV4;
|
|
1087
|
+
/**
|
|
1088
|
+
* Creates a model for generating text embeddings.
|
|
1089
|
+
*/
|
|
1090
|
+
embeddingModel(modelId: GatewayEmbeddingModelId): EmbeddingModelV4;
|
|
1091
|
+
/**
|
|
1092
|
+
* @deprecated Use `embeddingModel` instead.
|
|
1093
|
+
*/
|
|
1094
|
+
textEmbeddingModel(modelId: GatewayEmbeddingModelId): EmbeddingModelV4;
|
|
1095
|
+
/**
|
|
1096
|
+
* Creates a model for generating images.
|
|
1097
|
+
*/
|
|
1098
|
+
image(modelId: GatewayImageModelId): ImageModelV4;
|
|
1099
|
+
/**
|
|
1100
|
+
* Creates a model for generating images.
|
|
1101
|
+
*/
|
|
1102
|
+
imageModel(modelId: GatewayImageModelId): ImageModelV4;
|
|
1103
|
+
/**
|
|
1104
|
+
* Creates a model for generating videos.
|
|
1105
|
+
*/
|
|
1106
|
+
video(modelId: GatewayVideoModelId): Experimental_VideoModelV4;
|
|
1107
|
+
/**
|
|
1108
|
+
* Creates a model for generating videos.
|
|
1109
|
+
*/
|
|
1110
|
+
videoModel(modelId: GatewayVideoModelId): Experimental_VideoModelV4;
|
|
1111
|
+
/**
|
|
1112
|
+
* Creates a model for reranking documents.
|
|
1113
|
+
*/
|
|
1114
|
+
reranking(modelId: GatewayRerankingModelId): RerankingModelV4;
|
|
1115
|
+
/**
|
|
1116
|
+
* Creates a model for reranking documents.
|
|
1117
|
+
*/
|
|
1118
|
+
rerankingModel(modelId: GatewayRerankingModelId): RerankingModelV4;
|
|
1119
|
+
/**
|
|
1120
|
+
* Creates a model for evaluating state against questions.
|
|
1121
|
+
*/
|
|
1122
|
+
evaluation(modelId: GatewayEvaluationModelId): Experimental_EvaluationModelV4;
|
|
1123
|
+
/**
|
|
1124
|
+
* Creates a model for evaluating state against questions.
|
|
1125
|
+
*/
|
|
1126
|
+
evaluationModel(modelId: GatewayEvaluationModelId): Experimental_EvaluationModelV4;
|
|
1127
|
+
/**
|
|
1128
|
+
* Creates a model for text-to-speech generation.
|
|
1129
|
+
*/
|
|
1130
|
+
speech(modelId: GatewaySpeechModelId): SpeechModelV4;
|
|
1131
|
+
/**
|
|
1132
|
+
* Creates a model for text-to-speech generation.
|
|
1133
|
+
*/
|
|
1134
|
+
speechModel(modelId: GatewaySpeechModelId): SpeechModelV4;
|
|
1135
|
+
/**
|
|
1136
|
+
* Creates a model for audio transcription.
|
|
1137
|
+
*/
|
|
1138
|
+
transcription(modelId: GatewayTranscriptionModelId): TranscriptionModelV4;
|
|
1139
|
+
/**
|
|
1140
|
+
* Creates a model for audio transcription.
|
|
1141
|
+
*/
|
|
1142
|
+
transcriptionModel(modelId: GatewayTranscriptionModelId): TranscriptionModelV4;
|
|
1143
|
+
/**
|
|
1144
|
+
* Creates an experimental realtime model for bidirectional audio/text
|
|
1145
|
+
* communication over WebSocket, normalized through the AI Gateway.
|
|
1146
|
+
*/
|
|
1147
|
+
experimental_realtime: Experimental_RealtimeFactoryV4;
|
|
1148
|
+
/**
|
|
1149
|
+
* Experimental streaming-transcription entry point. Callable like
|
|
1150
|
+
* `transcription(modelId)`, plus `getToken` for minting a short-lived
|
|
1151
|
+
* client secret (`vcst_`) a browser can use to open the streaming
|
|
1152
|
+
* transcription WebSocket without holding the Gateway credential.
|
|
1153
|
+
*/
|
|
1154
|
+
experimental_transcription: GatewayTranscriptionFactory;
|
|
1155
|
+
/**
|
|
1156
|
+
* Gateway-specific tools executed server-side.
|
|
1157
|
+
*/
|
|
1158
|
+
tools: typeof gatewayTools;
|
|
1139
1159
|
}
|
|
1140
1160
|
type GatewayTranscriptionFactoryGetTokenOptions = {
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1161
|
+
model: GatewayTranscriptionModelId;
|
|
1162
|
+
/** Token lifetime in seconds. Gateway default is 60s (max 300s). */
|
|
1163
|
+
expiresAfterSeconds?: number;
|
|
1144
1164
|
};
|
|
1145
1165
|
type GatewayTranscriptionFactoryGetTokenResult = {
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1166
|
+
/** The minted `vcst_` client secret. */
|
|
1167
|
+
token: string;
|
|
1168
|
+
/** WebSocket URL of the streaming transcription surface for this model. */
|
|
1169
|
+
url: string;
|
|
1170
|
+
/** Token expiry, epoch seconds. */
|
|
1171
|
+
expiresAt?: number;
|
|
1152
1172
|
};
|
|
1153
1173
|
/**
|
|
1154
1174
|
* Streaming-transcription factory: callable like `transcription(modelId)`,
|
|
@@ -1158,63 +1178,64 @@ type GatewayTranscriptionFactoryGetTokenResult = {
|
|
|
1158
1178
|
* the same auth subprotocol an API key does, without exposing the credential.
|
|
1159
1179
|
*/
|
|
1160
1180
|
interface GatewayTranscriptionFactory {
|
|
1161
|
-
|
|
1162
|
-
|
|
1181
|
+
(modelId: GatewayTranscriptionModelId): TranscriptionModelV4;
|
|
1182
|
+
getToken(options: GatewayTranscriptionFactoryGetTokenOptions): Promise<GatewayTranscriptionFactoryGetTokenResult>;
|
|
1163
1183
|
}
|
|
1164
1184
|
interface GatewayProviderSettings {
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1185
|
+
/**
|
|
1186
|
+
* The base URL prefix for API calls. Defaults to `https://ai-gateway.vercel.sh/v4/ai`.
|
|
1187
|
+
*/
|
|
1188
|
+
baseURL?: string;
|
|
1189
|
+
/**
|
|
1190
|
+
* API key or Vercel access token that is being sent using the `Authorization`
|
|
1191
|
+
* header. It defaults to the `AI_GATEWAY_API_KEY` environment variable.
|
|
1192
|
+
*/
|
|
1193
|
+
apiKey?: string;
|
|
1194
|
+
/**
|
|
1195
|
+
* Vercel team ID or slug to scope requests for access tokens that can access
|
|
1196
|
+
* multiple teams.
|
|
1197
|
+
*/
|
|
1198
|
+
teamIdOrSlug?: string;
|
|
1199
|
+
/**
|
|
1200
|
+
* Custom headers to include in the requests.
|
|
1201
|
+
*/
|
|
1202
|
+
headers?: Record<string, string>;
|
|
1203
|
+
/**
|
|
1204
|
+
* Custom fetch implementation. You can use it as a middleware to intercept requests,
|
|
1205
|
+
* or to provide a custom fetch implementation for e.g. testing.
|
|
1206
|
+
*/
|
|
1207
|
+
fetch?: FetchFunction;
|
|
1208
|
+
/**
|
|
1209
|
+
* Custom WebSocket implementation used for streaming transcription. This is
|
|
1210
|
+
* useful for testing or for runtimes without a global WebSocket. A
|
|
1211
|
+
* header-capable implementation is not required — Gateway WebSocket auth is
|
|
1212
|
+
* carried in the subprotocols.
|
|
1213
|
+
*/
|
|
1214
|
+
webSocket?: WebSocketConstructor;
|
|
1215
|
+
/**
|
|
1216
|
+
* How frequently to refresh the metadata cache in milliseconds.
|
|
1217
|
+
*/
|
|
1218
|
+
metadataCacheRefreshMillis?: number;
|
|
1199
1219
|
}
|
|
1200
1220
|
/**
|
|
1201
1221
|
* Create a remote provider instance.
|
|
1202
1222
|
*/
|
|
1203
|
-
declare function createGateway(options?: GatewayProviderSettings): GatewayProvider;
|
|
1204
|
-
declare const gateway: GatewayProvider;
|
|
1205
|
-
|
|
1223
|
+
export declare function createGateway(options?: GatewayProviderSettings): GatewayProvider;
|
|
1224
|
+
export declare const gateway: GatewayProvider;
|
|
1225
|
+
//#endregion
|
|
1226
|
+
//#region src/gateway-provider-metadata.d.ts
|
|
1206
1227
|
/**
|
|
1207
1228
|
* Metadata for an asynchronous AI Gateway job.
|
|
1208
1229
|
*/
|
|
1209
1230
|
type GatewayAsyncJobMetadata = {
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1231
|
+
readonly jobId: string;
|
|
1232
|
+
readonly status: string;
|
|
1233
|
+
/**
|
|
1234
|
+
* Secret for verifying customer webhook deliveries. This is sensitive,
|
|
1235
|
+
* start-response-only metadata and must not be logged or forwarded.
|
|
1236
|
+
*/
|
|
1237
|
+
readonly webhookSigningSecret?: string;
|
|
1238
|
+
readonly [key: string]: JSONValue | undefined;
|
|
1218
1239
|
};
|
|
1219
1240
|
/**
|
|
1220
1241
|
* Shape of the inner `providerMetadata.gateway` object returned by AI Gateway
|
|
@@ -1223,319 +1244,330 @@ type GatewayAsyncJobMetadata = {
|
|
|
1223
1244
|
* Additional fields may be added without a package update.
|
|
1224
1245
|
*/
|
|
1225
1246
|
type GatewayProviderMetadata = {
|
|
1226
|
-
|
|
1227
|
-
|
|
1247
|
+
readonly asyncJob?: GatewayAsyncJobMetadata;
|
|
1248
|
+
readonly [key: string]: JSONValue | undefined;
|
|
1228
1249
|
};
|
|
1229
|
-
|
|
1250
|
+
//#endregion
|
|
1251
|
+
//#region src/gateway-provider-options.d.ts
|
|
1230
1252
|
/**
|
|
1231
1253
|
* A condition on the primary model's answers. `QUESTION_ID` narrows
|
|
1232
|
-
* `question` to your question IDs.
|
|
1233
|
-
*
|
|
1254
|
+
* `question` to your question IDs. Without `question`, `confidenceBelow`
|
|
1255
|
+
* checks every Choice and Score question and `probabilityBetween` every
|
|
1256
|
+
* Boolean question. Groups nest at most five levels deep, which the SDK
|
|
1257
|
+
* checks at runtime.
|
|
1234
1258
|
*/
|
|
1235
1259
|
type EvaluationFallbackCondition<QUESTION_ID extends string = string> = ExclusiveCondition<{
|
|
1236
|
-
|
|
1237
|
-
|
|
1260
|
+
question?: QUESTION_ID;
|
|
1261
|
+
confidenceBelow: number;
|
|
1238
1262
|
}> | ExclusiveCondition<{
|
|
1239
|
-
|
|
1240
|
-
|
|
1263
|
+
question?: QUESTION_ID;
|
|
1264
|
+
probabilityBetween: [number, number];
|
|
1241
1265
|
}> | ExclusiveCondition<{
|
|
1242
|
-
|
|
1266
|
+
any: EvaluationFallbackConditionList<QUESTION_ID>;
|
|
1243
1267
|
}> | ExclusiveCondition<{
|
|
1244
|
-
|
|
1268
|
+
all: EvaluationFallbackConditionList<QUESTION_ID>;
|
|
1245
1269
|
}> | ExclusiveCondition<{
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1270
|
+
atLeast: {
|
|
1271
|
+
count: number;
|
|
1272
|
+
conditions: EvaluationFallbackConditionList<QUESTION_ID>;
|
|
1273
|
+
};
|
|
1250
1274
|
}>;
|
|
1251
1275
|
type GatewayModelFallback<QUESTION_ID extends string = string> = string | {
|
|
1252
|
-
|
|
1253
|
-
|
|
1276
|
+
model: string;
|
|
1277
|
+
when: EvaluationFallbackCondition<QUESTION_ID>;
|
|
1254
1278
|
};
|
|
1255
1279
|
type GatewayProviderOptions<QUESTION_ID extends string = string> = {
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1280
|
+
/**
|
|
1281
|
+
* Service-owned options may be added by the Gateway without requiring an SDK
|
|
1282
|
+
* release. The Gateway service validates and applies the runtime schema.
|
|
1283
|
+
*/
|
|
1284
|
+
[key: string]: unknown;
|
|
1285
|
+
/** Request-scoped BYOK credentials to use instead of cached credentials. */
|
|
1286
|
+
byok?: Record<string, Array<Record<string, unknown>>>;
|
|
1287
|
+
/** Enables automatic caching behavior when supported by the Gateway. */
|
|
1288
|
+
caching?: 'auto';
|
|
1289
|
+
/** Filter to providers that do not train on prompt data. */
|
|
1290
|
+
disallowPromptTraining?: boolean;
|
|
1291
|
+
/**
|
|
1292
|
+
* Restrict routing to provider models that satisfy every given entry.
|
|
1293
|
+
*
|
|
1294
|
+
* Entries are capability tags (`'implicit-caching'`, `'reasoning'`,
|
|
1295
|
+
* `'tool-use'`, `'vision'` (image input), `'structured-output'`
|
|
1296
|
+
* (schema-constrained output)) or weight-format conditions:
|
|
1297
|
+
* `'quantization:fp8'` requires the serving provider to report that weight
|
|
1298
|
+
* format, `'!quantization:fp8'` excludes it (providers with no recorded
|
|
1299
|
+
* format still pass an exclusion). Format values are an open space but must
|
|
1300
|
+
* match `[a-zA-Z0-9._-]{1,32}` and compare case-insensitively. Unknown
|
|
1301
|
+
* capability names are rejected by the Gateway with a 400.
|
|
1302
|
+
*/
|
|
1303
|
+
has?: Array<'implicit-caching' | 'reasoning' | 'structured-output' | 'tool-use' | 'vision' | `quantization:${string}` | `!quantization:${string}`>;
|
|
1304
|
+
/**
|
|
1305
|
+
* Idempotency key for `experimental_startBatch`: retries with the same
|
|
1306
|
+
* key replay the original batch instead of creating a duplicate.
|
|
1307
|
+
*/
|
|
1308
|
+
idempotencyKey?: string;
|
|
1309
|
+
/**
|
|
1310
|
+
* Fallback models to try in order. On evaluation requests, the first entry
|
|
1311
|
+
* can be a conditional `{ model, when }` fallback that reruns the evaluation
|
|
1312
|
+
* when `when` matches the primary answers. Other request types reject a
|
|
1313
|
+
* conditional entry. Pass your question IDs as `QUESTION_ID` to check the
|
|
1314
|
+
* `question` names in `when`.
|
|
1315
|
+
*/
|
|
1316
|
+
models?: GatewayModelFallbackList<QUESTION_ID>;
|
|
1317
|
+
/** Array of provider slugs that are the only ones allowed to be used. */
|
|
1318
|
+
only?: string[];
|
|
1319
|
+
/** Array of provider slugs specifying the provider attempt order. */
|
|
1320
|
+
order?: string[];
|
|
1321
|
+
/** Per-provider timeouts for BYOK credentials in milliseconds. */
|
|
1322
|
+
providerTimeouts?: {
|
|
1323
|
+
byok?: Record<string, number>;
|
|
1324
|
+
};
|
|
1325
|
+
/** Entity identifier against which quota is tracked. */
|
|
1326
|
+
quotaEntityId?: string;
|
|
1327
|
+
/** Unified service tier intent. */
|
|
1328
|
+
serviceTier?: 'flex' | 'priority';
|
|
1329
|
+
/** Sort providers by a performance or cost metric before routing. */
|
|
1330
|
+
sort?: 'cost' | 'tps' | 'ttft';
|
|
1331
|
+
/** User-specified tags for reporting and filtering usage. */
|
|
1332
|
+
tags?: string[];
|
|
1333
|
+
/** End-user identifier for spend tracking and attribution. */
|
|
1334
|
+
user?: string;
|
|
1335
|
+
/** Filter to providers with zero data retention agreements. */
|
|
1336
|
+
zeroDataRetention?: boolean;
|
|
1313
1337
|
};
|
|
1314
|
-
type EvaluationFallbackConditionList<QUESTION_ID extends string> = [
|
|
1315
|
-
EvaluationFallbackCondition<QUESTION_ID>,
|
|
1316
|
-
...EvaluationFallbackCondition<QUESTION_ID>[]
|
|
1317
|
-
];
|
|
1338
|
+
type EvaluationFallbackConditionList<QUESTION_ID extends string> = [EvaluationFallbackCondition<QUESTION_ID>, ...EvaluationFallbackCondition<QUESTION_ID>[]];
|
|
1318
1339
|
type ConditionKey = 'question' | 'confidenceBelow' | 'probabilityBetween' | 'any' | 'all' | 'atLeast';
|
|
1319
|
-
type ExclusiveCondition<CONDITION> = CONDITION & {
|
|
1320
|
-
[KEY in Exclude<ConditionKey, keyof CONDITION>]?: never;
|
|
1321
|
-
};
|
|
1340
|
+
type ExclusiveCondition<CONDITION> = CONDITION & { [KEY in Exclude<ConditionKey, keyof CONDITION>]?: never; };
|
|
1322
1341
|
type ConditionalGatewayModelFallback<QUESTION_ID extends string> = Exclude<GatewayModelFallback<QUESTION_ID>, string>;
|
|
1323
1342
|
type GatewayModelFallbackList<QUESTION_ID extends string> = string[] | [ConditionalGatewayModelFallback<QUESTION_ID>, ...string[]];
|
|
1324
|
-
|
|
1343
|
+
//#endregion
|
|
1344
|
+
//#region src/errors/gateway-error.d.ts
|
|
1325
1345
|
declare const symbol$9: unique symbol;
|
|
1326
|
-
declare abstract class GatewayError extends Error {
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1346
|
+
export declare abstract class GatewayError extends Error {
|
|
1347
|
+
private readonly [symbol$9];
|
|
1348
|
+
abstract readonly name: string;
|
|
1349
|
+
abstract readonly type: string;
|
|
1350
|
+
readonly statusCode: number;
|
|
1351
|
+
readonly cause?: unknown;
|
|
1352
|
+
readonly generationId?: string;
|
|
1353
|
+
readonly isRetryable: boolean;
|
|
1354
|
+
constructor({ message, statusCode, cause, generationId, isRetryable }: {
|
|
1355
|
+
message: string;
|
|
1356
|
+
statusCode?: number;
|
|
1357
|
+
cause?: unknown;
|
|
1358
|
+
generationId?: string;
|
|
1359
|
+
isRetryable?: boolean;
|
|
1360
|
+
});
|
|
1361
|
+
/**
|
|
1362
|
+
* Checks if the given error is a Gateway Error.
|
|
1363
|
+
* @param {unknown} error - The error to check.
|
|
1364
|
+
* @returns {boolean} True if the error is a Gateway Error, false otherwise.
|
|
1365
|
+
*/
|
|
1366
|
+
static isInstance(error: unknown): error is GatewayError;
|
|
1367
|
+
static hasMarker(error: unknown): error is GatewayError;
|
|
1348
1368
|
}
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1369
|
+
//#endregion
|
|
1370
|
+
//#region src/errors/create-gateway-error.d.ts
|
|
1371
|
+
declare const gatewayErrorResponseSchema: import("@ai-sdk/provider-utils").LazySchema<{
|
|
1372
|
+
error: {
|
|
1373
|
+
message: string;
|
|
1374
|
+
type?: string | null | undefined;
|
|
1375
|
+
param?: unknown;
|
|
1376
|
+
code?: string | number | null | undefined;
|
|
1377
|
+
};
|
|
1378
|
+
generationId?: string | null | undefined;
|
|
1358
1379
|
}>;
|
|
1359
1380
|
type GatewayErrorResponse = InferSchema<typeof gatewayErrorResponseSchema>;
|
|
1360
|
-
|
|
1381
|
+
//#endregion
|
|
1382
|
+
//#region src/errors/gateway-authentication-error.d.ts
|
|
1361
1383
|
declare const symbol$8: unique symbol;
|
|
1362
1384
|
/**
|
|
1363
1385
|
* Authentication failed - invalid API key or OIDC token
|
|
1364
1386
|
*/
|
|
1365
|
-
declare class GatewayAuthenticationError extends GatewayError {
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
+
export declare class GatewayAuthenticationError extends GatewayError {
|
|
1388
|
+
private readonly [symbol$8];
|
|
1389
|
+
readonly name = "GatewayAuthenticationError";
|
|
1390
|
+
readonly type = "authentication_error";
|
|
1391
|
+
constructor({ message, statusCode, cause, generationId }?: {
|
|
1392
|
+
message?: string;
|
|
1393
|
+
statusCode?: number;
|
|
1394
|
+
cause?: unknown;
|
|
1395
|
+
generationId?: string;
|
|
1396
|
+
});
|
|
1397
|
+
static isInstance(error: unknown): error is GatewayAuthenticationError;
|
|
1398
|
+
/**
|
|
1399
|
+
* Creates a contextual error message when authentication fails
|
|
1400
|
+
*/
|
|
1401
|
+
static createContextualError({ apiKeyProvided, oidcTokenProvided, statusCode, cause, generationId }: {
|
|
1402
|
+
apiKeyProvided: boolean;
|
|
1403
|
+
oidcTokenProvided: boolean;
|
|
1404
|
+
message?: string;
|
|
1405
|
+
statusCode?: number;
|
|
1406
|
+
cause?: unknown;
|
|
1407
|
+
generationId?: string;
|
|
1408
|
+
}): GatewayAuthenticationError;
|
|
1387
1409
|
}
|
|
1388
|
-
|
|
1410
|
+
//#endregion
|
|
1411
|
+
//#region src/errors/gateway-failed-dependency-error.d.ts
|
|
1389
1412
|
declare const symbol$7: unique symbol;
|
|
1390
1413
|
/**
|
|
1391
1414
|
* The request could not be fulfilled because a dependency it relied on was not
|
|
1392
1415
|
* available on the credentials or provider used to serve it (HTTP 424). Not
|
|
1393
1416
|
* retryable — the caller must change the request.
|
|
1394
1417
|
*/
|
|
1395
|
-
declare class GatewayFailedDependencyError extends GatewayError {
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1418
|
+
export declare class GatewayFailedDependencyError extends GatewayError {
|
|
1419
|
+
private readonly [symbol$7];
|
|
1420
|
+
readonly name = "GatewayFailedDependencyError";
|
|
1421
|
+
readonly type = "failed_dependency";
|
|
1422
|
+
constructor({ message, statusCode, cause, generationId }?: {
|
|
1423
|
+
message?: string;
|
|
1424
|
+
statusCode?: number;
|
|
1425
|
+
cause?: unknown;
|
|
1426
|
+
generationId?: string;
|
|
1427
|
+
});
|
|
1428
|
+
static isInstance(error: unknown): error is GatewayFailedDependencyError;
|
|
1406
1429
|
}
|
|
1407
|
-
|
|
1430
|
+
//#endregion
|
|
1431
|
+
//#region src/errors/gateway-forbidden-error.d.ts
|
|
1408
1432
|
declare const symbol$6: unique symbol;
|
|
1409
1433
|
/**
|
|
1410
1434
|
* Forbidden - the request was rejected by policy (e.g. a routing rule),
|
|
1411
1435
|
* not an authentication failure.
|
|
1412
1436
|
*/
|
|
1413
|
-
declare class GatewayForbiddenError extends GatewayError {
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1437
|
+
export declare class GatewayForbiddenError extends GatewayError {
|
|
1438
|
+
private readonly [symbol$6];
|
|
1439
|
+
readonly name = "GatewayForbiddenError";
|
|
1440
|
+
readonly type = "forbidden";
|
|
1441
|
+
readonly ruleId?: string;
|
|
1442
|
+
constructor({ message, statusCode, cause, generationId, ruleId }?: {
|
|
1443
|
+
message?: string;
|
|
1444
|
+
statusCode?: number;
|
|
1445
|
+
cause?: unknown;
|
|
1446
|
+
generationId?: string;
|
|
1447
|
+
ruleId?: string;
|
|
1448
|
+
});
|
|
1449
|
+
static isInstance(error: unknown): error is GatewayForbiddenError;
|
|
1426
1450
|
}
|
|
1427
|
-
|
|
1451
|
+
//#endregion
|
|
1452
|
+
//#region src/errors/gateway-internal-server-error.d.ts
|
|
1428
1453
|
declare const symbol$5: unique symbol;
|
|
1429
1454
|
/**
|
|
1430
1455
|
* Internal server error from the Gateway
|
|
1431
1456
|
*/
|
|
1432
|
-
declare class GatewayInternalServerError extends GatewayError {
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1457
|
+
export declare class GatewayInternalServerError extends GatewayError {
|
|
1458
|
+
private readonly [symbol$5];
|
|
1459
|
+
readonly name = "GatewayInternalServerError";
|
|
1460
|
+
readonly type = "internal_server_error";
|
|
1461
|
+
constructor({ message, statusCode, cause, generationId }?: {
|
|
1462
|
+
message?: string;
|
|
1463
|
+
statusCode?: number;
|
|
1464
|
+
cause?: unknown;
|
|
1465
|
+
generationId?: string;
|
|
1466
|
+
});
|
|
1467
|
+
static isInstance(error: unknown): error is GatewayInternalServerError;
|
|
1443
1468
|
}
|
|
1444
|
-
|
|
1469
|
+
//#endregion
|
|
1470
|
+
//#region src/errors/gateway-invalid-request-error.d.ts
|
|
1445
1471
|
declare const symbol$4: unique symbol;
|
|
1446
1472
|
/**
|
|
1447
1473
|
* Invalid request - missing headers, malformed data, etc.
|
|
1448
1474
|
*/
|
|
1449
|
-
declare class GatewayInvalidRequestError extends GatewayError {
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1475
|
+
export declare class GatewayInvalidRequestError extends GatewayError {
|
|
1476
|
+
private readonly [symbol$4];
|
|
1477
|
+
readonly name = "GatewayInvalidRequestError";
|
|
1478
|
+
readonly type = "invalid_request_error";
|
|
1479
|
+
constructor({ message, statusCode, cause, generationId }?: {
|
|
1480
|
+
message?: string;
|
|
1481
|
+
statusCode?: number;
|
|
1482
|
+
cause?: unknown;
|
|
1483
|
+
generationId?: string;
|
|
1484
|
+
});
|
|
1485
|
+
static isInstance(error: unknown): error is GatewayInvalidRequestError;
|
|
1460
1486
|
}
|
|
1461
|
-
|
|
1487
|
+
//#endregion
|
|
1488
|
+
//#region src/errors/gateway-model-not-found-error.d.ts
|
|
1462
1489
|
declare const symbol$3: unique symbol;
|
|
1463
1490
|
/**
|
|
1464
1491
|
* Model not found or not available
|
|
1465
1492
|
*/
|
|
1466
|
-
declare class GatewayModelNotFoundError extends GatewayError {
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1493
|
+
export declare class GatewayModelNotFoundError extends GatewayError {
|
|
1494
|
+
private readonly [symbol$3];
|
|
1495
|
+
readonly name = "GatewayModelNotFoundError";
|
|
1496
|
+
readonly type = "model_not_found";
|
|
1497
|
+
readonly modelId?: string;
|
|
1498
|
+
constructor({ message, statusCode, modelId, cause, generationId }?: {
|
|
1499
|
+
message?: string;
|
|
1500
|
+
statusCode?: number;
|
|
1501
|
+
modelId?: string;
|
|
1502
|
+
cause?: unknown;
|
|
1503
|
+
generationId?: string;
|
|
1504
|
+
});
|
|
1505
|
+
static isInstance(error: unknown): error is GatewayModelNotFoundError;
|
|
1479
1506
|
}
|
|
1480
|
-
|
|
1507
|
+
//#endregion
|
|
1508
|
+
//#region src/errors/gateway-not-found-error.d.ts
|
|
1481
1509
|
declare const symbol$2: unique symbol;
|
|
1482
1510
|
/**
|
|
1483
1511
|
* Not found - the requested Gateway resource does not exist or is not
|
|
1484
1512
|
* visible to the caller (e.g. an unknown async batch/video job id).
|
|
1485
1513
|
* Distinct from `GatewayModelNotFoundError`, which is model-specific.
|
|
1486
1514
|
*/
|
|
1487
|
-
declare class GatewayNotFoundError extends GatewayError {
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1515
|
+
export declare class GatewayNotFoundError extends GatewayError {
|
|
1516
|
+
private readonly [symbol$2];
|
|
1517
|
+
readonly name = "GatewayNotFoundError";
|
|
1518
|
+
readonly type = "not_found";
|
|
1519
|
+
constructor({ message, statusCode, cause, generationId }?: {
|
|
1520
|
+
message?: string;
|
|
1521
|
+
statusCode?: number;
|
|
1522
|
+
cause?: unknown;
|
|
1523
|
+
generationId?: string;
|
|
1524
|
+
});
|
|
1525
|
+
static isInstance(error: unknown): error is GatewayNotFoundError;
|
|
1498
1526
|
}
|
|
1499
|
-
|
|
1527
|
+
//#endregion
|
|
1528
|
+
//#region src/errors/gateway-rate-limit-error.d.ts
|
|
1500
1529
|
declare const symbol$1: unique symbol;
|
|
1501
1530
|
/**
|
|
1502
1531
|
* Rate limit exceeded.
|
|
1503
1532
|
*/
|
|
1504
|
-
declare class GatewayRateLimitError extends GatewayError {
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1533
|
+
export declare class GatewayRateLimitError extends GatewayError {
|
|
1534
|
+
private readonly [symbol$1];
|
|
1535
|
+
readonly name = "GatewayRateLimitError";
|
|
1536
|
+
readonly type = "rate_limit_exceeded";
|
|
1537
|
+
constructor({ message, statusCode, cause, generationId }?: {
|
|
1538
|
+
message?: string;
|
|
1539
|
+
statusCode?: number;
|
|
1540
|
+
cause?: unknown;
|
|
1541
|
+
generationId?: string;
|
|
1542
|
+
});
|
|
1543
|
+
static isInstance(error: unknown): error is GatewayRateLimitError;
|
|
1515
1544
|
}
|
|
1516
|
-
|
|
1545
|
+
//#endregion
|
|
1546
|
+
//#region src/errors/gateway-response-error.d.ts
|
|
1517
1547
|
declare const symbol: unique symbol;
|
|
1518
1548
|
/**
|
|
1519
1549
|
* Gateway response parsing error
|
|
1520
1550
|
*/
|
|
1521
|
-
declare class GatewayResponseError extends GatewayError {
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1551
|
+
export declare class GatewayResponseError extends GatewayError {
|
|
1552
|
+
private readonly [symbol];
|
|
1553
|
+
readonly name = "GatewayResponseError";
|
|
1554
|
+
readonly type = "response_error";
|
|
1555
|
+
readonly response?: unknown;
|
|
1556
|
+
readonly validationError?: TypeValidationError;
|
|
1557
|
+
constructor({ message, statusCode, response, validationError, cause, generationId, isRetryable }?: {
|
|
1558
|
+
message?: string;
|
|
1559
|
+
statusCode?: number;
|
|
1560
|
+
response?: unknown;
|
|
1561
|
+
validationError?: TypeValidationError;
|
|
1562
|
+
cause?: unknown;
|
|
1563
|
+
generationId?: string;
|
|
1564
|
+
isRetryable?: boolean;
|
|
1565
|
+
});
|
|
1566
|
+
static isInstance(error: unknown): error is GatewayResponseError;
|
|
1537
1567
|
}
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1568
|
+
//#endregion
|
|
1569
|
+
//#region src/version.d.ts
|
|
1570
|
+
export declare const VERSION: string;
|
|
1571
|
+
//#endregion
|
|
1572
|
+
export { type EvaluationFallbackCondition, type GatewayAsyncJobMetadata, type GatewayCreditsResponse, type GatewayEmbeddingModelId, type GatewayErrorResponse, type GatewayEvaluationModelId, type GatewayGenerationInfo, type GatewayGenerationInfoParams, type GatewayImageModelId, type GatewayLanguageModelEntry, type GatewayLanguageModelEntry as GatewayModelEntry, type GatewayProviderOptions as GatewayLanguageModelOptions, type GatewayProviderOptions, type GatewayLanguageModelSpecification, type GatewayModelFallback, type GatewayModelId, type GatewayProvider, type GatewayProviderMetadata, type GatewayProviderSettings, type GatewayRealtimeModelId, type GatewayRerankingModelId, type GatewaySpeechModelId, type GatewaySpendReportParams, type GatewaySpendReportResponse, type GatewaySpendReportRow, type GatewayTranscriptionModelId, type GatewayVideoModelId, createGateway as createGatewayProvider };
|
|
1573
|
+
//# sourceMappingURL=index.d.ts.map
|