Class FoundryBackend
-
- All Implemented Interfaces:
-
com.anthropic.backends.Backend
public final class FoundryBackend implements Backend
The Microsoft Foundry backend that manages the API key or bearer token supplier (e.g., Entra ID credentials) and other information required to access an Anthropic AI model on Microsoft Foundry and adapts requests to Foundry's requirements.
Microsoft Foundry requires authentication credentials issued by Microsoft. These can be provided via environment variables or directly to the Builder. The default environment variable API key credentials can be resolved by calling Builder.fromEnv. For other sources of the credentials, resolve them separately and provide them to Builder.apiKey or Builder.bearerTokenSupplier.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classFoundryBackend.BuilderA builder for a FoundryBackend used to connect an Anthropic client to an Anthropic model on the Microsoft Foundry backend service.
The configuration (using an API key) can be resolved from the environment and set on the builder by calling fromEnv before calling build to create the FoundryBackend. Alternatively, set the API key or the bearer token supplier and the resource or base URL explicitly via apiKey or bearerTokenSupplier and resource or baseUrl before calling build.
-
Method Summary
Modifier and Type Method Description final StringgetResource()final StringgetBaseUrl()StringbaseUrl()HttpRequestprepareRequest(HttpRequest request)HttpRequestauthorizeRequest(HttpRequest request)Unitclose()final static FoundryBackend.Builderbuilder()final static FoundryBackendfromEnv()-
-
Method Detail
-
getResource
final String getResource()
-
getBaseUrl
final String getBaseUrl()
-
prepareRequest
HttpRequest prepareRequest(HttpRequest request)
-
authorizeRequest
HttpRequest authorizeRequest(HttpRequest request)
-
builder
final static FoundryBackend.Builder builder()
-
fromEnv
final static FoundryBackend fromEnv()
-
-
-
-