Web search plugin and provider-neutral eval API exposed as Web.
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.Plugins.WebSearch.FetchResult.t()
@type search_result() :: Vibe.Plugins.WebSearch.SearchResult.t()
Functions
@spec fetch( String.t(), keyword() ) :: {:ok, Vibe.Plugins.WebSearch.FetchResult.t()} | {:error, term()}
Fetches a URL through the configured fetch provider.
@spec fetch!( String.t(), keyword() ) :: Vibe.Plugins.WebSearch.FetchResult.t()
Raises on URL fetch errors.
@spec filter_domain( {:ok, Vibe.Plugins.WebSearch.SearchResult.t()} | Vibe.Plugins.WebSearch.SearchResult.t(), String.t() ) :: {:ok, Vibe.Plugins.WebSearch.SearchResult.t()} | Vibe.Plugins.WebSearch.SearchResult.t()
Filters search results to URLs containing a domain substring.
@spec parse_html(Vibe.Plugins.WebSearch.FetchResult.t() | String.t()) :: {:ok, Vibe.Plugins.WebSearch.HTML.html_tree()} | {:error, term()}
Parses HTML from a fetch result or binary string with Floki.
@spec parse_html!(Vibe.Plugins.WebSearch.FetchResult.t() | String.t()) :: Vibe.Plugins.WebSearch.HTML.html_tree()
Parses HTML from a fetch result or binary string with Floki, raising on failure.
@spec search( String.t(), keyword() ) :: {:ok, Vibe.Plugins.WebSearch.SearchResult.t()} | {:error, term()}
Searches the web through the configured search provider.
@spec search!( String.t(), keyword() ) :: Vibe.Plugins.WebSearch.SearchResult.t()
Raises on web search errors.
@spec select(Vibe.Plugins.WebSearch.FetchResult.t(), String.t()) :: {:ok, Vibe.Plugins.WebSearch.FetchResult.t()} | {:error, term()}
Extracts matching HTML from a fetched page with a CSS selector.
@spec select!(Vibe.Plugins.WebSearch.FetchResult.t(), String.t()) :: Vibe.Plugins.WebSearch.FetchResult.t()
Extracts matching HTML from a fetched page with a CSS selector, raising on failure.
@spec take( {:ok, Vibe.Plugins.WebSearch.SearchResult.t()} | Vibe.Plugins.WebSearch.SearchResult.t(), non_neg_integer() ) :: {:ok, Vibe.Plugins.WebSearch.SearchResult.t()} | Vibe.Plugins.WebSearch.SearchResult.t()
Keeps at most count search results.
@spec truncate(Vibe.Plugins.WebSearch.FetchResult.t(), keyword() | pos_integer()) :: Vibe.Plugins.WebSearch.FetchResult.t()
@spec truncate(String.t(), keyword() | pos_integer()) :: String.t()
Truncates fetched content or plain text using the shared tool-output byte limit.