exa

A web_search backend that searches with Exa (exa.ai).

Pass it as agent({web: {search: exa(secret("EXA_API_KEY"))}}). It returns at most 10 hits per search.

Import from @threads/core (TypeScript) or threads.search (Python).

function exa(apiKey: Secret, transport?: WebTransport): SearchBackend

Parameters

apiKey / api_keySecretrequired

A secret() naming the host environment variable that holds the Exa API key. It is resolved on the host at setup (check() or the first run): an unset variable is missing_secret naming it, before anything runs. A search sent without setup reads it then, and an unset variable fails that search as unavailable. See Secret.

transportWebTransport

TypeScript only. Seam: where the request is sent, for tests. Omitted: the host's live web transport, which vets each address before it connects.

Returns

SearchBackend

Throws ConfigError with one of these codes: missing_secret.

Edit on GitHub

On this page