SearchBackend

A web_search backend adapter (Exa, Brave, Tavily).

A protocol: adapters implement it.

Methods

Search the web for a query and return hits. The framework applies the domain filters again to what you return, parses every hit, and shows them to the model as untrusted reference.

search(query: string, options?: {
  allowedDomains?: readonly string[];
  blockedDomains?: readonly string[];
}): Promise<Result<readonly SearchHit[]>>
querystringrequired

The search text, as the model wrote it in web_search.

allowedDomains / allowed_domainsreadonly string[]

Return only hits on these hosts or their subdomains (a leading *. and case are ignored). Omitted or empty: no restriction.

blockedDomains / blocked_domainsreadonly string[]

Drop hits on these hosts or their subdomains (a leading *. and case are ignored). Omitted or empty: block nothing.

Returns an error value with one of these codes: unavailable, timeout.

Edit on GitHub

On this page