What should we do?
Replace the LangChain4j bridge for the anthropic provider discriminator with a native implementation over the official com.anthropic:anthropic-java SDK. Direct backend only — Bedrock / Vertex / Foundry backends are out of scope for this issue.
Requirements:
- Streaming-first internal driver; public surface stays
CompletableFuture<ChatResponse> plus the optional ChatStreamListener.
- Hardcoded
ModelCapabilities matching today's behavior on this discriminator: text + image + document on user-message; text on tool-result; text on assistant-message.
- Token usage accounting populated from the provider response (cache + reasoning fields stay at zero in this phase).
- Stop-reason mapping from Anthropic finish reasons to the normalized
StopReason enum.
- Transport / SDK / auth errors complete the future exceptionally with
ConnectorException(ERROR_CODE_FAILED_MODEL_CALL, ...); model-side terminal errors (refusal, content filter, etc.) complete normally with stopReason=ERROR.
- HTTP transport via the shared JDK
HttpClient utility so proxy config works on day one.
Why should we do it?
First native implementation; validates the SPI shape against a real vendor SDK before generalising to OpenAI, Google, Bedrock-Converse.
What should we do?
Replace the LangChain4j bridge for the
anthropicprovider discriminator with a native implementation over the officialcom.anthropic:anthropic-javaSDK. Direct backend only — Bedrock / Vertex / Foundry backends are out of scope for this issue.Requirements:
CompletableFuture<ChatResponse>plus the optionalChatStreamListener.ModelCapabilitiesmatching today's behavior on this discriminator: text + image + document on user-message; text on tool-result; text on assistant-message.StopReasonenum.ConnectorException(ERROR_CODE_FAILED_MODEL_CALL, ...); model-side terminal errors (refusal, content filter, etc.) complete normally withstopReason=ERROR.HttpClientutility so proxy config works on day one.Why should we do it?
First native implementation; validates the SPI shape against a real vendor SDK before generalising to OpenAI, Google, Bedrock-Converse.