BingWebSearchService
Namespace: Wisej.AI.Services
Assembly: Wisej.AI
Represents a web search service using Bing's API.
- C#
- VB.NET
public class BingWebSearchService : WebSearchServiceBase
Public Class BingWebSearchService
Inherits WebSearchServiceBase
This class extends WebSearchServiceBase to provide specific implementation details for interacting with the Bing Web Search API.
Constructors
BingWebSearchService(url)
Initializes a new instance of the BingWebSearchService class with the specified URL.
| Name | Type | Description |
|---|---|---|
| url | String | The base URL for the Bing Web Search API. Default is "https://api.bing.microsoft.com/v7.0/search". |
Properties
Authentication
String: Gets the authentication header name specific to Bing's API. (Default: "api-key")
The authentication header for Bing's API is "Ocp-Apim-Subscription-Key".
Methods
SearchAsync(query)
Performs an asynchronous search using Bing's Web Search API with the specified query.
| Parameter | Type | Description |
|---|---|---|
| query | String | The search query string. |
Returns: Task<String>. A task representing the asynchronous operation, with a result of the search response as a formatted string.
This method formats the query string, sends a GET request to the Bing API, and processes the response to extract and format the search results.
Implements
| Name | Description |
|---|---|
| IWebSearchService | Represents a service for performing web searches. |