Provider-neutral web search and fetch API exposed to eval as Web.
Web.search/2 and Web.fetch/2 keep agent-facing code stable while concrete
providers handle vendor-specific APIs. Exa is the default search provider; a
local Req implementation is the default fetch provider.
Summary
Functions
Fetches a URL through the configured fetch provider.
Raises on URL fetch errors.
Filters search results to URLs containing a domain substring.
Parses HTML from a fetch result or binary string with Floki.
Parses HTML from a fetch result or binary string with Floki, raising on failure.
Searches the web through the configured search provider.
Raises on web search errors.
Extracts matching HTML from a fetched page with a CSS selector.
Extracts matching HTML from a fetched page with a CSS selector, raising on failure.
Keeps at most count search results.
Truncates fetched content or plain text using the shared tool-output byte limit.
Types
@type fetch_result() :: Vibe.WebTools.FetchResult.t()
@type search_result() :: Vibe.WebTools.SearchResult.t()
Functions
@spec fetch( String.t(), keyword() ) :: {:ok, Vibe.WebTools.FetchResult.t()} | {:error, term()}
Fetches a URL through the configured fetch provider.
@spec fetch!( String.t(), keyword() ) :: Vibe.WebTools.FetchResult.t()
Raises on URL fetch errors.
@spec filter_domain( {:ok, Vibe.WebTools.SearchResult.t()} | Vibe.WebTools.SearchResult.t(), String.t() ) :: {:ok, Vibe.WebTools.SearchResult.t()} | Vibe.WebTools.SearchResult.t()
Filters search results to URLs containing a domain substring.
@spec parse_html(Vibe.WebTools.FetchResult.t() | String.t()) :: {:ok, Vibe.WebTools.HTML.html_tree()} | {:error, term()}
Parses HTML from a fetch result or binary string with Floki.
@spec parse_html!(Vibe.WebTools.FetchResult.t() | String.t()) :: Vibe.WebTools.HTML.html_tree()
Parses HTML from a fetch result or binary string with Floki, raising on failure.
@spec search( String.t(), keyword() ) :: {:ok, Vibe.WebTools.SearchResult.t()} | {:error, term()}
Searches the web through the configured search provider.
@spec search!( String.t(), keyword() ) :: Vibe.WebTools.SearchResult.t()
Raises on web search errors.
@spec select(Vibe.WebTools.FetchResult.t(), String.t()) :: {:ok, Vibe.WebTools.FetchResult.t()} | {:error, term()}
Extracts matching HTML from a fetched page with a CSS selector.
@spec select!(Vibe.WebTools.FetchResult.t(), String.t()) :: Vibe.WebTools.FetchResult.t()
Extracts matching HTML from a fetched page with a CSS selector, raising on failure.
@spec take( {:ok, Vibe.WebTools.SearchResult.t()} | Vibe.WebTools.SearchResult.t(), non_neg_integer() ) :: {:ok, Vibe.WebTools.SearchResult.t()} | Vibe.WebTools.SearchResult.t()
Keeps at most count search results.
@spec truncate(Vibe.WebTools.FetchResult.t(), keyword() | pos_integer()) :: Vibe.WebTools.FetchResult.t()
@spec truncate(String.t(), keyword() | pos_integer()) :: String.t()
Truncates fetched content or plain text using the shared tool-output byte limit.