Skip to content

Commit 8c62efc

Browse files
authored
Remove unnecessary custom code (#337)
* remove custom code * fix custom code
1 parent 86cb2c4 commit 8c62efc

File tree

5 files changed

+19
-23
lines changed

5 files changed

+19
-23
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: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,8 @@ class OptionsVariablesUnionMember3(TypedDict, total=False):
4545

4646

4747
class Options(TypedDict, total=False):
48-
model: ModelConfigParam
49-
"""
50-
Model name string with provider prefix (e.g., 'openai/gpt-5-nano',
51-
'anthropic/claude-4.5-opus')
52-
"""
48+
model: OptionsModel
49+
"""Model configuration object or model name string (e.g., 'openai/gpt-5-nano')"""
5350

5451
selector: str
5552
"""CSS selector to scope observation to a specific element"""

src/stagehand/types/session_start_params.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@
2929

3030
class SessionStartParams(TypedDict, total=False):
3131
model_name: Required[Annotated[str, PropertyInfo(alias="modelName")]]
32-
"""Model name to use for AI operations.
33-
34-
Always use the format 'provider/model-name' (e.g., 'openai/gpt-4o',
35-
'anthropic/claude-sonnet-4-5-20250929', 'google/gemini-2.0-flash')
36-
"""
32+
"""Model name to use for AI operations"""
3733

3834
act_timeout_ms: Annotated[float, PropertyInfo(alias="actTimeoutMs")]
3935
"""Timeout in ms for act operations (deprecated, v2 only)"""

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)