Skip to content

WebFetchTools

Namespace: Vercel.AI.WebFetch

public static class WebFetchTools

A provider-independent web fetch tool. Maps to @ai-sdk/tool-web-fetch.

Inheritance: object

View source

public const string ToolName = "webFetch"

Name of the tool the model sees.

Value: string

View source

public static Tool Create(WebFetchToolOptions? options = null)

Creates a provider-independent web fetch tool. The model calls the tool with a URL. HTML pages are converted to markdown with the main content extracted, and text formats are returned as is. JavaScript is not executed. Failures are returned as results so the model can recover. Requests are GET only, without cookies or credentials. Every hop, including redirects, is checked against the domain filter and private addresses are blocked.

Parameters

Name Type Description
options WebFetchToolOptions

Returns: Tool

Exceptions

Type Condition
InvalidArgumentError An option is invalid.

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product