Skip to content

invoke_web_search

Operation

invoke_web_search(request: InvokeWebSearchInput | InvokeWebSearchInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[InvokeWebSearchInputDict]) -> InvokeWebSearchOutput

Searches the web and returns a ranked list of results. Each result includes a text extract from the page.

You can filter the results by domain and by publication date.

To use this operation, you must have the bedrock-agentcore:InvokeWebSearch permission on the resource arn:${Partition}:bedrock-agentcore:${Region}:aws:tool/web-search.v1.

Parameters:

Name Type Description Default
request InvokeWebSearchInput | InvokeWebSearchInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[InvokeWebSearchInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
InvokeWebSearchOutput

An instance of InvokeWebSearchOutput.

invoke_web_search(request: InvokeWebSearchInput | InvokeWebSearchInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[InvokeWebSearchInputDict]) -> InvokeWebSearchOutput

Searches the web and returns a ranked list of results. Each result includes a text extract from the page.

You can filter the results by domain and by publication date.

To use this operation, you must have the bedrock-agentcore:InvokeWebSearch permission on the resource arn:${Partition}:bedrock-agentcore:${Region}:aws:tool/web-search.v1.

Parameters:

Name Type Description Default
request InvokeWebSearchInput | InvokeWebSearchInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[InvokeWebSearchInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
InvokeWebSearchOutput

An instance of InvokeWebSearchOutput.

Input

Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.

InvokeWebSearchInputDict

Bases: TypedDict

Dictionary form of InvokeWebSearchInput.

Attributes

filters instance-attribute

The filters to apply to the search results.

max_results instance-attribute
max_results: int | None

The maximum number of results to return. Defaults to 25.

search_query instance-attribute
search_query: Required[str]

The text to search for.

web_search_id instance-attribute
web_search_id: Required[str]

The identifier of the web search tool to invoke. The Amazon Web Services-managed web search tool is web-search.v1.

InvokeWebSearchInput dataclass

Bases: _SerdeShape

Request for the InvokeWebSearch operation.

Attributes

filters class-attribute instance-attribute
filters: WebSearchFilters | None = ...

The filters to apply to the search results.

max_results class-attribute instance-attribute
max_results: int | None = ...

The maximum number of results to return. Defaults to 25.

search_query class-attribute instance-attribute
search_query: str | None = ...

The text to search for.

web_search_id class-attribute instance-attribute
web_search_id: str | None = ...

The identifier of the web search tool to invoke. The Amazon Web Services-managed web search tool is web-search.v1.

Output

InvokeWebSearchOutput dataclass

Bases: _SerdeShape

Response for the InvokeWebSearch operation.

Attributes

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.

results instance-attribute

The search results, in ranked order.