Skip to main content

Module web_search

Module web_search 

Source
Expand description

Web search tool.

Tries backends in order of result quality, using the first one configured:

  1. SearXNG (SEARXNG_URL) — a self-hosted metasearch instance. Full web results, no third-party key, nothing leaves the machine except the query.
  2. DuckDuckGo — keyless, always available. Reads the lite result page for a ranked list, and falls back to the Instant Answer API when that page is unavailable.
  3. Perplexity (PERPLEXITY_API_KEY) — paid, kept for existing setups.

The lite endpoint answers 202 with a challenge stub to clients that do not look like browsers, so the request carries browser headers. That is a best-effort path by nature: when it is refused the Instant Answer API still answers “what is X”, but only a SearXNG instance gives durable result lists.

Structs§

WebSearchTool

Enums§

Backend
Search backends, most preferred first.