Class VertexBackend
-
- All Implemented Interfaces:
-
com.anthropic.backends.Backend
public final class VertexBackend implements Backend
The Google Cloud Vertex AI backend that manages the Google OAuth2 credentials and other information required to access an Anthropic AI model on Vertex AI and adapts requests to Vertex AI's requirements.
Google Cloud Vertex AI requires authentication credentials issued by Google. These can be provided via environment variables, or other Google facilities, such as the Google Cloud CLI. The application default credentials (ADC) can be resolved by calling Builder.fromEnv. For other types of credentials, create them separately and supply them to Builder.googleCredentials.
See the Google Cloud documentation for details on how to configure Google credentials.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classVertexBackend.BuilderA builder for a VertexBackend used to connect an Anthropic client to an Anthropic model on the Google Cloud Vertex AI backend service.
The credentials can be extracted from the environment and set on the builder by calling fromEnv before calling build to create the VertexBackend. Alternatively, set the Google credentials, region and project explicitly via googleCredentials, region and project before calling build.
-
Field Summary
Fields Modifier and Type Field Description private final GoogleCredentialsgoogleCredentialsprivate final Stringregionprivate final Stringproject
-
Method Summary
Modifier and Type Method Description final GoogleCredentialsgoogleCredentials()final Stringregion()final Stringproject()StringbaseUrl()HttpRequestprepareRequest(HttpRequest request)HttpRequestauthorizeRequest(HttpRequest request)Unitclose()final static VertexBackend.Builderbuilder()final static VertexBackendfromEnv()-
-
Method Detail
-
googleCredentials
final GoogleCredentials googleCredentials()
-
prepareRequest
HttpRequest prepareRequest(HttpRequest request)
-
authorizeRequest
HttpRequest authorizeRequest(HttpRequest request)
-
builder
final static VertexBackend.Builder builder()
-
fromEnv
final static VertexBackend fromEnv()
-
-
-
-