BraveWebSearchService
Wisej.AI.Services.BraveWebSearchService
Namespace: Wisej.AI.Services
Assembly: Wisej.AI (3.5.0.0)
Represents a service for performing web searches using the Brave search engine.
public class BraveWebSearchService : WebSearchServiceBase
This class extends the WebSearchServiceBase to provide specific implementations for the Brave search engine.
Constructors
BraveWebSearchService(url)

Initializes a new instance of the BraveWebSearchService class with the specified URL.
url
The base URL for the Brave search API. Default is "https://api.search.brave.com/res/v1/web/search".
Properties
Authentication

String: Gets the authentication header name used for the Brave search API. (Default: "api-key"
)
This property returns the string "X-Subscription-Token", which is used as the authentication header for API requests.
Methods
SearchAsync(query)

Performs an asynchronous web search using the specified query.
Returns: Task<String>. A task that represents the asynchronous operation. The task result contains the search results as a formatted string.
This method sends a GET request to the Brave search API with the specified query and processes the response to extract and format the search results.
var service = new BraveWebSearchService();
string results = await service.SearchAsync("example query");
Console.WriteLine(results);
Implements
Represents a service for performing web searches.
Last updated