Skip to content

Commit 767d168

Browse files
feat: adding gpt 5.1 to stagehand (#1264)
# why we want to benchmark/use the sota models in stagehand # what changed added gpt 5.1 to available models, setting reasoning to low for gpt 5.1 specifically since it cannot be set to minimal. # test plan --------- Co-authored-by: Miguel <36487034+miguelg719@users.noreply.github.com>
1 parent f27a99c commit 767d168

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

.changeset/bright-meals-add.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+
feat: adding gpt 5.1 to stagehand

packages/core/lib/v3/llm/aisdk.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export class AISdkClient extends LLMClient {
127127

128128
let objectResponse: Awaited<ReturnType<typeof generateObject>>;
129129
const isGPT5 = this.model.modelId.includes("gpt-5");
130+
const isGPT51 = this.model.modelId.includes("gpt-5.1");
130131
if (options.response_model) {
131132
try {
132133
objectResponse = await generateObject({
@@ -138,7 +139,7 @@ export class AISdkClient extends LLMClient {
138139
? {
139140
openai: {
140141
textVerbosity: "low", // Making these the default for gpt-5 for now
141-
reasoningEffort: "minimal",
142+
reasoningEffort: isGPT51 ? "low" : "minimal",
142143
},
143144
}
144145
: undefined,

packages/evals/lib/AISdkClientWrapped.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ export class AISdkClientWrapped extends LLMClient {
133133

134134
let objectResponse: Awaited<ReturnType<typeof generateObject>>;
135135
const isGPT5 = this.model.modelId.includes("gpt-5");
136+
const isGPT51 = this.model.modelId.includes("gpt-5.1");
136137
if (options.response_model) {
137138
try {
138139
objectResponse = await generateObject({
@@ -144,7 +145,7 @@ export class AISdkClientWrapped extends LLMClient {
144145
? {
145146
openai: {
146147
textVerbosity: "low", // Making these the default for gpt-5 for now
147-
reasoningEffort: "minimal",
148+
reasoningEffort: isGPT51 ? "low" : "minimal",
148149
},
149150
}
150151
: undefined,

0 commit comments

Comments
 (0)