
Web Search
The retrieval.webSearch
executes a web search using Tavily or the Bing Web Search.
Web Pages
Section titled “Web Pages”By default, the API returns the first 10 web pages in the webPages
field
as an array of files, similarly to env.files
. The content contains
the summary snippet returned by the search engine.
const webPages = await retrieval.webSearch("microsoft")def("PAGES", webPages)
You can use fetchText
to download the full content of the web page.
Tavily Configuration
Section titled “Tavily Configuration ”The Tavily API provides access to a powerful search engine for LLM agents.
TAVILY_API_KEY="your-api-key"
Add the system.retrieval_web_search system script to register a tool that uses retrieval.webSearch
.
script({ ..., system: ["system.retrieval_web_search"]})...