feat(chat): add LLM access type tracking in search log for RAG chat#3071
Merged
feat(chat): add LLM access type tracking in search log for RAG chat#3071
Conversation
Set the LLM type name (from rag.llm.name system property) as the access type in search logs when using RAG chat endpoints. This enables distinguishing chat-based searches from web/API searches in analytics. Also update SearchLogHelper to handle custom access type strings beyond the predefined constants, and fix import ordering across test files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…stManager Register MockRequestManager in setUp to avoid FessLoginAssist → UserBhv DI chain failure when tests run in parallel. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3a8dce1 to
d537241
Compare
…r testability Extract SearchLogContext inner class to decouple resolved dependencies from ComponentUtil, split addSearchLog into a wrapper and createSearchLog(context) for direct unit testing, and extract determineAccessType as a protected method. Update tests to call createSearchLog and determineAccessType directly, removing the need to register mock components for most access-type tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SearchLogHelperto handle custom (non-predefined) access type stringsChanges Made
ChatApiManager.java: SetConstants.SEARCH_LOG_ACCESS_TYPErequest attribute with the LLM name (fromrag.llm.namesystem property, defaulting to"ollama") in bothprocessChat()andprocessChatStream()methodsSearchLogHelper.java: Add a new branch inaddSearchLog()to accept arbitrary non-blank string access types beyond the predefinedWEB,JSON,XML,OTHER, andADMINconstantsTesting
ChatApiManagerTestforgetMaxMessageLengthand access type attribute settingSearchLogHelperchangesBreaking Changes
🤖 Generated with Claude Code