Skip to content

Commit dde1e8b

Browse files
feat(api): manual updates
1 parent f7eefb4 commit dde1e8b

File tree

13 files changed

+84
-56
lines changed

13 files changed

+84
-56
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 7
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-f7d6b6489159f611a2bfdc267ce0a6fc0455bed1ffa0c310044baaa5d8381b9b.yml
3-
openapi_spec_hash: cd88d8068abfde8382da0bed674e440c
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-4fb17cafc413ae3d575e3268602b01d2d0e9ebeb734a41b6086b3353ff0d2523.yml
3+
openapi_spec_hash: 8d48d8564849246f6f14d900c6c5f60c
44
config_hash: 5c69fb596588b8ace08203858518c149

src/stagehand/resources/sessions.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,12 +1028,11 @@ def start(
10281028
browser: session_start_params.Browser | Omit = omit,
10291029
browserbase_session_create_params: session_start_params.BrowserbaseSessionCreateParams | Omit = omit,
10301030
browserbase_session_id: str | Omit = omit,
1031-
debug_dom: bool | Omit = omit,
10321031
dom_settle_timeout_ms: float | Omit = omit,
10331032
experimental: bool | Omit = omit,
10341033
self_heal: bool | Omit = omit,
10351034
system_prompt: str | Omit = omit,
1036-
verbose: int | Omit = omit,
1035+
verbose: Literal["0", "1", "2"] | Omit = omit,
10371036
wait_for_captcha_solves: bool | Omit = omit,
10381037
x_language: Literal["typescript", "python", "playground"] | Omit = omit,
10391038
x_sdk_version: str | Omit = omit,
@@ -1054,7 +1053,7 @@ def start(
10541053
Args:
10551054
model_name: Model name to use for AI operations
10561055
1057-
act_timeout_ms: Timeout in ms for act operations
1056+
act_timeout_ms: Timeout in ms for act operations (deprecated, v2 only)
10581057
10591058
browserbase_session_id: Existing Browserbase session ID to resume
10601059
@@ -1066,6 +1065,8 @@ def start(
10661065
10671066
verbose: Logging verbosity level (0=quiet, 1=normal, 2=debug)
10681067
1068+
wait_for_captcha_solves: Wait for captcha solves (deprecated, v2 only)
1069+
10691070
x_language: Client SDK language
10701071
10711072
x_sdk_version: Version of the Stagehand SDK
@@ -1102,7 +1103,6 @@ def start(
11021103
"browser": browser,
11031104
"browserbase_session_create_params": browserbase_session_create_params,
11041105
"browserbase_session_id": browserbase_session_id,
1105-
"debug_dom": debug_dom,
11061106
"dom_settle_timeout_ms": dom_settle_timeout_ms,
11071107
"experimental": experimental,
11081108
"self_heal": self_heal,
@@ -2107,12 +2107,11 @@ async def start(
21072107
browser: session_start_params.Browser | Omit = omit,
21082108
browserbase_session_create_params: session_start_params.BrowserbaseSessionCreateParams | Omit = omit,
21092109
browserbase_session_id: str | Omit = omit,
2110-
debug_dom: bool | Omit = omit,
21112110
dom_settle_timeout_ms: float | Omit = omit,
21122111
experimental: bool | Omit = omit,
21132112
self_heal: bool | Omit = omit,
21142113
system_prompt: str | Omit = omit,
2115-
verbose: int | Omit = omit,
2114+
verbose: Literal["0", "1", "2"] | Omit = omit,
21162115
wait_for_captcha_solves: bool | Omit = omit,
21172116
x_language: Literal["typescript", "python", "playground"] | Omit = omit,
21182117
x_sdk_version: str | Omit = omit,
@@ -2133,7 +2132,7 @@ async def start(
21332132
Args:
21342133
model_name: Model name to use for AI operations
21352134
2136-
act_timeout_ms: Timeout in ms for act operations
2135+
act_timeout_ms: Timeout in ms for act operations (deprecated, v2 only)
21372136
21382137
browserbase_session_id: Existing Browserbase session ID to resume
21392138
@@ -2145,6 +2144,8 @@ async def start(
21452144
21462145
verbose: Logging verbosity level (0=quiet, 1=normal, 2=debug)
21472146
2147+
wait_for_captcha_solves: Wait for captcha solves (deprecated, v2 only)
2148+
21482149
x_language: Client SDK language
21492150
21502151
x_sdk_version: Version of the Stagehand SDK
@@ -2181,7 +2182,6 @@ async def start(
21812182
"browser": browser,
21822183
"browserbase_session_create_params": browserbase_session_create_params,
21832184
"browserbase_session_id": browserbase_session_id,
2184-
"debug_dom": debug_dom,
21852185
"dom_settle_timeout_ms": dom_settle_timeout_ms,
21862186
"experimental": experimental,
21872187
"self_heal": self_heal,

src/stagehand/types/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from __future__ import annotations
44

5-
from .action import Action as Action
65
from .action_param import ActionParam as ActionParam
76
from .stream_event import StreamEvent as StreamEvent
87
from .model_config_param import ModelConfigParam as ModelConfigParam

src/stagehand/types/action.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/stagehand/types/action_param.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
from __future__ import annotations
44

5-
from typing_extensions import Required, TypedDict
5+
from typing_extensions import Required, Annotated, TypedDict
66

77
from .._types import SequenceNotStr
8+
from .._utils import PropertyInfo
89

910
__all__ = ["ActionParam"]
1011

@@ -21,5 +22,8 @@ class ActionParam(TypedDict, total=False):
2122
arguments: SequenceNotStr[str]
2223
"""Arguments to pass to the method"""
2324

25+
backend_node_id: Annotated[float, PropertyInfo(alias="backendNodeId")]
26+
"""Backend node ID for the element"""
27+
2428
method: str
2529
"""The method to execute (click, fill, etc.)"""

src/stagehand/types/model_config_param.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
from typing import Union
6-
from typing_extensions import Required, Annotated, TypeAlias, TypedDict
6+
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict
77

88
from .._utils import PropertyInfo
99

@@ -20,5 +20,8 @@ class ModelConfigObject(TypedDict, total=False):
2020
base_url: Annotated[str, PropertyInfo(alias="baseURL")]
2121
"""Base URL for the model provider"""
2222

23+
provider: Literal["openai", "anthropic", "google", "microsoft"]
24+
"""AI provider for the model (or provide a baseURL endpoint instead)"""
25+
2326

2427
ModelConfigParam: TypeAlias = Union[str, ModelConfigObject]

src/stagehand/types/session_act_response.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,35 @@
44

55
from pydantic import Field as FieldInfo
66

7-
from .action import Action
87
from .._models import BaseModel
98

10-
__all__ = ["SessionActResponse", "Data", "DataResult"]
9+
__all__ = ["SessionActResponse", "Data", "DataResult", "DataResultAction"]
10+
11+
12+
class DataResultAction(BaseModel):
13+
"""Action object returned by observe and used by act"""
14+
15+
description: str
16+
"""Human-readable description of the action"""
17+
18+
selector: str
19+
"""CSS selector or XPath for the element"""
20+
21+
arguments: Optional[List[str]] = None
22+
"""Arguments to pass to the method"""
23+
24+
backend_node_id: Optional[float] = FieldInfo(alias="backendNodeId", default=None)
25+
"""Backend node ID for the element"""
26+
27+
method: Optional[str] = None
28+
"""The method to execute (click, fill, etc.)"""
1129

1230

1331
class DataResult(BaseModel):
1432
action_description: str = FieldInfo(alias="actionDescription")
1533
"""Description of the action that was performed"""
1634

17-
actions: List[Action]
35+
actions: List[DataResultAction]
1836
"""List of actions that were executed"""
1937

2038
message: str

src/stagehand/types/session_execute_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ class AgentConfig(TypedDict, total=False):
4949
'anthropic/claude-4.5-opus')
5050
"""
5151

52+
provider: Literal["openai", "anthropic", "google", "microsoft"]
53+
"""AI provider for the agent (legacy, use model: openai/gpt-5-nano instead)"""
54+
5255
system_prompt: Annotated[str, PropertyInfo(alias="systemPrompt")]
5356
"""Custom system prompt for the agent"""
5457

src/stagehand/types/session_observe_response.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,32 @@
44

55
from pydantic import Field as FieldInfo
66

7-
from .action import Action
87
from .._models import BaseModel
98

10-
__all__ = ["SessionObserveResponse", "Data"]
9+
__all__ = ["SessionObserveResponse", "Data", "DataResult"]
10+
11+
12+
class DataResult(BaseModel):
13+
"""Action object returned by observe and used by act"""
14+
15+
description: str
16+
"""Human-readable description of the action"""
17+
18+
selector: str
19+
"""CSS selector or XPath for the element"""
20+
21+
arguments: Optional[List[str]] = None
22+
"""Arguments to pass to the method"""
23+
24+
backend_node_id: Optional[float] = FieldInfo(alias="backendNodeId", default=None)
25+
"""Backend node ID for the element"""
26+
27+
method: Optional[str] = None
28+
"""The method to execute (click, fill, etc.)"""
1129

1230

1331
class Data(BaseModel):
14-
result: List[Action]
32+
result: List[DataResult]
1533

1634
action_id: Optional[str] = FieldInfo(alias="actionId", default=None)
1735
"""Action ID for tracking"""

src/stagehand/types/session_start_params.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class SessionStartParams(TypedDict, total=False):
3333
"""Model name to use for AI operations"""
3434

3535
act_timeout_ms: Annotated[float, PropertyInfo(alias="actTimeoutMs")]
36-
"""Timeout in ms for act operations"""
36+
"""Timeout in ms for act operations (deprecated, v2 only)"""
3737

3838
browser: Browser
3939

@@ -44,8 +44,6 @@ class SessionStartParams(TypedDict, total=False):
4444
browserbase_session_id: Annotated[str, PropertyInfo(alias="browserbaseSessionID")]
4545
"""Existing Browserbase session ID to resume"""
4646

47-
debug_dom: Annotated[bool, PropertyInfo(alias="debugDom")]
48-
4947
dom_settle_timeout_ms: Annotated[float, PropertyInfo(alias="domSettleTimeoutMs")]
5048
"""Timeout in ms to wait for DOM to settle"""
5149

@@ -57,10 +55,11 @@ class SessionStartParams(TypedDict, total=False):
5755
system_prompt: Annotated[str, PropertyInfo(alias="systemPrompt")]
5856
"""Custom system prompt for AI operations"""
5957

60-
verbose: int
58+
verbose: Literal["0", "1", "2"]
6159
"""Logging verbosity level (0=quiet, 1=normal, 2=debug)"""
6260

6361
wait_for_captcha_solves: Annotated[bool, PropertyInfo(alias="waitForCaptchaSolves")]
62+
"""Wait for captcha solves (deprecated, v2 only)"""
6463

6564
x_language: Annotated[Literal["typescript", "python", "playground"], PropertyInfo(alias="x-language")]
6665
"""Client SDK language"""

0 commit comments

Comments
 (0)