Skip to content

[IMPROVEMENT] dotAI: upgrade LangChain4j to 1.15.1 and fix Azure image generation with gpt-image-1 #35916

@ihoffmann-dot

Description

@ihoffmann-dot

Problem Statement

The dotAI LangChain4J integration was pinned to version 1.0.0. Two issues stemmed from this:

  1. Azure image generation broken: Azure deprecated dall-e-3 in June 2025. The existing AzureOpenAiImageModel only supported dall-e-3, leaving Azure customers with no working image generation model.

  2. Outdated dependency: LangChain4j 1.15.1 (released 2026-05-28) includes significant improvements, bug fixes, and API updates over 1.0.0.

Solution

  1. Bump langchain4j.version from 1.0.0 to 1.15.1 in bom/application/pom.xml.

  2. Add langchain4j-open-ai-official dependency to dotCMS/pom.xml. This module provides OpenAiOfficialImageModel, which supports Azure via Microsoft Foundry (isMicrosoftFoundry(true)) and enables gpt-image-1 image generation on Azure.

  3. Update AzureOpenAiModelProviderStrategy.buildImageModel() to use OpenAiOfficialImageModel instead of the deprecated AzureOpenAiImageModel.

  4. Fix VertexAiModelProviderStrategy imports: the Vertex AI Gemini classes moved from dev.langchain4j.model.vertexai to dev.langchain4j.model.vertexai.gemini in 1.15.1.

Sample Configuration

{
  "image": {
    "provider": "azure_openai",
    "apiKey": "...",
    "endpoint": "https://<resource>.openai.azure.com/",
    "deploymentName": "gpt-image-1",
    "apiVersion": "2025-04-01-preview",
    "size": "1024x1024"
  }
}

Acceptance Criteria

  • langchain4j.version is 1.15.1 in bom/application/pom.xml.
  • Azure image generation works end-to-end with gpt-image-1.
  • Existing Azure chat and embeddings are unaffected.
  • Existing Vertex and OpenAI providers are unaffected.

dotCMS Version

main

Links

Metadata

Metadata

Assignees

Labels

No labels
No labels

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