Skip to content

feat(chat): add LLM access type tracking in search log for RAG chat#3071

Merged
marevol merged 4 commits intomasterfrom
feat/chat-llm-access-type-search-log
Mar 14, 2026
Merged

feat(chat): add LLM access type tracking in search log for RAG chat#3071
marevol merged 4 commits intomasterfrom
feat/chat-llm-access-type-search-log

Conversation

@marevol
Copy link
Contributor

@marevol marevol commented Mar 13, 2026

Summary

  • Add LLM type name as Access Type in search logs when using RAG chat endpoints, enabling analytics to distinguish chat-based searches from web/API searches
  • Update SearchLogHelper to handle custom (non-predefined) access type strings
  • Fix import ordering across test files

Changes Made

  • ChatApiManager.java: Set Constants.SEARCH_LOG_ACCESS_TYPE request attribute with the LLM name (from rag.llm.name system property, defaulting to "ollama") in both processChat() and processChatStream() methods
  • SearchLogHelper.java: Add a new branch in addSearchLog() to accept arbitrary non-blank string access types beyond the predefined WEB, JSON, XML, OTHER, and ADMIN constants
  • Test files: Fix static import ordering to comply with formatter rules (154 files)

Testing

  • New unit tests added in ChatApiManagerTest for getMaxMessageLength and access type attribute setting
  • Existing tests continue to pass with the SearchLogHelper changes

Breaking Changes

  • None. Existing access type behavior is preserved; only new custom types are now accepted.

🤖 Generated with Claude Code

@marevol marevol self-assigned this Mar 13, 2026
@marevol marevol added this to the 15.6.0 milestone Mar 13, 2026
marevol and others added 2 commits March 14, 2026 08:02
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>
@marevol marevol force-pushed the feat/chat-llm-access-type-search-log branch from 3a8dce1 to d537241 Compare March 13, 2026 23:04
marevol and others added 2 commits March 14, 2026 09:12
…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>
@marevol marevol merged commit 8529476 into master Mar 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant