Record Class TaskContext

Object
Record
akka.javasdk.ledger.TaskContext
Record Components:
agentInstanceId - the id of the agent instance that ran the task
taskId - the id of the task
taskName - the name of the task
taskDescription - the description of the task
taskResultType - the type of the task's result
iterationNumber - the iteration of the flow this interaction belongs to
maxIterations - the maximum number of iterations configured for the flow

public record TaskContext(String agentInstanceId, String taskId, String taskName, String taskDescription, String taskResultType, int iterationNumber, int maxIterations) extends Record
Autonomous-agent task metadata. Present only for interactions produced by an agent running as part of a flow; absent for request-based agent interactions.
  • Constructor Details

    • TaskContext

      public TaskContext(String agentInstanceId, String taskId, String taskName, String taskDescription, String taskResultType, int iterationNumber, int maxIterations)
      Creates an instance of a TaskContext record class.
      Parameters:
      agentInstanceId - the value for the agentInstanceId record component
      taskId - the value for the taskId record component
      taskName - the value for the taskName record component
      taskDescription - the value for the taskDescription record component
      taskResultType - the value for the taskResultType record component
      iterationNumber - the value for the iterationNumber record component
      maxIterations - the value for the maxIterations record component
  • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • agentInstanceId

      public String agentInstanceId()
      Returns the value of the agentInstanceId record component.
      Returns:
      the value of the agentInstanceId record component
    • taskId

      public String taskId()
      Returns the value of the taskId record component.
      Returns:
      the value of the taskId record component
    • taskName

      public String taskName()
      Returns the value of the taskName record component.
      Returns:
      the value of the taskName record component
    • taskDescription

      public String taskDescription()
      Returns the value of the taskDescription record component.
      Returns:
      the value of the taskDescription record component
    • taskResultType

      public String taskResultType()
      Returns the value of the taskResultType record component.
      Returns:
      the value of the taskResultType record component
    • iterationNumber

      public int iterationNumber()
      Returns the value of the iterationNumber record component.
      Returns:
      the value of the iterationNumber record component
    • maxIterations

      public int maxIterations()
      Returns the value of the maxIterations record component.
      Returns:
      the value of the maxIterations record component