feat(dotAI): Dot AI LangChain4J - Custom UI for provider config#35445
Conversation
…credential merge on save
…s from getConfig response
…warn, providerConfig not required
|
Claude finished @ihoffmann-dot's task in 3m 11s —— View job PR Review
Issues Found1. Model cache not flushed after credential save — stale API keys persist for up to 1 hour
// CompletionsResource.java ~line 266 — should follow saveSecret with:
LangChain4jAIClient.get().flushCachesForHost(host.getHostname());2. Host resolution mismatch between resolver and config operations
The component passes the site ID through the route but never passes it to 3. Empty textarea while config loads — user can submit before data arrives
A 4.
|
|
Pull Request Unsafe to Rollback!!!
|
…35456) (#35494) ## Summary Reverts the LangChain4J integration and related changes merged in: - #35150 — LangChain4J integration (Phase 1 / OpenAI) - #35445 — Custom UI for provider config - #35456 — Per-site config support via siteId Restores dotAI to the state at tag `v26.04.28-01` prior to those merges. ## Test plan - Verify dotAI app configuration UI works as before - Verify AI completions, embeddings, and image generation function with the original OpenAI client
Summary
Replaces the generic Apps UI textarea for
providerConfigwith a dedicated Angular screen that shows the current config and an example JSON side-by-side. Also ports backend fixes from #35426 and adds aPUT /api/v1/ai/completions/configendpoint with credential-preserving merge.DotAiConfigDetailComponent: two-column layout — editable textarea on the left, formatted example JSON on the rightDotAiConfigDetailResolver: dedicated resolver that hardcodesdotAIasappKey, fixing the 404 caused by the generic resolver readingnullfrom route paramsdotAI/edit/:idadded before the generic:appKey/edit/:idso dotAI navigates to the custom screenChangeDetectorRef.detectChanges()after async config load to fix textarea not rendering value until user interactionPUT /api/v1/ai/completions/config(admin-only): savesproviderConfigJSON;ProviderConfigMergerpreserves stored credentials when the payload contains*****sentinel valuesdotAI.ymldescription updated to reference OpenAI/ChatGPT directlycancelledflag onIOException,maxRetrieswarn for streaming, null check inparseSection,deepCopyininjectApiKeyIntoSections,maxTokens→max_completion_tokensrouting for OpenAI o-series models, PR review refactorsConfiguration
{ "chat": { "provider": "openai", "apiKey": "sk-...", "model": "gpt-4o", "maxTokens": 16384, "temperature": 1.0, "maxRetries": 3, "rolePrompt": "You are dotCMSbot, an AI assistant to help content creators.", "textPrompt": "Use Descriptive writing style." }, "embeddings": { "provider": "openai", "apiKey": "sk-...", "model": "text-embedding-ada-002", "listenerIndexer": { "default": "blog,news,webPageContent" } }, "image": { "provider": "openai", "apiKey": "sk-...", "model": "dall-e-3", "size": "1792x1024", "imagePrompt": "Use 16:9 aspect ratio." } }Notes
#/apps/dotAI/edit/:siteId; the "App screen" link inrender.jspalready points to this URL*****in a PUT payload are replaced with the stored values before saving, so partial edits don't wipe secretsproviderConfigis not required — omitting it disables the AI features gracefullyRelated Issues