Skip to content

invoke_browser

Operation

invoke_browser

invoke_browser(request: InvokeBrowserInput | InvokeBrowserInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[InvokeBrowserInputDict]) -> InvokeBrowserOutput

Invokes an operating system-level action on a browser session in Amazon Bedrock AgentCore. This operation provides direct OS-level control over browser sessions, enabling mouse actions, keyboard input, and screenshots that the WebSocket-based Chrome DevTools Protocol (CDP) cannot handle --- such as interacting with print dialogs, context menus, and JavaScript alerts.

You send a request with exactly one action in the BrowserAction union, and receive a corresponding result in the BrowserActionResult union.

The following operations are related to InvokeBrowser:

Parameters:

Name Type Description Default
request InvokeBrowserInput | InvokeBrowserInputDict | 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[InvokeBrowserInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
InvokeBrowserOutput

An instance of InvokeBrowserOutput.

invoke_browser async

invoke_browser(request: InvokeBrowserInput | InvokeBrowserInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[InvokeBrowserInputDict]) -> InvokeBrowserOutput

Invokes an operating system-level action on a browser session in Amazon Bedrock AgentCore. This operation provides direct OS-level control over browser sessions, enabling mouse actions, keyboard input, and screenshots that the WebSocket-based Chrome DevTools Protocol (CDP) cannot handle --- such as interacting with print dialogs, context menus, and JavaScript alerts.

You send a request with exactly one action in the BrowserAction union, and receive a corresponding result in the BrowserActionResult union.

The following operations are related to InvokeBrowser:

Parameters:

Name Type Description Default
request InvokeBrowserInput | InvokeBrowserInputDict | 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[InvokeBrowserInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
InvokeBrowserOutput

An instance of InvokeBrowserOutput.

Input

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

InvokeBrowserInputDict

Bases: TypedDict

Dictionary form of InvokeBrowserInput.

Attributes

action instance-attribute

The browser action to perform. Exactly one member of the BrowserAction union must be set per request.

browser_identifier instance-attribute
browser_identifier: Required[str]

The unique identifier of the browser associated with the session. This must match the identifier used when creating the session with StartBrowserSession.

session_id instance-attribute
session_id: Required[str]

The unique identifier of the browser session on which to perform the action. This must be an active session created with StartBrowserSession.

InvokeBrowserInput dataclass

Bases: _SerdeShape

Request for the InvokeBrowser operation.

Attributes

action class-attribute instance-attribute
action: BrowserAction | None = ...

The browser action to perform. Exactly one member of the BrowserAction union must be set per request.

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

The unique identifier of the browser associated with the session. This must match the identifier used when creating the session with StartBrowserSession.

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

The unique identifier of the browser session on which to perform the action. This must be an active session created with StartBrowserSession.

Output

InvokeBrowserOutput dataclass

Bases: _SerdeShape

Response for the InvokeBrowser 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.

result instance-attribute

The result of the browser action. The member set in the result corresponds to the action that was performed.

session_id instance-attribute
session_id: str

The unique identifier of the browser session on which the action was performed.