WebSearchConfig class final

Configuration for webSearchTool and webFetchTool.

Constructors

WebSearchConfig({List<String> providers = const ['auto'], SecretsStore? secrets, Client? httpClient, CubeNetworkGate? networkGate, Duration timeout = const Duration(seconds: 20), int maxResults = defaultWebSearchCount, List<WebSiteHandler>? siteHandlers, int maxFetchBytes = 2 * 1024 * 1024, int maxFetchChars = 50 * 1024})
Creates a configuration. All defaults yield a keyless DuckDuckGo-only chain; keyed providers join the auto chain when their key is present in secrets.
const

Properties

effectiveSiteHandlers → List<WebSiteHandler>
Handlers with the default applied.
no setter
hashCode → int
The hash code for this object.
no setterinherited
httpClient → Client?
HTTP client override (tests inject a MockClient).
final
maxFetchBytes → int
Network read cap for web_fetch page bodies.
final
maxFetchChars → int
Output cap for web_fetch markdown.
final
maxResults → int
Default result count when the tool call omits count.
final
networkGate → CubeNetworkGate?
The cube network gate for model-invoked web egress (issue #682). Null — no cube — is allow-all: requests ride the unwrapped client, byte-identical to pre-gate runs.
final
providers → List<String>
Ordered provider ids (duckduckgo, brave, tavily) or auto for the default chain. Keyed providers are skipped unless their key is in secrets.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
secrets → SecretsStore?
Read-only source of API keys (BRAVE_API_KEY, TAVILY_API_KEY). Values never appear in tool output.
final
siteHandlers → List<WebSiteHandler>?
Site-specific extraction handlers for web_fetch, tried before the generic HTML→markdown converter. Defaults to defaultWebSiteHandlers (pub.dev).
final
timeout → Duration
Per-request timeout for search and fetch calls.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
withNetworkGate(CubeNetworkGate? gate) → WebSearchConfig
Returns a copy bound to gate; this when the gate is unchanged.

Operators

operator ==(Object other) → bool
The equality operator.
inherited