WebSearchTools

Wisej.AI.Tools.WebSearchTools

Namespace: Wisej.AI.Tools

Assembly: Wisej.AI (3.5.0.0)

Represents a collection of tools for performing web searches and processing web content.

public class WebSearchTools : ToolsContainer

This class provides functionality to search the web using a specified query and read content from specified URLs. It utilizes various services such as IWebSearchService, ITokenizerService, IHttpClientService, and IDocumentConversionService to perform its operations.

Constructors

WebSearchTools()

Initializes a new instance of the WebSearchTools class.

This constructor sets the MaxSites property of the SearchService if it is not null.

Properties

DocumentConversionService

IDocumentConversionService: Gets or sets the document conversion service used for converting web content.

HttpClientService

IHttpClientService: Gets or sets the HTTP client service used for making HTTP requests.

MaxContextTokens

Int32: Gets or sets the maximum number of context tokens. (Default: 4096)

MaxSites

Int32: Gets or sets the maximum number of sites to search. (Default: 5)

SearchService

IWebSearchService: Gets or sets the web search service used for searching the web.

Timeout

Int32: Gets or sets the timeout in milliseconds. (Default: 30000)

TokenizerService

ITokenizerService: Gets or sets the tokenizer service used for truncating context tokens.

UserAgent

String: Gets or sets the User-Agent header. (Default: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36")

Methods

DownloadAsync(urls)

Downloads content from the specified URLs asynchronously.

Parameter
Type
Description

urls

An array of URLs to download content from.

Returns: Task<String>. A task that represents the asynchronous download operation. The task result contains the downloaded content as a string.

read(urls)

Reads content from the specified URLs.

Parameter
Type
Description

urls

An array of URLs to read content from.

Returns: Task<String>. A task that represents the asynchronous read operation. The task result contains the content as a string.

search(query)

Searches the web using the specified query.

Parameter
Type
Description

query

The search query.

Returns: Task<String>. A task that represents the asynchronous search operation. The task result contains the search result as a string.

Implements

Name
Description

Represents a container for tools, providing access to a hub, adapter, and a collection of parameters.

Last updated