An Omni.Tool for searching the web via configurable providers.
Executes a web search query and returns results formatted for LLM
consumption. The search backend is pluggable — any module implementing
Omni.Tools.WebSearch.Provider can be used.
tool = Omni.Tools.WebSearch.new(
provider: {MyApp.BraveProvider, api_key: "..."}
)Providers
A provider is a module implementing the Omni.Tools.WebSearch.Provider
behaviour. It receives the query and options (including :num_results
and :recency when supplied by the model) and returns structured
results.
See Omni.Tools.WebSearch.Provider for details on implementing your
own provider.
Options
:provider— (required) a provider module or{module, opts}tuple.
Application config
Any option can be set under the module key in application config —
instance opts to new/1 take precedence. See Omni.Tools for details.
config :omni_tools, Omni.Tools.WebSearch,
provider: Omni.Tools.WebSearch.Providers.BraveProviders support application config for :api_key only — see each
provider module for details.
Summary
Functions
Builds a %Omni.Tool{} struct with a bound handler.