Skip to content

Native Anthropic Messages chat model API #7218

@maff

Description

@maff

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentic-aikind:taskCategorizes an issue or PR as general maintenance, i.e. cleanup, refactoring, etc.

    Type

    Urgency

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions