Reference
@chloejs/ core/ tools/ web
Reading a public web page.
The tools over webService.ts and searchService.ts: reading one public web page, and searching the web.
import * as web from "@chloejs/core/tools/web";
tools: { webReadPage: web.readPage(), webSearch: web.search() }readPagefunction
export function readPage()Makes a tool that lets the model read one public web page as plain text,
with links written as [text](url). A long page comes back in parts of
about 20,000 characters, and the model asks for the next part.
It reads only public addresses: it refuses this machine, your local network and other private addresses, even through a redirect. It does not run the page's JavaScript, so a page built in the browser comes back nearly empty.
Takes no options and needs no connection.
tools: { webReadPage: web.readPage() }searchfunction
export function search()Makes a tool that lets the model search the web, and get back up to 20
results, each a title, an address and a line from the page. It reads a
result with readPage.
The query goes to Brave Search when connections.brave.api_key is set, and
to DuckDuckGo's results page when it is not. DuckDuckGo needs no key but can
refuse a machine that searches often, and then the tool says so.
Takes no options.
tools: { webReadPage: web.readPage(), webSearch: web.search() }