Package org.codelibs.fess.chat
Interface ChatPhaseCallback
public interface ChatPhaseCallback
Callback interface for receiving notifications about chat processing phases.
Used for SSE streaming to notify clients about the current processing state.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic ChatPhaseCallbacknoOp()Returns a no-op callback implementation.voidCalled when a chunk of the response is available during streaming.voidCalled when an error occurs during processing.voidonPhaseComplete(String phase) Called when a processing phase completes.voidonPhaseStart(String phase, String message) Called when a processing phase starts.default voidonPhaseStart(String phase, String message, String keywords) Called when a processing phase starts with additional context data.
-
Field Details
-
PHASE_INTENT
Phase name for intent detection- See Also:
-
PHASE_SEARCH
Phase name for document search- See Also:
-
PHASE_EVALUATE
Phase name for result evaluation- See Also:
-
PHASE_FETCH
Phase name for content retrieval- See Also:
-
PHASE_ANSWER
Phase name for answer generation- See Also:
-
-
Method Details
-
onPhaseStart
Called when a processing phase starts.- Parameters:
phase- the phase name (e.g., "intent", "search", "evaluate", "fetch", "answer")message- a human-readable message describing what's happening
-
onPhaseStart
Called when a processing phase starts with additional context data.- Parameters:
phase- the phase name (e.g., "intent", "search", "evaluate", "fetch", "answer")message- a human-readable message describing what's happeningkeywords- the search keywords (for search phase)
-
onPhaseComplete
Called when a processing phase completes.- Parameters:
phase- the phase name that completed
-
onChunk
Called when a chunk of the response is available during streaming.- Parameters:
content- the content chunkdone- true if this is the final chunk
-
onError
Called when an error occurs during processing.- Parameters:
phase- the phase where the error occurrederror- the error message
-
noOp
Returns a no-op callback implementation.- Returns:
- a callback that does nothing
-