Description
Add Google Vertex AI (Gemini) as a supported chat provider in the dotAI LangChain4J integration layer. Authentication is handled via Application Default Credentials — no API key required.
This builds on the LangChain4J abstraction established in #35183 (Phase 1 — OpenAI).
Implementation outline:
- Add
langchain4j-vertex-ai-gemini dependency (with enforcer exclusions for org.checkerframework:checker-qual and com.google.android:annotations)
- Add
vertex_ai case to LangChain4jModelFactory switch
- Implement
buildVertexAiChatModel using VertexAiGeminiChatModel
buildVertexAiEmbeddingModel and buildVertexAiImageModel throw UnsupportedOperationException
Acceptance Criteria
Additional Context
Sample configuration:
{
"chat": {
"provider": "vertex_ai",
"projectId": "my-gcp-project",
"location": "us-central1",
"model": "gemini-1.5-pro",
"maxTokens": 8192,
"temperature": 1.0
}
}
The host running dotCMS must have a valid GCP identity (gcloud auth application-default login or an attached service account).
Description
Add Google Vertex AI (Gemini) as a supported chat provider in the dotAI LangChain4J integration layer. Authentication is handled via Application Default Credentials — no API key required.
This builds on the LangChain4J abstraction established in #35183 (Phase 1 — OpenAI).
Implementation outline:
langchain4j-vertex-ai-geminidependency (with enforcer exclusions fororg.checkerframework:checker-qualandcom.google.android:annotations)vertex_aicase toLangChain4jModelFactoryswitchbuildVertexAiChatModelusingVertexAiGeminiChatModelbuildVertexAiEmbeddingModelandbuildVertexAiImageModelthrowUnsupportedOperationExceptionAcceptance Criteria
vertex_aiis selectable as a chat provider inproviderConfigprojectIdandlocationare required configuration fieldsUnsupportedOperationExceptionwith a clear messageLangChain4jModelFactoryTestAdditional Context
Sample configuration:
{ "chat": { "provider": "vertex_ai", "projectId": "my-gcp-project", "location": "us-central1", "model": "gemini-1.5-pro", "maxTokens": 8192, "temperature": 1.0 } }The host running dotCMS must have a valid GCP identity (
gcloud auth application-default loginor an attached service account).