Web search #
The web-search extension supplies the Python kernel's web_search function.
It delegates searches to eligible provider extensions. See
extension.gleam
and the web client.
Search interface #
await web_search(query, limit=8) returns a record with answer and sources.
Each source has title, url, snippet, and published. The host rejects a
blank query and limits outside 1 through 50.
web_search.py formats the result and
records a web trace activity. The provider response is external content.
Provider order #
order.gleam
reads order and off from the web-search settings section. Named providers
come first in saved order. Omitted providers follow in registry order. Providers
in off are skipped.
search
tries the next provider when one fails or returns an empty answer and no
sources. If none answers, it returns an unavailable error with the failures or
an instruction to enable a provider.
The Claude adapter
requires a server tool call named web_search before it accepts the answer. It
lists cited sources first, followed by search results in stream order. It keeps
the first source for each URL and applies the caller's limit.
Settings service #
service.gleam
exposes /extensions/web-search/providers and provider changes. The
/web-search command opens the provider selection in the
terminal client. The web client has a corresponding settings section.
Provider availability depends on the extensions loaded for the session.