Skip to content

[FEATURE] dotAI: LangChain4J integration — Phase 2 (Anthropic) #36135

Description

@ihoffmann-dot

Problem Statement

dotCMS's LangChain4J integration can reach Anthropic Claude models only through AWS Bedrock, which requires AWS infrastructure, IAM credentials and region configuration. Customers with a direct Anthropic account who want Claude via the Anthropic Messages API — a simple API key, no AWS dependency — have no way to configure dotAI for it without code changes.

Solution

Add Anthropic as a supported provider in LangChain4jModelFactory under the identifier anthropic. Talks directly to the Anthropic Messages API with an API key. Supports chat (streaming and non-streaming); Anthropic offers no embeddings or image-generation APIs, so those throw UnsupportedOperationException. The endpoint field optionally overrides the default base URL (proxies/gateways).

{
  "chat": {
    "provider": "anthropic",
    "model": "claude-sonnet-4-6",
    "apiKey": "sk-ant-...",
    "maxTokens": 4096,
    "temperature": 0.7
  }
}

Acceptance Criteria

  • Chat completions work end-to-end using provider: "anthropic" in providerConfig.
  • Streaming chat works through the same provider.
  • endpoint overrides the default base URL when set (proxies/gateways).
  • Attempting embeddings or image generation with provider: "anthropic" throws a clear UnsupportedOperationException.
  • Unit tests cover the Anthropic builder paths in LangChain4jModelFactoryTest.

dotCMS Version

main

Links

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions