Add credentials auth for Google vertex #1392
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
This pull request introduces credential-based authentication for Vertex AI, enabling users to easily switch between Google Cloud accounts.
Simplified Account Switching:
Users working across multiple Google Cloud projects can now seamlessly switch accounts without relying solely on Application Default Credentials (ADC). This eliminates the need for complex ADC management when using various profiles.
Enhanced Flexibility:
This feature benefits users who may not have the Google Cloud CLI installed or prefer direct credential management.
Implementation
Screenshots
After:
How to Test
Ensure the Vertex AI API is enabled for your Google Cloud project.
Verify that the desired Claude models are accessible.
Create a new service account with the necessary Vertex AI permissions.
Generate a service account key (JSON format recommended). Refer to the Google Workspace documentation for guidance: https://developers.google.com/workspace/guides/create-credentials?hl=en#service-account
In the Vertex AI settings, paste the JSON content of the service account key into the "Google Cloud Credentials" field, or provide the file path to 'Google Cloud Key File Path' field.
Execute a prompt to confirm successful authentication and model interaction.
Get in Touch
For any questions or feedback, please reply to this pull request or reach out to Eong on the Discord channel.
Important
Add credential-based authentication for Google Vertex AI, allowing account switching using JSON credentials or key files, with updates to
vertex.ts,ClineProvider.ts, andapi.ts.vertex.tsusing JSON credentials or key files.ClineProvider.tsto handle new authentication optionsvertexJsonCredentialsandvertexKeyFile.vertexJsonCredentialsandvertexKeyFiletoApiHandlerOptionsinapi.ts.ApiOptions.tsxto include input fields for Google Cloud credentials and key file path.This description was created by
for 01f83b4. It will automatically update as commits are pushed.