Class BedrockMantleBackend.Builder
-
- All Implemented Interfaces:
public final class BedrockMantleBackend.BuilderA builder for a BedrockMantleBackend used to connect an Anthropic client to the Bedrock Mantle backend service.
The AWS credentials and region can be extracted from the environment and set on the builder by calling fromEnv before calling build to create the BedrockMantleBackend. Alternatively, set the AWS credentials and region explicitly via awsCredentials and region before calling build. A custom AWS credentials provider can be passed to fromEnv or awsCredentialsProvider.
You should set either the AWS credentials provider or the API key, but not both. If both are set, an error will occur.
-
-
Method Summary
Modifier and Type Method Description final BedrockMantleBackend.BuilderfromEnv(AwsCredentialsProvider awsCredentialsProvider)Resolves the AWS credentials from the environment, or other sources configured by the credentials provider. final BedrockMantleBackend.BuilderfromEnv()Resolves the AWS credentials from the environment, or other sources configured by the credentials provider. final BedrockMantleBackend.BuilderawsCredentialsProvider(AwsCredentialsProvider awsCredentialsProvider)final BedrockMantleBackend.BuilderawsCredentials(AwsCredentials awsCredentials)final BedrockMantleBackend.BuilderawsAccessKey(String awsAccessKey)final BedrockMantleBackend.BuilderawsSecretAccessKey(String awsSecretAccessKey)final BedrockMantleBackend.BuilderawsSessionToken(String awsSessionToken)final BedrockMantleBackend.BuilderawsProfile(String awsProfile)final BedrockMantleBackend.BuilderapiKey(String apiKey)final BedrockMantleBackend.Builderregion(Region region)final BedrockMantleBackend.BuilderskipAuth(Boolean skipAuth)final BedrockMantleBackend.BuilderbaseUrl(String baseUrl)final BedrockMantleBackendbuild()-
-
Method Detail
-
fromEnv
@JvmOverloads() final BedrockMantleBackend.Builder fromEnv(AwsCredentialsProvider awsCredentialsProvider)
Resolves the AWS credentials from the environment, or other sources configured by the credentials provider.
Auth resolution follows a 5-level precedence order:
apiKey set directly on the builder -> API key mode
awsAccessKey + awsSecretAccessKey set on the builder -> SigV4 with explicit creds
awsProfile set on the builder -> SigV4 with named profile
AWS_BEARER_TOKEN_BEDROCKenv var (falls back toANTHROPIC_AWS_API_KEY) -> API key mode (only when no explicit auth constructor args were provided)Default AWS credential chain -> SigV4
The base URL is resolved from
ANTHROPIC_BEDROCK_MANTLE_BASE_URL.
-
fromEnv
@JvmOverloads() final BedrockMantleBackend.Builder fromEnv()
Resolves the AWS credentials from the environment, or other sources configured by the credentials provider.
Auth resolution follows a 5-level precedence order:
apiKey set directly on the builder -> API key mode
awsAccessKey + awsSecretAccessKey set on the builder -> SigV4 with explicit creds
awsProfile set on the builder -> SigV4 with named profile
AWS_BEARER_TOKEN_BEDROCKenv var (falls back toANTHROPIC_AWS_API_KEY) -> API key mode (only when no explicit auth constructor args were provided)Default AWS credential chain -> SigV4
The base URL is resolved from
ANTHROPIC_BEDROCK_MANTLE_BASE_URL.
-
awsCredentialsProvider
final BedrockMantleBackend.Builder awsCredentialsProvider(AwsCredentialsProvider awsCredentialsProvider)
-
awsCredentials
final BedrockMantleBackend.Builder awsCredentials(AwsCredentials awsCredentials)
-
awsAccessKey
final BedrockMantleBackend.Builder awsAccessKey(String awsAccessKey)
-
awsSecretAccessKey
final BedrockMantleBackend.Builder awsSecretAccessKey(String awsSecretAccessKey)
-
awsSessionToken
final BedrockMantleBackend.Builder awsSessionToken(String awsSessionToken)
-
awsProfile
final BedrockMantleBackend.Builder awsProfile(String awsProfile)
-
apiKey
final BedrockMantleBackend.Builder apiKey(String apiKey)
-
region
final BedrockMantleBackend.Builder region(Region region)
-
skipAuth
final BedrockMantleBackend.Builder skipAuth(Boolean skipAuth)
-
baseUrl
final BedrockMantleBackend.Builder baseUrl(String baseUrl)
-
build
final BedrockMantleBackend build()
-
-
-
-