Brave Search provider for Omni.Tools.WebSearch.
Uses the Brave Web Search API.
# Uses BRAVE_API_KEY env var by default
Omni.Tools.WebSearch.new(provider: Omni.Tools.WebSearch.Providers.Brave)
# Explicit API key
Omni.Tools.WebSearch.new(
provider: {Omni.Tools.WebSearch.Providers.Brave, api_key: "..."}
)
# Custom env var
Omni.Tools.WebSearch.new(
provider: {Omni.Tools.WebSearch.Providers.Brave, api_key: {:system, "MY_BRAVE_KEY"}}
)API key resolution
The :api_key option accepts a string or a {:system, env_var} tuple.
The default is {:system, "BRAVE_API_KEY"}. Resolution order:
- Explicit
:api_keyin provider opts - Application config:
config :omni_tools, Providers.Brave, api_key: "..." - Module default:
{:system, "BRAVE_API_KEY"}
Options
:api_key— Brave Search API subscription token. A string or{:system, env_var}tuple. Default:{:system, "BRAVE_API_KEY"}.:req— optionalReq.Requeststruct for transport customisation.
Any additional options are passed through as query parameters to the
Brave API (e.g. country: "GB", safesearch: "strict",
search_lang: "en"). See the Brave API docs for available parameters.