Serper provider for Omni.Tools.WebSearch.
Uses the Serper Google Search API.
# Uses SERPER_API_KEY env var by default
Omni.Tools.WebSearch.new(provider: Omni.Tools.WebSearch.Providers.Serper)
# Explicit API key
Omni.Tools.WebSearch.new(
provider: {Omni.Tools.WebSearch.Providers.Serper, api_key: "..."}
)
# Custom env var
Omni.Tools.WebSearch.new(
provider: {Omni.Tools.WebSearch.Providers.Serper, api_key: {:system, "MY_SERPER_KEY"}}
)API key resolution
The :api_key option accepts a string or a {:system, env_var} tuple.
The default is {:system, "SERPER_API_KEY"}. Resolution order:
- Explicit
:api_keyin provider opts - Application config:
config :omni_tools, Provider.Serper, api_key: "..." - Module default:
{:system, "SERPER_API_KEY"}
Options
:api_key— Serper API key. A string or{:system, env_var}tuple. Default:{:system, "SERPER_API_KEY"}.:req— optionalReq.Requeststruct for transport customisation.
Any additional options are passed through in the JSON request body
(e.g. gl: "uk", hl: "en", location: "London"). See the Serper
API docs for available parameters.