Skip to content

Support for setting project and location settings on GoogleGenAI client to comply with data residency requirements and use service account authentication #1221

@mcndt

Description

@mcndt

Is your feature request related to a problem? Please describe.

When using google models (via the GoogleClient and GoogleCUAClient internally), it is currently not possible to pass any settings other than apiKey.

For our organisation, it's crucial that we can control the location parameter so that we can guarantee inference happens in the europe-west1 region when running in production with customer data.

Without this option, we cannot use Stagehand + Browserbase in production.

Additionally, if we can also control the project parameter, we can perform inference via Vertex AI with service accounts for authentication, which is the standardised flow in our organisation. In this way, we have no need to even pass any api keys to the application at runtime.

Describe the solution you'd like

I have already opened a PR (#1130) that allows using all Google GenAI options as model parameters, but am yet waiting on feedback. I would love for the team to have a look at this.

I have not yet had the time to update the PR with the new v3.0.1 release, but will of course do so if I receive feedback on the PR.

Describe alternatives you've considered
There is no possible workaround to control the Google GenAI's client location routing in Stagehand.

Are you willing to contribute to implementing this feature or fix?

  • Yes, I can submit a PR
  • Yes, but I need guidance
  • No, I cannot contribute at this time

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions