Skip to content

Conversation

@marevol
Copy link
Contributor

@marevol marevol commented Jan 11, 2026

Add test classes for the new RAG chat functionality:

  • ChatMessageTest: tests for ChatMessage entity and ChatSource
  • ChatSessionTest: tests for ChatSession entity
  • LlmMessageTest: tests for LlmMessage class
  • LlmChatRequestTest: tests for LlmChatRequest class
  • LlmChatResponseTest: tests for LlmChatResponse class
  • LlmExceptionTest: tests for LlmException class

Add test classes for the new RAG chat functionality:
- ChatMessageTest: tests for ChatMessage entity and ChatSource
- ChatSessionTest: tests for ChatSession entity
- LlmMessageTest: tests for LlmMessage class
- LlmChatRequestTest: tests for LlmChatRequest class
- LlmChatResponseTest: tests for LlmChatResponse class
- LlmExceptionTest: tests for LlmException class
@marevol marevol merged commit c0ac655 into feature/rag-chat Jan 11, 2026
marevol added a commit that referenced this pull request Jan 12, 2026
Add test classes for the new RAG chat functionality:
- ChatMessageTest: tests for ChatMessage entity and ChatSource
- ChatSessionTest: tests for ChatSession entity
- LlmMessageTest: tests for LlmMessage class
- LlmChatRequestTest: tests for LlmChatRequest class
- LlmChatResponseTest: tests for LlmChatResponse class
- LlmExceptionTest: tests for LlmException class

Co-authored-by: Claude <noreply@anthropic.com>
marevol added a commit that referenced this pull request Jan 12, 2026
* feat: add RAG chat functionality with LLM integration

Implement RAG (Retrieval-Augmented Generation) chat feature that enables
conversational search using LLM providers. The feature integrates Fess
search results as context for generating AI-powered responses.

Key components:
- LLM client abstraction with support for Ollama, OpenAI, and Gemini
- Chat session management with message history
- REST API with SSE streaming support (/api/v1/chat/stream)
- Web UI with chat interface accessible from header
- Configurable via fess_config.properties

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test: add unit tests for RAG chat and LLM classes (#3014)

Add test classes for the new RAG chat functionality:
- ChatMessageTest: tests for ChatMessage entity and ChatSource
- ChatSessionTest: tests for ChatSession entity
- LlmMessageTest: tests for LlmMessage class
- LlmChatRequestTest: tests for LlmChatRequest class
- LlmChatResponseTest: tests for LlmChatResponse class
- LlmExceptionTest: tests for LlmException class

Co-authored-by: Claude <noreply@anthropic.com>

* test: add unit tests for improved test coverage (#3011)

* test: add unit tests for improved test coverage

Add unit tests for previously untested components:
- Service layer: FessAppServiceTest for base service functionality
- Storage: StorageItemTest, StorageTypeTest for storage classes
- Pagers: 24 new pager tests covering GroupPager, RolePager, UserPager,
  SchedulerPager, PathMapPager, KeyMatchPager, ElevateWordPager,
  FailureUrlPager, JobLogPager, FileConfigPager, WebConfigPager,
  RelatedContentPager, RelatedQueryPager, RoleTypePager, SearchLogPager,
  WebAuthPager, FileAuthPager, ReqHeaderPager, SynonymPager, KuromojiPager,
  StopwordsPager, ProtwordsPager, StemmerOverridePager, LabelTypePager
- App jobs: AllJobSchedulerTest, ScriptExecutorJobTest for job scheduling

These tests address the major coverage gaps identified in the analysis
of the service layer (0%), pager classes (22.6%), storage classes (0%),
and app job classes (0%).

* fix: correct pager test field references to match actual class fields

Update pager tests to use correct fields that exist in the pager classes:
- SearchLogPagerTest: Use queryId, userSessionId, requestedTimeRange, accessType, logType
  instead of nonexistent id, searchWord, versionNo
- WebAuthPagerTest: Use port, username, webConfigId instead of hostname
- FailureUrlPagerTest: Use threadName, errorCount, errorName instead of versionNo
- FileAuthPagerTest: Use port, username, fileConfigId instead of hostname
- JobLogPagerTest: Use jobStatus, target, scriptType instead of versionNo

---------

Co-authored-by: Claude <noreply@anthropic.com>

* test: add assertSame helper methods to UnitFessTestCase

Add assertSame methods (with and without message parameter) to the base
test case class for JUnit 5 compatibility. Also apply code formatting
to LlmChatRequestTest.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(test): add JUnit 5 annotations to FessAppServiceTest

Add missing @beforeeach and @test annotations for JUnit 5 compatibility.
Update setUp method signature to match UnitFessTestCase base class.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: add RAG chat functionality with LLM integration

Implement RAG (Retrieval-Augmented Generation) chat feature that enables
conversational search using LLM providers. The feature integrates Fess
search results as context for generating AI-powered responses.

Key components:
- LLM client abstraction with support for Ollama, OpenAI, and Gemini
- Chat session management with message history
- REST API with SSE streaming support (/api/v1/chat/stream)
- Web UI with chat interface accessible from header
- Configurable via fess_config.properties

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test: add unit tests for RAG chat and LLM classes (#3014)

Add test classes for the new RAG chat functionality:
- ChatMessageTest: tests for ChatMessage entity and ChatSource
- ChatSessionTest: tests for ChatSession entity
- LlmMessageTest: tests for LlmMessage class
- LlmChatRequestTest: tests for LlmChatRequest class
- LlmChatResponseTest: tests for LlmChatResponse class
- LlmExceptionTest: tests for LlmException class

Co-authored-by: Claude <noreply@anthropic.com>

* test: add assertSame helper methods to UnitFessTestCase

Add assertSame methods (with and without message parameter) to the base
test case class for JUnit 5 compatibility. Also apply code formatting
to LlmChatRequestTest.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* docs: add Javadoc to chat component helper methods

Add documentation to getChatSessionManager() and getChatClient()
methods in ComponentUtil for improved API clarity.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor: remove duplicate chat helper methods in ComponentUtil

Remove redundant getChatSessionManager() and getChatClient() methods
that were duplicated without Javadoc documentation, keeping only
the properly documented versions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(chat): enhance RAG chat with improved logging, error handling, and UI

- Add debug logging to WebApiManagerFactory, ChatApiManager, ChatClient,
  and LlmClientManager for better request tracing
- Improve error handling in stream responses to prevent writing to
  committed responses
- Update header.jsp to toggle search bar visibility on chat page and
  add search link for navigation back to search
- Enhance chat.css with flexbox layout for better viewport height usage
- Add waiting indicator text when streaming response starts
- Add i18n labels for chat feature across all language files
- Register chatPage flag in ChatAction for conditional rendering

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat(chat): add multi-phase RAG flow with intent detection and markdown rendering

Add enhanced streaming chat with multi-phase RAG (Retrieval-Augmented Generation) flow:

- Add ChatIntent enum for classifying user intent (search, summary, FAQ, chat)
- Add IntentDetectionResult and RelevanceEvaluationResult for structured LLM responses
- Add ChatPhaseCallback for progress notifications during multi-phase processing
- Add MarkdownRenderer using commonmark and OWASP HTML Sanitizer for safe HTML output
- Enhance ChatClient with streamChatEnhanced() supporting:
  - Intent detection phase
  - Keyword search phase
  - Relevance evaluation phase
  - Content retrieval phase
  - Answer generation with streaming
  - Markdown to HTML rendering
- Update chat.js to display phase progress and rendered HTML

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants