Record Class AgentTrace

Object
Record
akka.javasdk.testkit.AgentTrace
Record Components:
toolCalls - in call order
modelCalls - in call order
guardrails - every guardrail evaluation, in order
duration - from the start of the first command to the end of the last
userMessage - the text of the user message the agent sent the model in the first model call, which is what the model saw; empty when the trace did not carry the messages
finalModelText - the text of the last model response, before the agent mapped it into the reply; empty when the trace did not carry the messages

public record AgentTrace(List<ToolCall> toolCalls, List<ModelCall> modelCalls, List<GuardrailResult> guardrails, Duration duration, String userMessage, String finalModelText) extends Record
Everything the runtime traced under the agent commands of one session, read through TelemetryReader.getAgentTrace(String).
  • Field Details

  • Constructor Details

  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • toolCalls

      public List<ToolCall> toolCalls()
      Returns the value of the toolCalls record component.
      Returns:
      the value of the toolCalls record component
    • modelCalls

      public List<ModelCall> modelCalls()
      Returns the value of the modelCalls record component.
      Returns:
      the value of the modelCalls record component
    • guardrails

      public List<GuardrailResult> guardrails()
      Returns the value of the guardrails record component.
      Returns:
      the value of the guardrails record component
    • duration

      public Duration duration()
      Returns the value of the duration record component.
      Returns:
      the value of the duration record component
    • userMessage

      public String userMessage()
      Returns the value of the userMessage record component.
      Returns:
      the value of the userMessage record component
    • finalModelText

      public String finalModelText()
      Returns the value of the finalModelText record component.
      Returns:
      the value of the finalModelText record component