Skip to content

[FEATURE] dotAI: LangChain4J integration — Phase 2 (Google Vertex AI) #35335

@ihoffmann-dot

Description

@ihoffmann-dot

Problem Statement

dotCMS's LangChain4J integration (Phase 1) supports only standalone OpenAI. Enterprise customers on GCP need to route AI workloads through Vertex AI (Gemini), which provides managed model access under Google's data residency and compliance agreements. Vertex AI uses Application Default Credentials — no API key is required or accepted — making it incompatible with the existing OpenAI-centric configuration model.

Solution

Add Google Vertex AI as a supported chat provider in LangChain4jModelFactory. Authentication is handled automatically via Application Default Credentials (ADC): service account attached to the instance, gcloud auth application-default login, or Workload Identity. No API key needed. Embeddings and image generation are not available through LangChain4J for Vertex AI and throw UnsupportedOperationException.

{
  "chat": {
    "provider": "vertex_ai",
    "projectId": "my-gcp-project",
    "location": "us-central1",
    "model": "gemini-1.5-pro",
    "maxTokens": 8192,
    "temperature": 1.0
  }
}

Acceptance Criteria

  • Chat completions work end-to-end using provider: "vertex_ai" in providerConfig.
  • Authentication resolves via ADC without requiring an API key in the configuration.
  • projectId, location, and model are correctly passed to VertexAiGeminiChatModel.
  • Attempting embeddings or image generation with provider: "vertex_ai" throws a clear UnsupportedOperationException.
  • Banned transitive dependencies (org.checkerframework:checker-qual, com.google.android:annotations) are explicitly excluded from the langchain4j-vertex-ai-gemini Maven dependency.
  • Unit tests cover the Vertex AI 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