Del via


BingSearch Class

A search engine connector that uses the Bing Search API to perform a web search.

Note: This class is marked as 'experimental' and may change in the future.

Initializes a new instance of the Bing Search class.

Constructor

BingSearch(api_key: str | None = None, custom_config: str | None = None, env_file_path: str | None = None, env_file_encoding: str | None = None)

Parameters

Name Description
api_key

The Bing Search API key. If provided, will override the value in the env vars or .env file.

Default value: None
custom_config

The Bing Custom Search instance's unique identifier. If provided, will override the value in the env vars or .env file.

Default value: None
env_file_path

The optional path to the .env file. If provided, the settings are read from this file path location.

Default value: None
env_file_encoding

The optional encoding of the .env file.

Default value: None

Methods

get_search_results

Search for text, returning a KernelSearchResult with the results directly from the service.

get_text_search_results

Search for text, returning a KernelSearchResult with TextSearchResults.

search

Search for text, returning a KernelSearchResult with a list of strings.

get_search_results

Search for text, returning a KernelSearchResult with the results directly from the service.

async get_search_results(query: str, options: SearchOptions | None = None, **kwargs) -> KernelSearchResults[BingWebPage]

Parameters

Name Description
query
Required
options
Default value: None

get_text_search_results

Search for text, returning a KernelSearchResult with TextSearchResults.

async get_text_search_results(query: str, options: SearchOptions | None = None, **kwargs) -> KernelSearchResults[TextSearchResult]

Parameters

Name Description
query
Required
options
Default value: None

Search for text, returning a KernelSearchResult with a list of strings.

async search(query: str, options: SearchOptions | None = None, **kwargs: Any) -> KernelSearchResults[str]

Parameters

Name Description
query
Required
options
Default value: None

Attributes

is_experimental

is_experimental = True

settings

settings: BingSettings

stage_status

stage_status = 'experimental'