Package com.tnsai.eval.hooks
Interface EvalHandle
public interface EvalHandle
SPI handle for evaluation hook management.
This interface defines the eval hook management contract that
Agent uses. The concrete implementation
(EvalHookManager) lives in tnsai-quality
and is discovered via SpiLoader.
When tnsai-quality is not on the classpath, the factory returns a no-op handle that silently ignores all hook operations.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceFactory for creating EvalHandle instances. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EvalHandleNo-op implementation used when tnsai-quality is absent. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidfireOnAfterChat(EvalContext ctx, String response, long latencyMs) voidfireOnAfterToolCall(EvalContext ctx, String toolName, Object result, boolean success, long latencyMs) voidfireOnAgentCommunication(EvalContext ctx, String fromAgent, String toAgent, String messageType, long latencyMs) voidfireOnAgentStart(EvalContext ctx, String agentId, String sessionId) voidfireOnAgentStop(EvalContext ctx, String reason) voidfireOnBeforeChat(EvalContext ctx, String message) voidfireOnBeforeToolCall(EvalContext ctx, String toolName, Map<String, Object> arguments) voidfireOnError(EvalContext ctx, Throwable error, String phase) voidfireOnGoalCompleted(EvalContext ctx, String goalId, boolean success, Map<String, Object> details) voidfireOnMemoryAccess(EvalContext ctx, String operation, String key, int resultCount, long latencyMs) intbooleanbooleanremoveHook(EvalHook hook) voidsetEnabled(boolean enabled)
-
Field Details
-
NOOP
No-op implementation used when tnsai-quality is absent.
-
-
Method Details
-
addHook
-
removeHook
-
clearHooks
void clearHooks() -
hookCount
int hookCount() -
setEnabled
void setEnabled(boolean enabled) -
isEnabled
boolean isEnabled() -
fireOnAgentStart
-
fireOnBeforeChat
-
fireOnAfterChat
-
fireOnBeforeToolCall
-
fireOnAfterToolCall
void fireOnAfterToolCall(EvalContext ctx, String toolName, Object result, boolean success, long latencyMs) -
fireOnGoalCompleted
void fireOnGoalCompleted(EvalContext ctx, String goalId, boolean success, Map<String, Object> details) -
fireOnAgentStop
-
fireOnError
-
fireOnMemoryAccess
void fireOnMemoryAccess(EvalContext ctx, String operation, String key, int resultCount, long latencyMs) -
fireOnAgentCommunication
void fireOnAgentCommunication(EvalContext ctx, String fromAgent, String toAgent, String messageType, long latencyMs)
-