Package akka.javasdk.testkit.eval
Record Class Interaction
- Record Components:
input- the command sent to the agent, as text. A String command is used as is, any other command is rendered as JSON byasText(java.lang.Object)userMessage- the user message the agent sent the model, which is what the model saw. The command handler builds it from the command, so it may differ frominput. Empty when the trace did not carry itreply- the agent's replytoolCalls- in call ordermodelCalls- in call orderguardrails- every guardrail evaluation, in orderlatency- from the start of the agent command to its endfinalModelText- the text of the last model response, before the agent mapped it into the reply; empty when the trace did not carry it
-
Constructor Summary
ConstructorsConstructorDescriptionInteraction(String input, String reply, AgentTrace trace) A reply with the traced evidence, including the user message the agent sent the model.Interaction(String input, String userMessage, String reply, List<ToolCall> toolCalls, List<ModelCall> modelCalls, List<GuardrailResult> guardrails, Duration latency, String finalModelText) Creates an instance of aInteractionrecord class.Interaction(String input, String reply, List<ToolCall> toolCalls) A reply with tool calls only, and no user message in the evidence. -
Method Summary
Modifier and TypeMethodDescriptionasked()What the agent was asked, as a judge reads it: the user message the agent sent the model when the trace carried it, otherwise the case's command as text.static StringA command or a reply as the text an evaluator and a judge read.booleanblocked()Whether any guardrail blocked the turn.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefinalModelTextrecord component.Returns the value of theguardrailsrecord component.final inthashCode()Returns a hash code value for this object.input()Returns the value of theinputrecord component.longInput tokens summed over the model calls.latency()Returns the value of thelatencyrecord component.Returns the value of themodelCallsrecord component.static InteractionA reply with no evidence.longOutput tokens summed over the model calls.reply()Returns the value of thereplyrecord component.Returns the value of thetoolCallsrecord component.final StringtoString()Returns a string representation of this record class.longInput and output tokens together.Returns the value of theuserMessagerecord component.
-
Constructor Details
-
Interaction
public Interaction(String input, String userMessage, String reply, List<ToolCall> toolCalls, List<ModelCall> modelCalls, List<GuardrailResult> guardrails, Duration latency, String finalModelText) Creates an instance of aInteractionrecord class.- Parameters:
input- the value for theinputrecord componentuserMessage- the value for theuserMessagerecord componentreply- the value for thereplyrecord componenttoolCalls- the value for thetoolCallsrecord componentmodelCalls- the value for themodelCallsrecord componentguardrails- the value for theguardrailsrecord componentlatency- the value for thelatencyrecord componentfinalModelText- the value for thefinalModelTextrecord component
-
Interaction
A reply with tool calls only, and no user message in the evidence. -
Interaction
A reply with the traced evidence, including the user message the agent sent the model.
-
-
Method Details
-
of
A reply with no evidence. -
asked
What the agent was asked, as a judge reads it: the user message the agent sent the model when the trace carried it, otherwise the case's command as text. -
asText
A command or a reply as the text an evaluator and a judge read. A String is used as is, any other value is rendered as JSON. Null becomes the empty string. -
inputTokens
public long inputTokens()Input tokens summed over the model calls. -
outputTokens
public long outputTokens()Output tokens summed over the model calls. -
totalTokens
public long totalTokens()Input and output tokens together. -
blocked
public boolean blocked()Whether any guardrail blocked the turn. -
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). -
input
Returns the value of theinputrecord component.- Returns:
- the value of the
inputrecord component
-
userMessage
Returns the value of theuserMessagerecord component.- Returns:
- the value of the
userMessagerecord component
-
reply
Returns the value of thereplyrecord component.- Returns:
- the value of the
replyrecord component
-
toolCalls
Returns the value of thetoolCallsrecord component.- Returns:
- the value of the
toolCallsrecord component
-
modelCalls
Returns the value of themodelCallsrecord component.- Returns:
- the value of the
modelCallsrecord component
-
guardrails
Returns the value of theguardrailsrecord component.- Returns:
- the value of the
guardrailsrecord component
-
latency
Returns the value of thelatencyrecord component.- Returns:
- the value of the
latencyrecord component
-
finalModelText
Returns the value of thefinalModelTextrecord component.- Returns:
- the value of the
finalModelTextrecord component
-