-
Notifications
You must be signed in to change notification settings - Fork 1.3k
add support for vertex model provider #1325
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 415d8f4 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 Google Vertex AI as a supported model provider alongside existing OpenAI, Anthropic, and other providers. This enables users to leverage Vertex AI models through the AI SDK. Key Changes:
Impact: Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant Stagehand
participant LLMProvider
participant getAISDKLanguageModel
participant createVertex
participant VertexModel
User->>Stagehand: Initialize with model config
Note over User,Stagehand: model: "vertex/gemini-1.5-pro"<br/>clientOptions: { apiKey: "..." }
Stagehand->>LLMProvider: getClient(modelName, clientOptions)
Note over LLMProvider: Detects "/" in model name<br/>Splits into provider & model
LLMProvider->>getAISDKLanguageModel: ("vertex", "gemini-1.5-pro", clientOptions)
Note over getAISDKLanguageModel: Check if clientOptions provided
getAISDKLanguageModel->>createVertex: createVertex(clientOptions)
Note over createVertex: Creates Vertex provider with<br/>GoogleVertexProviderSettings
createVertex-->>getAISDKLanguageModel: vertexProvider
getAISDKLanguageModel->>VertexModel: vertexProvider("gemini-1.5-pro")
VertexModel-->>getAISDKLanguageModel: languageModel instance
getAISDKLanguageModel-->>LLMProvider: languageModel
LLMProvider->>LLMProvider: new AISdkClient(languageModel)
LLMProvider-->>Stagehand: LLMClient instance
Stagehand-->>User: Ready to use Vertex models
|
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.
5 files reviewed, 2 comments
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 issue found across 6 files
Prompt for AI agents (all 1 issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="packages/core/package.json">
<violation number="1" location="packages/core/package.json:43">
P0: Invalid semver syntax: the caret (`^`) must be placed BEFORE the version number, not after. `3.25.76^` should be `^3.25.76`. This will cause package installation to fail or behave unexpectedly.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
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.
13 files reviewed, no comments
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.
No issues found across 14 files
Why
Adding Vertex AI support to Stagehand.
What changed
GoogleVertexProviderSettingsfrom@ai-sdk/google-vertextoClientOptionstype@anthropic-ai/sdkandopenaipackagesTest plan
Summary by cubic
Adds Vertex AI as a supported provider with typed client options, including service account credentials, and an env var for the API key.
Why:
What:
Test Plan:
Written for commit 415d8f4. Summary will update automatically on new commits.