MCPcopy Create free account
hub / github.com/browserbase/stagehand-python / start

Method start

src/stagehand/resources/sessions.py:920–1013  ·  view source on GitHub ↗

Creates a new browser session with the specified configuration. Returns a session ID used for all subsequent operations. Args: model_name: Model name to use for AI operations act_timeout_ms: Timeout in ms for act operations (deprecated, v2 only)

(
        self,
        *,
        model_name: str,
        act_timeout_ms: float | Omit = omit,
        browser: session_start_params.Browser | Omit = omit,
        browserbase_session_create_params: session_start_params.BrowserbaseSessionCreateParams | Omit = omit,
        browserbase_session_id: str | Omit = omit,
        dom_settle_timeout_ms: float | Omit = omit,
        experimental: bool | Omit = omit,
        self_heal: bool | Omit = omit,
        system_prompt: str | Omit = omit,
        verbose: Literal[0, 1, 2] | Omit = omit,
        wait_for_captcha_solves: bool | Omit = omit,
        x_stream_response: Literal["true", "false"] | Omit = omit,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
        ### <CUSTOM CODE HANDWRITTEN BY STAGEHAND TEAM (not codegen)>
        # The runtime monkey patch returns a bound `Session`; mirror that public
        # return type here so users see the right API surface.
    )

Source from the content-addressed store, hash-verified

918 )
919
920 def start(
921 self,
922 *,
923 model_name: str,
924 act_timeout_ms: float | Omit = omit,
925 browser: session_start_params.Browser | Omit = omit,
926 browserbase_session_create_params: session_start_params.BrowserbaseSessionCreateParams | Omit = omit,
927 browserbase_session_id: str | Omit = omit,
928 dom_settle_timeout_ms: float | Omit = omit,
929 experimental: bool | Omit = omit,
930 self_heal: bool | Omit = omit,
931 system_prompt: str | Omit = omit,
932 verbose: Literal[0, 1, 2] | Omit = omit,
933 wait_for_captcha_solves: bool | Omit = omit,
934 x_stream_response: Literal["true", "false"] | Omit = omit,
935 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
936 # The extra values given here take precedence over values defined on the client or passed to this method.
937 extra_headers: Headers | None = None,
938 extra_query: Query | None = None,
939 extra_body: Body | None = None,
940 timeout: float | httpx.Timeout | None | NotGiven = not_given,
941 ### <CUSTOM CODE HANDWRITTEN BY STAGEHAND TEAM (not codegen)>
942 # The runtime monkey patch returns a bound `Session`; mirror that public
943 # return type here so users see the right API surface.
944 ) -> Session:
945 ### </END CUSTOM CODE>
946 """Creates a new browser session with the specified configuration.
947
948 Returns a
949 session ID used for all subsequent operations.
950
951 Args:
952 model_name: Model name to use for AI operations
953
954 act_timeout_ms: Timeout in ms for act operations (deprecated, v2 only)
955
956 browserbase_session_id: Existing Browserbase session ID to resume
957
958 dom_settle_timeout_ms: Timeout in ms to wait for DOM to settle
959
960 self_heal: Enable self-healing for failed actions
961
962 system_prompt: Custom system prompt for AI operations
963
964 verbose: Logging verbosity level (0=quiet, 1=normal, 2=debug)
965
966 wait_for_captcha_solves: Wait for captcha solves (deprecated, v2 only)
967
968 x_stream_response: Whether to stream the response via SSE
969
970 extra_headers: Send extra headers
971
972 extra_query: Add additional query parameters to the request
973
974 extra_body: Add additional JSON properties to the request
975
976 timeout: Override the client-level default timeout for this request, in seconds
977 """

Calls 4

strip_not_givenFunction · 0.85
is_givenFunction · 0.85
maybe_transformFunction · 0.85
make_request_optionsFunction · 0.85