[FEATURE] dotAI: LangChain4J integration — Phase 2 (Google Vertex AI)
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"inproviderConfig. - [ ] Authentication resolves via ADC without requiring an API key in the configuration.
- [ ]
projectId,location, andmodelare correctly passed toVertexAiGeminiChatModel. - [ ] Attempting embeddings or image generation with
provider: "vertex_ai"throws a clearUnsupportedOperationException. - [ ] Banned transitive dependencies (
org.checkerframework:checker-qual,com.google.android:annotations) are explicitly excluded from thelangchain4j-vertex-ai-geminiMaven dependency. - [ ] Unit tests cover the Vertex AI builder paths in
LangChain4jModelFactoryTest.
dotCMS Version
main
Links
- PR: https://github.com/dotCMS/core/pull/35241
- Epic: https://github.com/dotCMS/core/issues/33970
QA Passed
Tested in main 94fb755
https://github.com/user-attachments/assets/85e3151e-a78f-4285-b53d-4183d23d819c