data/tools/web_search_tool library

Classes

SearchProgress
Search progress event.
SearchQueryUpdate
SearchResult
A single search result.
SearchResultsReceived
WebSearchInput
Web search input.
WebSearchOutput
Web search output.

Constants

maxSearchesPerQuery → const int
Maximum searches per query.
maxSearchOutputLength → const int
Maximum result output length.

Functions

isWebSearchEnabled(ApiProviderType provider, String modelName) bool
Check if web search is enabled for a given API provider.
makeSearchToolSchema({List<String>? allowedDomains, List<String>? blockedDomains}) Map<String, dynamic>
Web search tool schema for API providers that support native search.
processSearchResponse(String originalQuery, List<Map<String, dynamic>> contentBlocks, double durationSeconds) WebSearchOutput
Process search results from an API response containing web_search_tool_result blocks.
validateSearchInput(WebSearchInput input) String?
Validate web search input.
webSearchSystemPrompt() String
System prompt for web search.