Package com.tnsai.utils
Class ConversationTracer
java.lang.Object
com.tnsai.utils.ConversationTracer
Human-readable conversation tracer for agent communication.
Prints formatted, colored output showing agent interactions and LLM calls.
Opt-in: Enable with environment variable: TNSAI_TRACE=true
Disabled by default to avoid accidental PII exposure in logs. Content is
emitted under com.tnsai.diagnostics.content.ConversationTracer;
applications must isolate that namespace from operational appenders.
This diagnostic output is not a durable conversation transcript.
Example output:
┌─────────────────────────────────────────────────────────────────┐ │ 14:32:15 │ buyer-ahmet → ALL (BROADCAST) │ │ Type: CNP.CFP │ ├─────────────────────────────────────────────────────────────────┤ │ İstanbul'da 4+ yıldızlı otel arıyorum, max 900 TL/gece │ └─────────────────────────────────────────────────────────────────┘
-
Method Summary
Modifier and TypeMethodDescriptionstatic ConversationTracerbooleanvoidTraces a message sent between agents.voidtraceError(String agentName, String error) Traces an error.voidtraceLLMRequest(String agentName, String userMessage, List<Map<String, Object>> history, List<Map<String, Object>> tools) Traces the context window being sent to LLM.voidtraceLLMResponse(String agentName, String response) Traces the LLM response.voidtraceSearchTool(String toolName, String query) Traces a search tool execution (brave_search, duckduckgo, arxiv, etc.).voidTraces a tool call made by LLM.
-
Method Details
-
getInstance
-
isEnabled
public boolean isEnabled() -
traceAgentMessage
public void traceAgentMessage(String from, String to, String messageType, Map<String, Object> content) Traces a message sent between agents. -
traceLLMRequest
public void traceLLMRequest(String agentName, String userMessage, List<Map<String, Object>> history, List<Map<String, Object>> tools) Traces the context window being sent to LLM. -
traceLLMResponse
Traces the LLM response. -
traceToolCall
public void traceToolCall(String agentName, String toolName, Map<String, Object> args, Object result) Traces a tool call made by LLM. -
traceSearchTool
Traces a search tool execution (brave_search, duckduckgo, arxiv, etc.). -
traceError
Traces an error.
-