Skip to content

Commit ba29e1e

Browse files
feat: Add screenshot option to Extract
1 parent b381980 commit ba29e1e

3 files changed

Lines changed: 8 additions & 4 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

session.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,6 +1485,9 @@ func (r *SessionExtractParams) UnmarshalJSON(data []byte) error {
14851485
}
14861486

14871487
type SessionExtractParamsOptions struct {
1488+
// When true, include a screenshot of the current viewport in the extraction LLM
1489+
// call. Defaults to false.
1490+
Screenshot param.Opt[bool] `json:"screenshot,omitzero"`
14881491
// CSS selector to scope extraction to a specific element
14891492
Selector param.Opt[string] `json:"selector,omitzero"`
14901493
// Timeout in ms for the extraction

session_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,9 @@ func TestSessionExtractWithOptionalParams(t *testing.T) {
301301
Provider: stagehand.ModelConfigProviderOpenAI,
302302
},
303303
},
304-
Selector: stagehand.String("#main-content"),
305-
Timeout: stagehand.Float(30000),
304+
Screenshot: stagehand.Bool(false),
305+
Selector: stagehand.String("#main-content"),
306+
Timeout: stagehand.Float(30000),
306307
},
307308
Schema: map[string]any{
308309
"foo": "bar",

0 commit comments

Comments
 (0)