Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/stagehand/types/session_execute_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,8 @@ class AgentConfig(TypedDict, total=False):
mode: Literal["dom", "hybrid", "cua"]
"""Tool mode for the agent (dom, hybrid, cua). If set, overrides cua."""

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

provider: Literal["openai", "anthropic", "google", "microsoft", "bedrock"]
"""AI provider for the agent (legacy, use model: openai/gpt-5-nano instead)"""
Expand Down
20 changes: 13 additions & 7 deletions src/stagehand/types/session_extract_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@
from __future__ import annotations

from typing import Dict, Union, Optional
from typing_extensions import Literal, Required, Annotated, TypedDict
from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict

from .._utils import PropertyInfo
from .model_config_param import ModelConfigParam

__all__ = ["SessionExtractParamsBase", "Options", "SessionExtractParamsNonStreaming", "SessionExtractParamsStreaming"]
__all__ = [
"SessionExtractParamsBase",
"Options",
"OptionsModel",
"SessionExtractParamsNonStreaming",
"SessionExtractParamsStreaming",
]


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


OptionsModel: TypeAlias = Union[ModelConfigParam, str]


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

selector: str
"""CSS selector to scope extraction to a specific element"""
Expand Down
7 changes: 2 additions & 5 deletions src/stagehand/types/session_observe_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,8 @@ class OptionsVariablesUnionMember3(TypedDict, total=False):


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

selector: str
"""CSS selector to scope observation to a specific element"""
Expand Down
6 changes: 1 addition & 5 deletions src/stagehand/types/session_start_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@

class SessionStartParams(TypedDict, total=False):
model_name: Required[Annotated[str, PropertyInfo(alias="modelName")]]
"""Model name to use for AI operations.

Always use the format 'provider/model-name' (e.g., 'openai/gpt-4o',
'anthropic/claude-sonnet-4-5-20250929', 'google/gemini-2.0-flash')
"""
"""Model name to use for AI operations"""

act_timeout_ms: Annotated[float, PropertyInfo(alias="actTimeoutMs")]
"""Timeout in ms for act operations (deprecated, v2 only)"""
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading