Package com.tnsai.quality.tracing
Class AgentTrace
java.lang.Object
com.tnsai.quality.tracing.AgentTrace
Top-level trace for an agent interaction.
Represents one logical unit of work (e.g. a user request and its full processing chain).
Contains a flat list of Observations that form a tree via parent-child references,
and a list of Scores for evaluation.
Thread-safe: observations and scores use CopyOnWriteArrayList.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidaddObservation(Observation observation) Adds an observation to this trace.voidAdds a score to this trace.agentId()static AgentTrace.BuilderchildrenOf(String parentId) Returns child observations of a given parent.booleaninthashCode()id()metadata()Returns an unmodifiable snapshot of current observations.Returns root observations (those with no parent).scores()Returns an unmodifiable snapshot of current scores.Returns scores for a specific observation.startGeneration(String name) Convenience: creates a generation builder pre-linked to this trace's context.Convenience: creates a span builder pre-linked to this trace's context.toString()
-
Method Details
-
id
-
agentId
-
sessionId
-
startTime
-
metadata
-
observations
Returns an unmodifiable snapshot of current observations. -
scores
Returns an unmodifiable snapshot of current scores. -
addObservation
Adds an observation to this trace. -
addScore
Adds a score to this trace. -
startSpan
Convenience: creates a span builder pre-linked to this trace's context.- Parameters:
name- the span name- Returns:
- a builder whose parentId is set to the current TraceContext parent (if any)
-
startGeneration
Convenience: creates a generation builder pre-linked to this trace's context.- Parameters:
name- the generation name- Returns:
- a builder whose parentId is set to the current TraceContext parent (if any)
-
rootObservations
Returns root observations (those with no parent). -
childrenOf
Returns child observations of a given parent. -
scoresFor
Returns scores for a specific observation. -
toString
-
equals
-
hashCode
public int hashCode() -
builder
-