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

Copy Markdown View Source

Tavily Search provider for Omni.Tools.WebSearch.

Uses the Tavily Search API.

# Uses TAVILY_API_KEY env var by default
Omni.Tools.WebSearch.new(provider: Omni.Tools.WebSearch.Providers.Tavily)

# Explicit API key
Omni.Tools.WebSearch.new(
  provider: {Omni.Tools.WebSearch.Providers.Tavily, api_key: "..."}
)

# Custom env var
Omni.Tools.WebSearch.new(
  provider: {Omni.Tools.WebSearch.Providers.Tavily, api_key: {:system, "MY_TAVILY_KEY"}}
)

API key resolution

The :api_key option accepts a string or a {:system, env_var} tuple. The default is {:system, "TAVILY_API_KEY"}. Resolution order:

  1. Explicit :api_key in provider opts
  2. Application config: config :omni_tools, Provider.Tavily, api_key: "..."
  3. Module default: {:system, "TAVILY_API_KEY"}

Options

  • :api_key — Tavily API key. A string or {:system, env_var} tuple. Default: {:system, "TAVILY_API_KEY"}.
  • :req — optional Req.Request struct for transport customisation.

Any additional options are passed through in the JSON request body (e.g. topic: "news", search_depth: "advanced", include_domains: ["example.com"]). See the Tavily API docs for available parameters.