Skip to content

Commit c46c1ef

Browse files
committed
fix custom code
1 parent 3855966 commit c46c1ef

File tree

4 files changed

+24
-19
lines changed

4 files changed

+24
-19
lines changed

src/stagehand/types/session_execute_params.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,8 @@ class AgentConfig(TypedDict, total=False):
5656
mode: Literal["dom", "hybrid", "cua"]
5757
"""Tool mode for the agent (dom, hybrid, cua). If set, overrides cua."""
5858

59-
model: ModelConfigParam
60-
"""
61-
Model name string with provider prefix (e.g., 'openai/gpt-5-nano',
62-
'anthropic/claude-4.5-opus')
63-
"""
59+
model: AgentConfigModel
60+
"""Model configuration object or model name string (e.g., 'openai/gpt-5-nano')"""
6461

6562
provider: Literal["openai", "anthropic", "google", "microsoft", "bedrock"]
6663
"""AI provider for the agent (legacy, use model: openai/gpt-5-nano instead)"""

src/stagehand/types/session_extract_params.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,18 @@
33
from __future__ import annotations
44

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

88
from .._utils import PropertyInfo
99
from .model_config_param import ModelConfigParam
1010

11-
__all__ = ["SessionExtractParamsBase", "Options", "SessionExtractParamsNonStreaming", "SessionExtractParamsStreaming"]
11+
__all__ = [
12+
"SessionExtractParamsBase",
13+
"Options",
14+
"OptionsModel",
15+
"SessionExtractParamsNonStreaming",
16+
"SessionExtractParamsStreaming",
17+
]
1218

1319

1420
class SessionExtractParamsBase(TypedDict, total=False):
@@ -27,12 +33,12 @@ class SessionExtractParamsBase(TypedDict, total=False):
2733
"""Whether to stream the response via SSE"""
2834

2935

36+
OptionsModel: TypeAlias = Union[ModelConfigParam, str]
37+
38+
3039
class Options(TypedDict, total=False):
31-
model: ModelConfigParam
32-
"""
33-
Model name string with provider prefix (e.g., 'openai/gpt-5-nano',
34-
'anthropic/claude-4.5-opus')
35-
"""
40+
model: OptionsModel
41+
"""Model configuration object or model name string (e.g., 'openai/gpt-5-nano')"""
3642

3743
selector: str
3844
"""CSS selector to scope extraction to a specific element"""

src/stagehand/types/session_observe_params.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
from __future__ import annotations
44

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

88
from .._utils import PropertyInfo
99
from .model_config_param import ModelConfigParam
1010

1111
__all__ = [
1212
"SessionObserveParamsBase",
1313
"Options",
14+
"OptionsModel",
1415
"OptionsVariables",
1516
"OptionsVariablesUnionMember3",
1617
"SessionObserveParamsNonStreaming",
@@ -30,6 +31,10 @@ class SessionObserveParamsBase(TypedDict, total=False):
3031
x_stream_response: Annotated[Literal["true", "false"], PropertyInfo(alias="x-stream-response")]
3132
"""Whether to stream the response via SSE"""
3233

34+
35+
OptionsModel: TypeAlias = Union[ModelConfigParam, str]
36+
37+
3338
class OptionsVariablesUnionMember3(TypedDict, total=False):
3439
value: Required[Union[str, float, bool]]
3540

@@ -40,11 +45,8 @@ class OptionsVariablesUnionMember3(TypedDict, total=False):
4045

4146

4247
class Options(TypedDict, total=False):
43-
model: ModelConfigParam
44-
"""
45-
Model name string with provider prefix (e.g., 'openai/gpt-5-nano',
46-
'anthropic/claude-4.5-opus')
47-
"""
48+
model: OptionsModel
49+
"""Model configuration object or model name string (e.g., 'openai/gpt-5-nano')"""
4850

4951
selector: str
5052
"""CSS selector to scope observation to a specific element"""

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)