Omni.Tools.WebSearch.Providers.Brave (Omni Tools v0.3.0)

Copy Markdown View Source

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:

  1. Explicit :api_key in provider opts
  2. Application config: config :omni_tools, Providers.Brave, api_key: "..."
  3. 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 — optional Req.Request struct 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.