-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add support for custom base url with google computer use #1257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for custom base url with google computer use #1257
Conversation
🦋 Changeset detectedLatest commit: 1e7e69a The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Greptile OverviewGreptile SummaryAdds support for custom Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant AgentProvider
participant GoogleCUAClient
participant GoogleGenAI
participant ProxyServer
User->>AgentProvider: getClient(modelName, clientOptions)
Note over User,AgentProvider: clientOptions contains baseURL
AgentProvider->>GoogleCUAClient: new GoogleCUAClient(type, modelName, instructions, clientOptions)
GoogleCUAClient->>GoogleCUAClient: Extract baseURL from clientOptions
GoogleCUAClient->>GoogleCUAClient: Build genAIOptions with httpOptions.baseUrl
GoogleCUAClient->>GoogleGenAI: new GoogleGenAI(genAIOptions)
Note over GoogleGenAI: Configured to use custom baseURL
GoogleCUAClient->>GoogleCUAClient: Store baseURL in clientOptions
User->>GoogleCUAClient: execute(executionOptions)
GoogleCUAClient->>GoogleGenAI: models.generateContent()
alt Custom baseURL provided
GoogleGenAI->>ProxyServer: API request via custom baseURL
ProxyServer->>GoogleGenAI: Response
else No custom baseURL
GoogleGenAI->>GoogleGenAI: API request to default endpoint
end
GoogleGenAI-->>GoogleCUAClient: GenerateContentResponse
GoogleCUAClient-->>User: AgentResult
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 file reviewed, 1 comment
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @browserbasehq/stagehand@3.0.2 ### Patch Changes - [#1245](#1245) [`a224b33`](a224b33) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - allow act() to call hover() - [#1234](#1234) [`6fc9de2`](6fc9de2) Thanks [@miguelg719](https://github.com/miguelg719)! - Add a page.sendCDP method - [#1233](#1233) [`4935be7`](4935be7) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - extend page.screenshot() options to mirror playwright - [#1232](#1232) [`bdd76fc`](bdd76fc) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - export Page type - [#1229](#1229) [`7ea18a4`](7ea18a4) Thanks [@tkattkat](https://github.com/tkattkat)! - Adjust extract tool + expose extract response in agent result - [#1239](#1239) [`d4de014`](d4de014) Thanks [@miguelg719](https://github.com/miguelg719)! - Fix stagehand.metrics on api mode - [#1241](#1241) [`2d1b573`](2d1b573) Thanks [@miguelg719](https://github.com/miguelg719)! - Return response on page.goto api mode - [#1253](#1253) [`5556041`](5556041) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - fix missing page issue when connecting to existing browser - [#1235](#1235) [`7e4b43e`](7e4b43e) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - make page.goto() return a Response object - [#1254](#1254) [`7e72adf`](7e72adf) Thanks [@sameelarif](https://github.com/sameelarif)! - Added custom error types to allow for a smoother debugging experience. - [#1227](#1227) [`9bf09d0`](9bf09d0) Thanks [@miguelg719](https://github.com/miguelg719)! - Fix readme's media links and add instructions for installing from a branch - [#1257](#1257) [`92d32ea`](92d32ea) Thanks [@tkattkat](https://github.com/tkattkat)! - Add support for a custom baseUrl with google cua client - [#1230](#1230) [`ebcf3a1`](ebcf3a1) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - add stagehand.browserbaseSessionID getter - [#1262](#1262) [`c29a4f2`](c29a4f2) Thanks [@miguelg719](https://github.com/miguelg719)! - Remove error throwing when api and experimental are both set - [#1223](#1223) [`6d21efa`](6d21efa) Thanks [@miguelg719](https://github.com/miguelg719)! - Disable api mode when using custom LLM clients - [#1228](#1228) [`525ef0c`](525ef0c) Thanks [@Kylejeong2](https://github.com/Kylejeong2)! - update slack link in docs - [#1226](#1226) [`9ddb872`](9ddb872) Thanks [@seanmcguire12](https://github.com/seanmcguire12)! - add support for page.on('console') events ## @browserbasehq/stagehand-evals@1.1.2 ### Patch Changes - Updated dependencies \[[`a224b33`](a224b33), [`6fc9de2`](6fc9de2), [`4935be7`](4935be7), [`bdd76fc`](bdd76fc), [`7ea18a4`](7ea18a4), [`d4de014`](d4de014), [`2d1b573`](2d1b573), [`5556041`](5556041), [`7e4b43e`](7e4b43e), [`7e72adf`](7e72adf), [`9bf09d0`](9bf09d0), [`92d32ea`](92d32ea), [`ebcf3a1`](ebcf3a1), [`c29a4f2`](c29a4f2), [`6d21efa`](6d21efa), [`525ef0c`](525ef0c), [`9ddb872`](9ddb872)]: - @browserbasehq/stagehand@3.0.2 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
why
currently, there is no way to use a custom baseURL with the google cua client
what changed
when a baseurl is provided in the model object and google cua is used, the client will now proxy all requests through the defined base url
test plan
tested locally
tested on api
I have also made a separate branch, with a proxy server and example script to test if desired
https://github.com/browserbase/stagehand/tree/google-baseurl-example