File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @browserbasehq/stagehand " : patch
3
+ ---
4
+
5
+ Allow OpenAI CUA to take in an optional baseURL
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ export class OpenAICUAClient extends AgentClient {
41
41
// Process client options
42
42
this . apiKey =
43
43
( clientOptions ?. apiKey as string ) || process . env . OPENAI_API_KEY || "" ;
44
+ this . baseURL = ( clientOptions ?. baseURL as string ) || undefined ;
44
45
this . organization =
45
46
( clientOptions ?. organization as string ) || process . env . OPENAI_ORG ;
46
47
@@ -57,6 +58,10 @@ export class OpenAICUAClient extends AgentClient {
57
58
apiKey : this . apiKey ,
58
59
} ;
59
60
61
+ if ( this . baseURL ) {
62
+ this . clientOptions . baseURL = this . baseURL ;
63
+ }
64
+
60
65
// Initialize the OpenAI client
61
66
this . client = new OpenAI ( this . clientOptions ) ;
62
67
}
You can’t perform that action at this time.
0 commit comments