Package dev.dokimos.core.agents
Record Class AgentTrace
java.lang.Object
java.lang.Record
dev.dokimos.core.agents.AgentTrace
- Record Components:
finalResponse- the agent's final text responsetoolCalls- all tool calls made during executionreasoningSteps- optional reasoning/thought stepsmetadata- latency, token usage, and other metadata
public record AgentTrace(String finalResponse, List<ToolCall> toolCalls, List<String> reasoningSteps, Map<String,Object> metadata)
extends Record
Wraps a complete agent execution trace for evaluation.
Contains the agent's final text response, all tool calls made during execution, optional reasoning steps, and metadata such as latency and token usage.
The toOutputMap() method converts the trace to a map suitable for
returning from a Task implementation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for constructing agent traces. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AgentTrace.Builderbuilder()Creates a new builder for constructing agent traces.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefinalResponserecord component.final inthashCode()Returns a hash code value for this object.metadata()Returns the value of themetadatarecord component.Returns the value of thereasoningStepsrecord component.Returns the value of thetoolCallsrecord component.Returns the set of tool names used in this trace.Converts this agent trace to a map suitable for use asactualOutputsin anEvalTestCase.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AgentTrace
public AgentTrace(String finalResponse, List<ToolCall> toolCalls, List<String> reasoningSteps, Map<String, Object> metadata) Creates an instance of aAgentTracerecord class.- Parameters:
finalResponse- the value for thefinalResponserecord componenttoolCalls- the value for thetoolCallsrecord componentreasoningSteps- the value for thereasoningStepsrecord componentmetadata- the value for themetadatarecord component
-
-
Method Details
-
toOutputMap
Converts this agent trace to a map suitable for use asactualOutputsin anEvalTestCase.- Returns:
- a map with keys
"output","toolCalls", and"reasoningSteps"
-
toolNames
Returns the set of tool names used in this trace.- Returns:
- set of tool names
-
builder
Creates a new builder for constructing agent traces.- Returns:
- a new builder
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
finalResponse
Returns the value of thefinalResponserecord component.- Returns:
- the value of the
finalResponserecord component
-
toolCalls
Returns the value of thetoolCallsrecord component.- Returns:
- the value of the
toolCallsrecord component
-
reasoningSteps
Returns the value of thereasoningStepsrecord component.- Returns:
- the value of the
reasoningStepsrecord component
-
metadata
Returns the value of themetadatarecord component.- Returns:
- the value of the
metadatarecord component
-