Skip to content

feat(dotAI): Dot AI LangChain4J - Anthropic#36138

Draft
ihoffmann-dot wants to merge 1 commit into
mainfrom
dot-ai-langchain-anthropic
Draft

feat(dotAI): Dot AI LangChain4J - Anthropic#36138
ihoffmann-dot wants to merge 1 commit into
mainfrom
dot-ai-langchain-anthropic

Conversation

@ihoffmann-dot

Copy link
Copy Markdown
Member

Summary

Adds Anthropic as a supported provider, talking directly to the Anthropic Messages
API with an API key — distinct from accessing Claude models through AWS Bedrock,
which requires AWS infrastructure and IAM credentials.

  • Add langchain4j-anthropic dependency (version via langchain4j BOM)
  • Add AnthropicModelProviderStrategy registered in LangChain4jModelFactory.STRATEGIES
  • Chat + streaming chat via AnthropicChatModel / AnthropicStreamingChatModel
  • Embeddings and image throw UnsupportedOperationException (Anthropic has no such APIs)
  • endpoint config field overrides the default base URL (proxies/gateways)
  • Add 8 unit tests in LangChain4jModelFactoryTest

Configuration

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

Notes

  • Model IDs use the Anthropic form: claude-sonnet-4-6, claude-opus-4-8, claude-haiku-4-5.
  • maxRetries is not supported by the streaming chat model and is ignored with a warning (same behavior as the OpenAI provider).

Related Issue

This PR fixes #36135
EPIC: dotAI Multi-Provider Support #33970

@claude

claude Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Claude finished @ihoffmann-dot's task in 48s —— View job


Rollback Safety Analysis

  • Read rollback-unsafe categories reference
  • Get full PR diff
  • Analyze diff against unsafe categories
  • Apply appropriate label

Result: ✅ Safe to Roll Back

Checked all categories — none apply:

Category Finding
C-1 Structural Data Model No DB schema changes
C-2 ES Mapping No ES mapping changes
C-3 Content JSON Model Version No CURRENT_MODEL_VERSION bump
C-4 DROP TABLE/COLUMN No drops
H-1 One-Way Data Migration No runonce migration tasks
H-2 RENAME TABLE/COLUMN No renames
H-3 PK Restructuring No PK changes
H-4 New Content Type Field Type No new field types
H-5 Binary Storage Provider No storage provider changes
H-6 DROP PROCEDURE/FUNCTION No procedure drops
H-7 NOT NULL column without default No DB columns added
H-8 VTL Viewtool Contract No viewtool changes
M-1 Non-Broadening Column Type No column type changes
M-2 Push Publishing Bundle Format No bundle format changes
M-3 REST/GraphQL API Contract No API contract changes
M-4 OSGi Plugin API No OSGi interface changes

This PR adds only: a new Maven dependency (langchain4j-anthropic), a new package-private Java class implementing an existing internal interface, Javadoc updates, and unit tests. Rolling back to N-1 simply removes the Anthropic provider — no data, mappings, or external contracts are affected.

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

🤖 Codex Review — openai.gpt-5.5

**[> [🟡 Medium] dotCMS/pom.xml:517 — New dependency is added directly to dotCMS/pom.xml without a corresponding change in bom/application/pom.xml. dotCMS convention requires dependency version management to be added in bom/application/pom.xml only; if this artifact is not already managed, Maven builds will fail or dependency resolution will be inconsistent.


Run: #27393355787 · tokens: in: 3665 · out: 605 (reasoning: 516) · total: 4270

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI: Safe To Rollback Area : Backend PR changes Java/Maven backend code

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

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

1 participant