Class AnthropicModelCatalog.Builder
java.lang.Object
dev.langchain4j.model.anthropic.AnthropicModelCatalog.Builder
- Enclosing class:
AnthropicModelCatalog
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the Anthropic API key used to authenticate requests.Sets the base URL of the Anthropic API.build()httpClientBuilder(HttpClientBuilder httpClientBuilder) Sets a customHttpClientBuilderfor the underlying HTTP client.logger(org.slf4j.Logger logger) Sets an alternateLoggerto be used instead of the default one provided by LangChain4j for logging requests and responses.logRequests(Boolean logRequests) Enables debug logging of HTTP request bodies sent to the Anthropic API.logResponses(Boolean logResponses) Enables debug logging of HTTP response bodies received from the Anthropic API.Sets the HTTP request timeout for calls to the Anthropic API.Sets the value of theanthropic-versionrequest header.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
httpClientBuilder
Sets a customHttpClientBuilderfor the underlying HTTP client. Use this to configure timeouts, proxies, or other HTTP-level settings.- Parameters:
httpClientBuilder- the HTTP client builder- Returns:
this
-
baseUrl
Sets the base URL of the Anthropic API.Defaults to
https://api.anthropic.com/v1/.- Parameters:
baseUrl- the base URL- Returns:
this
-
apiKey
Sets the Anthropic API key used to authenticate requests.Alternatively, set the
ANTHROPIC_API_KEYenvironment variable.- Parameters:
apiKey- the API key- Returns:
this
-
version
Sets the value of theanthropic-versionrequest header.Defaults to
2023-06-01. See the Anthropic API versioning docs.- Parameters:
version- the API version string- Returns:
this
-
timeout
Sets the HTTP request timeout for calls to the Anthropic API.- Parameters:
timeout- the request timeout- Returns:
this
-
logRequests
Enables debug logging of HTTP request bodies sent to the Anthropic API.- Parameters:
logRequests- whether to log requests- Returns:
this
-
logResponses
Enables debug logging of HTTP response bodies received from the Anthropic API.- Parameters:
logResponses- whether to log responses- Returns:
this
-
logger
Sets an alternateLoggerto be used instead of the default one provided by LangChain4j for logging requests and responses.- Parameters:
logger- the logger to use- Returns:
this
-
build
-