diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f80372ae..a397c094 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.20.0" + ".": "3.21.0" } diff --git a/.stats.yml b/.stats.yml index 391cde37..0339c57c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 8 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/stagehand-6f6bfb81d092f30a5e2005328c97d61b9ea36132bb19e9e79e55294b9534ce20.yml -openapi_spec_hash: f3fc1e3688a38dc2c28f7178f7d534e5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/stagehand-eae8400fade7b2c8329c4148f56de92e147c34c0feecb420c015aab6544a9acc.yml +openapi_spec_hash: 0a9eff1ac1d464e89cbd9db64709b08a config_hash: 1fb12ae9b478488bc1e56bfbdc210b01 diff --git a/CHANGELOG.md b/CHANGELOG.md index c5ab97a1..b28f0bd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 3.21.0 (2026-05-09) + +Full Changelog: [v3.20.0...v3.21.0](https://github.com/browserbase/stagehand-python/compare/v3.20.0...v3.21.0) + +### Features + +* [feat]: add `ignoreSelectors` to `observe()` ([77be2c2](https://github.com/browserbase/stagehand-python/commit/77be2c2463c7b1d0ce6768eecf130adc3ef91149)) + + +### Bug Fixes + +* **client:** add missing f-string prefix in file type error message ([fb40f50](https://github.com/browserbase/stagehand-python/commit/fb40f50c2fb3337be84a3f973b8a27a8f53fbfae)) + ## 3.20.0 (2026-05-06) Full Changelog: [v3.19.5...v3.20.0](https://github.com/browserbase/stagehand-python/compare/v3.19.5...v3.20.0) diff --git a/pyproject.toml b/pyproject.toml index d3411cde..7a595051 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "stagehand" -version = "3.20.0" +version = "3.21.0" description = "The official Python library for the stagehand API" dynamic = ["readme"] license = "MIT" diff --git a/src/stagehand/_files.py b/src/stagehand/_files.py index 0fdce17b..76da9e08 100644 --- a/src/stagehand/_files.py +++ b/src/stagehand/_files.py @@ -99,7 +99,7 @@ async def async_to_httpx_files(files: RequestFiles | None) -> HttpxRequestFiles elif is_sequence_t(files): files = [(key, await _async_transform_file(file)) for key, file in files] else: - raise TypeError("Unexpected file type input {type(files)}, expected mapping or sequence") + raise TypeError(f"Unexpected file type input {type(files)}, expected mapping or sequence") return files diff --git a/src/stagehand/_version.py b/src/stagehand/_version.py index b5e0b8a6..6dcaaca6 100644 --- a/src/stagehand/_version.py +++ b/src/stagehand/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "stagehand" -__version__ = "3.20.0" # x-release-please-version +__version__ = "3.21.0" # x-release-please-version diff --git a/src/stagehand/types/session_observe_params.py b/src/stagehand/types/session_observe_params.py index 6c08105a..246bf367 100644 --- a/src/stagehand/types/session_observe_params.py +++ b/src/stagehand/types/session_observe_params.py @@ -5,6 +5,7 @@ from typing import Dict, Union, Optional from typing_extensions import Literal, Required, Annotated, TypeAlias, TypedDict +from .._types import SequenceNotStr from .._utils import PropertyInfo from .model_config_param import ModelConfigParam @@ -45,6 +46,9 @@ class OptionsVariablesUnionMember3(TypedDict, total=False): class Options(TypedDict, total=False): + ignore_selectors: Annotated[SequenceNotStr[str], PropertyInfo(alias="ignoreSelectors")] + """Selectors for elements and subtrees that should be excluded from observation""" + model: OptionsModel """Model configuration object or model name string (e.g., 'openai/gpt-5-nano')""" diff --git a/tests/api_resources/test_sessions.py b/tests/api_resources/test_sessions.py index 1929c8f5..6742ce4f 100644 --- a/tests/api_resources/test_sessions.py +++ b/tests/api_resources/test_sessions.py @@ -645,6 +645,7 @@ def test_method_observe_with_all_params_overload_1(self, client: Stagehand) -> N frame_id="frameId", instruction="Find all clickable navigation links", options={ + "ignore_selectors": ["nav", ".cookie-banner", "#sidebar-ads"], "model": { "model_name": "openai/gpt-5.4-mini", "api_key": "sk-some-openai-api-key", @@ -719,6 +720,7 @@ def test_method_observe_with_all_params_overload_2(self, client: Stagehand) -> N frame_id="frameId", instruction="Find all clickable navigation links", options={ + "ignore_selectors": ["nav", ".cookie-banner", "#sidebar-ads"], "model": { "model_name": "openai/gpt-5.4-mini", "api_key": "sk-some-openai-api-key", @@ -1579,6 +1581,7 @@ async def test_method_observe_with_all_params_overload_1(self, async_client: Asy frame_id="frameId", instruction="Find all clickable navigation links", options={ + "ignore_selectors": ["nav", ".cookie-banner", "#sidebar-ads"], "model": { "model_name": "openai/gpt-5.4-mini", "api_key": "sk-some-openai-api-key", @@ -1653,6 +1656,7 @@ async def test_method_observe_with_all_params_overload_2(self, async_client: Asy frame_id="frameId", instruction="Find all clickable navigation links", options={ + "ignore_selectors": ["nav", ".cookie-banner", "#sidebar-ads"], "model": { "model_name": "openai/gpt-5.4-mini", "api_key": "sk-some-openai-api-key",