Record Class PlanExecutionResult

java.lang.Object
java.lang.Record
com.tnsai.planning.llm.PlanExecutionResult
Record Components:
plan - the original plan
stepResults - per-step results
success - whether all steps succeeded
replanCount - number of replans that occurred

public record PlanExecutionResult(LLMPlan plan, List<StepExecutionResult> stepResults, boolean success, int replanCount) extends Record
Result of executing an entire LLM-generated plan.
Since:
0.3.0
See Also:
  • Constructor Details

    • PlanExecutionResult

      public PlanExecutionResult(LLMPlan plan, List<StepExecutionResult> stepResults, boolean success, int replanCount)
      Creates an instance of a PlanExecutionResult record class.
      Parameters:
      plan - the value for the plan record component
      stepResults - the value for the stepResults record component
      success - the value for the success record component
      replanCount - the value for the replanCount record component
  • Method Details

    • completedCount

      public int completedCount()
      Returns the number of successfully executed steps.
    • failedCount

      public int failedCount()
      Returns the number of failed steps.
    • totalSteps

      public int totalSteps()
      Returns the total number of steps attempted.
    • 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.
    • plan

      public LLMPlan plan()
      Returns the value of the plan record component.
      Returns:
      the value of the plan record component
    • stepResults

      public List<StepExecutionResult> stepResults()
      Returns the value of the stepResults record component.
      Returns:
      the value of the stepResults record component
    • success

      public boolean success()
      Returns the value of the success record component.
      Returns:
      the value of the success record component
    • replanCount

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