Skip to content
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 Vertex AI authentication using JSON service account key #58

Open
Roisfaozi opened this issue Nov 11, 2024 · 0 comments
Open

Comments

@Roisfaozi
Copy link

Background:

  • Currently, the Anthropic Go SDK does not directly support authentication to Vertex AI using JSON service account keys, a common method for managing credentials in Google Cloud environments.
  • This feature is essential to simplify integration with Vertex AI and provide more flexibility in credential management.

Goal:

  • Add a new feature to the Anthropic Go SDK allowing users to:
  • Specify the path to a JSON service account key file in the SDK configuration.
  • Use the credentials in the file to authenticate to Vertex AI.
  • Make authenticated API calls to Vertex AI.

Proposed Implementation:

  • Option 1: New Configuration Function:
  • Add a new configuration function to the SDK to specify the path to the JSON service account key file.
  • This function will load the credentials and use them to create a Vertex AI client.
  • Option 2: Additional Option in Client Creation Function:
  • Add an optional parameter to the client creation function to accept the path to the JSON service account key file.
  • Option 3: Environment Variable:
  • Allow users to specify the path to the credential file via an environment variable.

Example Usage:

// Option 1: New configuration function
client, err := anthropic.NewClient(ctx, anthropic.WithVertexAICredentialsFile("/path/to/your/key.json"))

// Option 2: Additional option in client creation function
client, err := anthropic.NewClient(ctx, anthropic.WithVertexAICredentials(ctx, "/path/to/your/key.json"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant