Share via


WebSearchEnginePlugin Class

A plugin that provides web search engine functionality.

Usage: connector = BingConnector(bing_search_api_key) kernel.add_plugin(WebSearchEnginePlugin(connector), plugin_name="WebSearch")

Initializes a new instance of the WebSearchEnginePlugin class.

Constructor

WebSearchEnginePlugin(connector: ConnectorBase)

Parameters

Name Description
connector
Required

Examples

{{WebSearch.search "What is semantic kernel?"}} => Returns the first num_results number of results for the given search query

and ignores the first offset number of results.

Methods

search

Returns the search results of the query provided.

Returns the search results of the query provided.

async search(query: Annotated[str, 'The search query'], num_results: Annotated[int, 'The number of search results to return'] = 1, offset: Annotated[int, 'The number of search results to skip'] = 0) -> list[str]

Parameters

Name Description
query
Required
num_results
Default value: 1
offset
Default value: 0