diff --git a/providers/anthropic/anthropic.go b/providers/anthropic/anthropic.go index 1a7004205dff6fee51fbcfe930de854e78ca80b5..b1bcee24cd40d6751c73dab9317e6c30c97037ed 100644 --- a/providers/anthropic/anthropic.go +++ b/providers/anthropic/anthropic.go @@ -30,6 +30,8 @@ const ( Name = "anthropic" // DefaultURL is the default URL for the Anthropic API. DefaultURL = "https://api.anthropic.com" + // VertexAuthScope is the auth scope required for vertex auth if using a Service Account JSON file (e.g. GOOGLE_APPLICATION_CREDENTIALS). + VertexAuthScope = "https://www.googleapis.com/auth/cloud-platform" ) type options struct { @@ -171,7 +173,7 @@ func (a *provider) LanguageModel(ctx context.Context, modelID string) (fantasy.L credentials = &google.Credentials{TokenSource: &googleDummyTokenSource{}} } else { var err error - credentials, err = google.FindDefaultCredentials(ctx) + credentials, err = google.FindDefaultCredentials(ctx, VertexAuthScope) if err != nil { return nil, err }