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:
- Explicit
:api_keyin provider opts - Application config:
config :omni_tools, Provider.Tavily, api_key: "..." - 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— optionalReq.Requeststruct 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.