Class WebSearchTool.Options
Configuration options for WebSearchTool.
public sealed class WebSearchTool.Options
- Inheritance
-
WebSearchTool.Options
- Inherited Members
Properties
- ApiKey
Gets or sets the API key for providers that require authentication. Required for: Brave, Tavily, Serper.
- BaseUrl
Gets or sets the base URL for SearXNG or Custom providers.
For SearXNG: The instance URL (e.g., "https://searx.be"). For Custom: Use placeholders {query}, {maxResults}, and optionally {freshness} (replaced with day, week, month, or empty when unrestricted).
- CacheTtl
Gets or sets how long a completed search may answer an identical request (same provider, query, result count, and freshness window) from memory instead of re-querying the provider. Default is 5 minutes; Zero disables caching.
Agents commonly retry or loop around the same query, and the keyless DuckDuckGo endpoint rate-limits aggressively, so a short cache both speeds agent loops and protects access.
- DefaultMaxResults
Gets or sets the default maximum results. Default is 5.
- MaxSnippetLength
Gets or sets the maximum snippet length in characters. Default is 2048.
Set to a lower value (e.g., 500) for shorter snippets in simple tasks. Set to 0 or negative for unlimited length (not recommended for most use cases).
- SearchProvider
Gets or sets the search provider. Default is DuckDuckGo.
- Timeout
Gets or sets the request timeout. Default is 15 seconds.
- UserAgent
Gets or sets the User-Agent header for requests.