Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/bright-meals-add.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@browserbasehq/stagehand": patch
---

feat: adding gpt 5.1 to stagehand
3 changes: 2 additions & 1 deletion packages/core/lib/v3/llm/aisdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export class AISdkClient extends LLMClient {

let objectResponse: Awaited<ReturnType<typeof generateObject>>;
const isGPT5 = this.model.modelId.includes("gpt-5");
const isGPT51 = this.model.modelId.includes("gpt-5.1");
if (options.response_model) {
try {
objectResponse = await generateObject({
Expand All @@ -138,7 +139,7 @@ export class AISdkClient extends LLMClient {
? {
openai: {
textVerbosity: "low", // Making these the default for gpt-5 for now
reasoningEffort: "minimal",
reasoningEffort: isGPT51 ? "low" : "minimal",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason to make 5.1 low vs 5 minimal? is it faster?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its a weird syntax change, you have to set to low because the model doesn't accept minimal as a param

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@miguelg719

can also apparently set the reasoning to none

https://platform.openai.com/docs/guides/latest-model

},
}
: undefined,
Expand Down
3 changes: 2 additions & 1 deletion packages/evals/lib/AISdkClientWrapped.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ export class AISdkClientWrapped extends LLMClient {

let objectResponse: Awaited<ReturnType<typeof generateObject>>;
const isGPT5 = this.model.modelId.includes("gpt-5");
const isGPT51 = this.model.modelId.includes("gpt-5.1");
if (options.response_model) {
try {
objectResponse = await generateObject({
Expand All @@ -144,7 +145,7 @@ export class AISdkClientWrapped extends LLMClient {
? {
openai: {
textVerbosity: "low", // Making these the default for gpt-5 for now
reasoningEffort: "minimal",
reasoningEffort: isGPT51 ? "low" : "minimal",
},
}
: undefined,
Expand Down