start_browser_session
async
¶
start_browser_session(
browser_identifier: str,
*,
config_overrides: Optional[AsyncBedrockAgentCoreClientConfig] = None,
trace_id: Optional[str] = None,
trace_parent: Optional[str] = None,
name: Optional[Name] = None,
session_timeout_seconds: Optional[BrowserSessionTimeout] = None,
view_port: Optional[ViewPort] = None,
extensions: Optional[BrowserExtensions] = None,
profile_configuration: Optional[BrowserProfileConfiguration] = None,
proxy_configuration: Optional[ProxyConfiguration] = None,
enterprise_policies: Optional[BrowserEnterprisePolicies] = None,
certificates: Optional[Certificates] = None,
filesystem_configurations: Optional[ToolsFileSystemConfigurations] = None,
client_token: Optional[ClientToken] = None,
) -> StartBrowserSessionResponse
Creates and initializes a browser session in Amazon Bedrock AgentCore. The session enables agents to navigate and interact with web content, extract information from websites, and perform web-based tasks as part of their response generation.
To create a session, you must specify a browser identifier and a name. You can also configure the viewport dimensions to control the visible area of web content. The session remains active until it times out or you explicitly stop it using the StopBrowserSession operation.
The following operations are related to StartBrowserSession:
Parameters:
-
trace_id(Optional[str], default:None) –The trace identifier for request tracking.
-
trace_parent(Optional[str], default:None) –The parent trace information for distributed tracing.
-
browser_identifier(str) –The unique identifier of the browser to use for this session. This identifier specifies which browser environment to initialize for the session.
-
name(Optional[Name], default:None) –The name of the browser session. This name helps you identify and manage the session. The name does not need to be unique.
-
session_timeout_seconds(Optional[BrowserSessionTimeout], default:None) –The duration in seconds (time-to-live) after which the session automatically terminates, regardless of ongoing activity. Defaults to 3600 seconds (1 hour). Recommended minimum: 60 seconds. Maximum allowed: 28,800 seconds (8 hours).
-
view_port(Optional[ViewPort], default:None) –The dimensions of the browser viewport for this session. This determines the visible area of the web content and affects how web pages are rendered. If not specified, Amazon Bedrock AgentCore uses a default viewport size.
-
extensions(Optional[BrowserExtensions], default:None) –A list of browser extensions to load into the browser session.
-
profile_configuration(Optional[BrowserProfileConfiguration], default:None) –The browser profile configuration to use for this session. A browser profile contains persistent data such as cookies and local storage that can be reused across multiple browser sessions. If specified, the session initializes with the profile's stored data, enabling continuity for tasks that require authentication or personalized settings.
-
proxy_configuration(Optional[ProxyConfiguration], default:None) –Optional proxy configuration for routing browser traffic through customer-specified proxy servers. When provided, enables HTTP Basic authentication via Amazon Web Services Secrets Manager and domain-based routing rules. Requires
secretsmanager:GetSecretValueIAM permission for the specified secret ARNs. -
enterprise_policies(Optional[BrowserEnterprisePolicies], default:None) –A list of files containing enterprise policies for the browser.
-
certificates(Optional[Certificates], default:None) –A list of certificates to install in the browser session.
-
filesystem_configurations(Optional[ToolsFileSystemConfigurations], default:None) –The file system configurations to mount into the browser session. Use these configurations to mount your own Amazon Simple Storage Service (Amazon S3) Files or Amazon Elastic File System (Amazon EFS) access points. Your session can then read and write your data. If you don't specify this field, no additional file systems are mounted.
-
client_token(Optional[ClientToken], default:None) –A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock AgentCore ignores the request, but does not return an error. This parameter helps prevent the creation of duplicate sessions if there are temporary network issues.
Raises:
-
AccessDeniedException–The exception that occurs when you do not have sufficient permissions to perform an action. Verify that your IAM policy includes the necessary permissions for the operation you are trying to perform.
-
ConflictException–The exception that occurs when the request conflicts with the current state of the resource. This can happen when trying to modify a resource that is currently being modified by another request, or when trying to create a resource that already exists.
-
InternalServerException–The exception that occurs when the service encounters an unexpected internal error. This is a temporary condition that will resolve itself with retries. We recommend implementing exponential backoff retry logic in your application.
-
ResourceNotFoundException–The exception that occurs when the specified resource does not exist. This can happen when using an invalid identifier or when trying to access a resource that has been deleted.
-
ServiceQuotaExceededException–The exception that occurs when the request would cause a service quota to be exceeded. Review your service quotas and either reduce your request rate or request a quota increase.
-
ThrottlingException–The exception that occurs when the request was denied due to request throttling. This happens when you exceed the allowed request rate for an operation. Reduce the frequency of requests or implement exponential backoff retry logic in your application.
-
ValidationException–The exception that occurs when the input fails to satisfy the constraints specified by the service. Check the error message for details about which input parameter is invalid and correct your request.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_bedrock_agentcore/_services/async_bedrock_agent_core.py
1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 | |