Interface: WebFetchToolOptions
Defined in: packages/tools/src/web/web-fetch.ts:458
Extends
Omit<ReadWebPageOptions,"signal">
Properties
allowedHosts?
optionalallowedHosts?:string[]
Defined in: packages/tools/src/web/web-fetch.ts:141
Only these hosts (exact, or .example.com for a domain and its subdomains).
Inherited from
ReadWebPageOptions.allowedHosts
allowPrivateNetworks?
optionalallowPrivateNetworks?:boolean
Defined in: packages/tools/src/web/web-fetch.ts:145
Allow localhost and private ranges. Default false.
Inherited from
ReadWebPageOptions.allowPrivateNetworks
blockedHosts?
optionalblockedHosts?:string[]
Defined in: packages/tools/src/web/web-fetch.ts:143
Never these hosts (same matching).
Inherited from
ReadWebPageOptions.blockedHosts
content?
optionalcontent?:"main"|"full"
Defined in: packages/tools/src/web/web-fetch.ts:468
The model may ask for content: 'main' (the article body) or 'full'
per call; this is what it gets when it does not say. Default full.
Overrides
description?
optionaldescription?:string
Defined in: packages/tools/src/web/web-fetch.ts:461
fallback?
optionalfallback?: (request) =>Promise<WebFallbackPage|null|undefined>
Defined in: packages/tools/src/web/web-fetch.ts:157
Read a page the plain read could not. Return null to keep the plain outcome.
Parameters
request
Returns
Promise<WebFallbackPage | null | undefined>
Inherited from
fetch?
optionalfetch?: {(input,init?):Promise<Response>; (input,init?):Promise<Response>; }
Defined in: packages/tools/src/web/web-fetch.ts:151
The platform fetch, when there is no transport.
Call Signature
(
input,init?):Promise<Response>
Parameters
input
URL | RequestInfo
init?
RequestInit
Returns
Promise<Response>
Call Signature
(
input,init?):Promise<Response>
Parameters
input
string | URL | Request
init?
RequestInit
Returns
Promise<Response>
Inherited from
maxBytes?
optionalmaxBytes?:number
Defined in: packages/tools/src/web/web-fetch.ts:137
Bytes downloaded at most. Default 5 MB.
Inherited from
maxChars?
optionalmaxChars?:number
Defined in: packages/tools/src/web/web-fetch.ts:463
Characters of text returned per call. Default 20,000.
name?
optionalname?:string
Defined in: packages/tools/src/web/web-fetch.ts:460
Tool name. Default web_fetch.
onPage?
optionalonPage?: (page,read) =>void|Record<string,unknown> |Promise<void|Record<string,unknown>>
Defined in: packages/tools/src/web/web-fetch.ts:477
The whole page, raw HTML and original bytes included, on every read (the
model may read a long page in several parts; offset says which). Save
the original here. Fields you return are added to what the model sees
(e.g. { saved_as: 'doc_123' }).
Parameters
page
read
offset
number
Returns
void | Record<string, unknown> | Promise<void | Record<string, unknown>>
readPdf?
optionalreadPdf?:false|PdfTextReader
Defined in: packages/tools/src/web/web-fetch.ts:155
Read a PDF's text layer. Default: unpdf when installed. false: keep the bytes, read no text.
Inherited from
resolveHost?
optionalresolveHost?: (hostname) =>Promise<string[]>
Defined in: packages/tools/src/web/web-fetch.ts:149
Unpinned: check a hostname's addresses before the platform fetch resolves it again.
Parameters
hostname
string
Returns
Promise<string[]>
Inherited from
ReadWebPageOptions.resolveHost
structuredDataChars?
optionalstructuredDataChars?:number
Defined in: packages/tools/src/web/web-fetch.ts:470
Characters of JSON-LD the model sees, whole blocks only. Default 8,000; 0 leaves it out.
thinChars?
optionalthinChars?:number
Defined in: packages/tools/src/web/web-fetch.ts:159
An HTML page with less readable text than this is thin. Default 200 characters.
Inherited from
timeoutMs?
optionaltimeoutMs?:number
Defined in: packages/tools/src/web/web-fetch.ts:139
One deadline for the whole read, redirects and body included. Default 20 s.
Inherited from
transport?
optionaltransport?:WebFetchTransport
Defined in: packages/tools/src/web/web-fetch.ts:147
Pinned resolution and connection (see WebFetchTransport). Wins over fetch and resolveHost.
Inherited from
userAgent?
optionaluserAgent?:string
Defined in: packages/tools/src/web/web-fetch.ts:153
Sent as User-Agent.