Skip to content

[FEATURE] dotAI: LangChain4J integration — Phase 2 (Azure OpenAI) #35333

@ihoffmann-dot

Description

@ihoffmann-dot

Problem Statement

dotCMS's LangChain4J integration (Phase 1) supports only standalone OpenAI. Enterprise customers whose compliance frameworks require AI services hosted within Azure infrastructure — for data residency, contractual privacy guarantees, or corporate policy — cannot configure dotAI to route through their Azure OpenAI deployments without code changes.

Solution

Add Azure OpenAI as a supported provider in LangChain4jModelFactory. The azure_openai case maps deployment-based configuration (deploymentName, endpoint, apiVersion) to the LangChain4J Azure OpenAI builders for chat, embeddings, and image generation. No changes required outside the factory class. Only a providerConfig JSON update is needed to switch from OpenAI to Azure.

{
  "chat": {
    "provider": "azure_openai",
    "apiKey": "...",
    "endpoint": "https://my-company.openai.azure.com/",
    "deploymentName": "gpt-4o",
    "apiVersion": "2024-02-01",
    "maxTokens": 16384,
    "temperature": 1.0
  },
  "embeddings": {
    "provider": "azure_openai",
    "apiKey": "...",
    "endpoint": "https://my-company.openai.azure.com/",
    "deploymentName": "text-embedding-ada-002",
    "apiVersion": "2024-02-01"
  },
  "image": {
    "provider": "azure_openai",
    "apiKey": "...",
    "endpoint": "https://my-company.openai.azure.com/",
    "deploymentName": "dall-e-3",
    "apiVersion": "2024-02-01"
  }
}

Acceptance Criteria

  • Chat completions, embeddings, and image generation all work end-to-end using provider: "azure_openai" in providerConfig.
  • deploymentName, endpoint, and apiVersion are correctly passed to the LangChain4J Azure builders.
  • deploymentName falls back to model if not explicitly set.
  • langchain4j-azure-open-ai dependency is added; Netty and Reactor versions are pinned in BOM to resolve transitive conflicts introduced by the Azure SDK.
  • Unit tests cover the Azure OpenAI builder paths in LangChain4jModelFactoryTest.

dotCMS Version

main

Links

Metadata

Metadata

Assignees

Type

No type

Projects

Status

In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions