Interface AnthropicHttpClientBuilderCustomizer
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Callback for customizing the
SpringAiAnthropicHttpClient.Builder used by
AnthropicChatModel before the underlying
OkHttpClient is built. Implement this interface to register OkHttp interceptors
(for example, a Spring Security OAuth2 client-credentials interceptor), swap the
dispatcher ExecutorService, or tweak any other OkHttp setting exposed by the
builder.- Since:
- 2.0.0
- Author:
- Ilayaperumal Gopinathan
-
Method Summary
Modifier and TypeMethodDescriptionvoidCustomize theSpringAiAnthropicHttpClient.Builderprior to building the underlying OkHttp client.
-
Method Details
-
customize
Customize theSpringAiAnthropicHttpClient.Builderprior to building the underlying OkHttp client.This method is called twice per
AnthropicChatModelinstance — once for the synchronous client and once for the asynchronous client. Implementations must be idempotent; side effects that must fire exactly once (for example, registering anEventListenerFactoryor binding external state) should guard against re-execution.- Parameters:
builder- the builder to customize
-