-
Notifications
You must be signed in to change notification settings - Fork 170
feat: add search progress messages to AI Chat mode #3020
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add localized progress messages during chat search:
- "Thinking..." during intent detection
- "Searching for {keywords}..." during document search
- "Reviewing search results..." during result evaluation
- "Retrieving documents..." during content fetch
- "Generating answer..." during response generation
Changes:
- ChatPhaseCallback: Add overloaded onPhaseStart with keywords parameter
- ChatClient: Pass search keywords to callback during search phase
- ChatApiManager: Include keywords in SSE phase events
- chat.js: Support placeholder replacement for {keywords}
- chat.jsp: Configure phase labels from i18n properties
- fess_label_*.properties: Add phase labels for all 17 languages
…nt handling Improve intent detection for RAG chat: - Rename CHAT intent to UNCLEAR for clearer semantics when user intent cannot be determined - Add full SUMMARY intent handling with URL-based document search - Implement searchByUrl() for finding documents by their URL - Add generateUnclearIntentResponse() to ask users for clarification - Add generateDocumentNotFoundResponse() when URL search fails - Add generateSummaryResponse() for document summarization - Update intent detection prompt with clearer rules - Modify generateNoResultsResponse() to not use LLM's own knowledge - Change IntentDetectionResult from documentId to documentUrl Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
5de3fa6 to
102625e
Compare
Update the chat interface to show search phase progress messages directly in the message bubble text, providing better visual feedback during AI processing. Also update default Ollama model configuration. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds localized progress messages during AI chat search to improve user experience by showing what the system is doing at each phase of processing. The implementation adds support for displaying progress messages like "Thinking...", "Searching for {keywords}...", etc., with keyword placeholder replacement and comprehensive i18n support.
Changes:
- Enhanced ChatPhaseCallback interface with overloaded method supporting keywords parameter
- Updated ChatClient to pass search keywords during search phase and handle UNCLEAR/SUMMARY intents
- Modified chat.js to support {keywords} placeholder replacement in phase messages
- Added phase labels configuration across 17 language property files
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/org/codelibs/fess/chat/ChatIntent.java | Renamed CHAT enum to UNCLEAR to better represent unclear user intent |
| src/main/java/org/codelibs/fess/chat/IntentDetectionResult.java | Renamed documentId to documentUrl for clarity; updated method names |
| src/main/java/org/codelibs/fess/chat/ChatPhaseCallback.java | Added overloaded onPhaseStart method accepting keywords parameter |
| src/main/java/org/codelibs/fess/chat/ChatClient.java | Implemented UNCLEAR/SUMMARY intent handling and added new response generation methods |
| src/main/java/org/codelibs/fess/api/chat/ChatApiManager.java | Enhanced SSE phase events to include keywords in event data |
| src/main/webapp/js/chat.js | Added placeholder replacement logic for {keywords} and message element updates |
| src/main/webapp/WEB-INF/view/chat/chat.jsp | Configured phase labels from i18n properties |
| src/main/resources/fess_label*.properties | Added 5 new phase labels for all 17 supported languages |
| src/test/java/org/codelibs/fess/chat/IntentDetectionResultTest.java | Updated tests to reflect documentId→documentUrl and CHAT→UNCLEAR renames |
| src/test/java/org/codelibs/fess/chat/ChatIntentTest.java | Updated tests to reflect CHAT→UNCLEAR enum rename |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| final List<String> docIds = urlResults.stream() | ||
| .map(doc -> (String) doc.get("doc_id")) | ||
| .filter(id -> id != null) | ||
| .collect(Collectors.toList()); |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing import statement for Collectors. The code uses Collectors.toList() but there's no visible import for java.util.stream.Collectors in the diff context.
| public void onPhaseStart(final String phase, final String phaseMessage, final String keywords) { | ||
| try { | ||
| sendSseEvent(writer, "phase", Map.of("phase", phase, "status", "start", "message", phaseMessage)); | ||
| final Map<String, Object> data = new HashMap<>(); |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing import statement for HashMap. The code creates a new HashMap but there's no visible import for java.util.HashMap in the diff context.
Add localized progress messages during chat search:
Changes: