Support full Google GenAI client options (support Vertex AI as alternative to Gemini API key)
why
- In my organisation, we use Vertex AI for authenticated LLM calls using Google Cloud service accounts instead of the Gemini API keys.
- I also need control over the Vertex AI location being used for data residency guarantees.
what changed
I updated the typing of ClientOptions to support the full Google GenAI client constructor options, just like the Anthropic and OpenAI client options are already passed verbatim.
Because the Google GenAI client options don't have a baseUrl key, I also added explicit typing for the client options used for the ai-sdk model provider.
test plan
As this is only a typing change, I foresaw no immediate need for unit tests. Authentication with VertexAI is already tested as part of the GenAI client package.
🦋 Changeset detected
Latest commit: 558a50db92c1db37bfc86cebd814eb9a289562c5
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 2 packages
| Name | Type |
|---|---|
| @browserbasehq/stagehand | Patch |
| @browserbasehq/stagehand-evals | Patch |
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
If in the future you want to only support the AI SDK (basing this off https://github.com/browserbase/stagehand/pull/1129#issuecomment-3400295962), this is also possible, but typing will need to be expanded to allow passing other options than simply an API key and base URL:
Docs:
- https://ai-sdk.dev/providers/ai-sdk-providers/google-vertex