Skip to content

Commit 393ebbe

Browse files
feat: Add screenshot option to Extract
1 parent 2bdeae8 commit 393ebbe

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 8
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/stagehand-e77d6b15f0a94b16a54ef87a84d2cabe49eb11cff5ceba76f00dd788ff483eab.yml
3-
openapi_spec_hash: a1dab7fe72a772d188a15305124ebd73
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase/stagehand-80502d74c1be605e77d45ff2b54297fe34ce85dbad1e8f2dfa30ba6d09601219.yml
3+
openapi_spec_hash: fd62f768756a400c3ecd695bfcf3845a
44
config_hash: 1fb12ae9b478488bc1e56bfbdc210b01

src/stagehand/types/session_extract_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ class Options(TypedDict, total=False):
4444
model: OptionsModel
4545
"""Model configuration object or model name string (e.g., 'openai/gpt-5-nano')"""
4646

47+
screenshot: bool
48+
"""
49+
When true, include a screenshot of the current viewport in the extraction LLM
50+
call. Defaults to false.
51+
"""
52+
4753
selector: str
4854
"""CSS selector to scope extraction to a specific element"""
4955

tests/api_resources/test_sessions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@ def test_method_extract_with_all_params_overload_1(self, client: Stagehand) -> N
593593
"project": "my-gcp-project",
594594
"provider": "openai",
595595
},
596+
"screenshot": False,
596597
"selector": "#main-content",
597598
"timeout": 30000,
598599
},
@@ -682,6 +683,7 @@ def test_method_extract_with_all_params_overload_2(self, client: Stagehand) -> N
682683
"project": "my-gcp-project",
683684
"provider": "openai",
684685
},
686+
"screenshot": False,
685687
"selector": "#main-content",
686688
"timeout": 30000,
687689
},
@@ -1729,6 +1731,7 @@ async def test_method_extract_with_all_params_overload_1(self, async_client: Asy
17291731
"project": "my-gcp-project",
17301732
"provider": "openai",
17311733
},
1734+
"screenshot": False,
17321735
"selector": "#main-content",
17331736
"timeout": 30000,
17341737
},
@@ -1818,6 +1821,7 @@ async def test_method_extract_with_all_params_overload_2(self, async_client: Asy
18181821
"project": "my-gcp-project",
18191822
"provider": "openai",
18201823
},
1824+
"screenshot": False,
18211825
"selector": "#main-content",
18221826
"timeout": 30000,
18231827
},

0 commit comments

Comments
 (0)