Skip to content

Commit b077d3f

Browse files
authored
Set default schema on extract options with null schema (browserbase#860)
# why Used to be possible, now it's breaking # what changed Set default schema whenever extract options doesn't provide one # test plan
1 parent 8a43c5a commit b077d3f

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

.changeset/polite-vans-prove.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@browserbasehq/stagehand": patch
3+
---
4+
5+
Set default schema on extract options with no schema

lib/StagehandPage.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,12 @@ ${scriptContent} \
736736
instruction: instructionOrOptions,
737737
schema: defaultExtractSchema as T,
738738
}
739-
: instructionOrOptions;
739+
: instructionOrOptions.schema
740+
? instructionOrOptions
741+
: {
742+
...instructionOrOptions,
743+
schema: defaultExtractSchema as T,
744+
};
740745

741746
const {
742747
instruction,

0 commit comments

Comments
 (0)