Record Class PlanningResult

java.lang.Object
java.lang.Record
io.jmix.dynmodelai.agent.planning.PlanningResult

public record PlanningResult(PlanningStatus status, @Nullable ValidatedPlan plan, List<HumanQuestion> questions, String message, @Nullable String detail, boolean repairable) extends Record
Validated planner outcome consumed by the Engine graph.

message is what the user reads. detail keeps the technical reason of a failure or timeout, such as the validator's rejection or the provider's error, and is null otherwise. repairable explicitly distinguishes rejected model output from terminal failures; the graph also checks the remaining attempt budget before requesting a correction.

  • Constructor Details

    • PlanningResult

      public PlanningResult(PlanningStatus status, @Nullable ValidatedPlan plan, List<HumanQuestion> questions, String message, @Nullable String detail, boolean repairable)
      Creates an instance of a PlanningResult record class.
      Parameters:
      status - the value for the status record component
      plan - the value for the plan record component
      questions - the value for the questions record component
      message - the value for the message record component
      detail - the value for the detail record component
      repairable - the value for the repairable record component
    • PlanningResult

      public PlanningResult(PlanningStatus status, @Nullable ValidatedPlan plan, List<HumanQuestion> questions, String message, @Nullable String detail)
    • PlanningResult

      public PlanningResult(PlanningStatus status, @Nullable ValidatedPlan plan, List<HumanQuestion> questions, String message)
  • Method Details

    • failed

      public static PlanningResult failed(String message, @Nullable String detail)
    • rejected

      public static PlanningResult rejected(String feedback)
      Invalid model output that may be corrected within the graph's remaining attempt budget.
    • timedOut

      public static PlanningResult timedOut(String message, @Nullable String detail)
    • 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.
    • status

      public PlanningStatus status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • plan

      public @Nullable ValidatedPlan plan()
      Returns the value of the plan record component.
      Returns:
      the value of the plan record component
    • questions

      public List<HumanQuestion> questions()
      Returns the value of the questions record component.
      Returns:
      the value of the questions record component
    • message

      public String message()
      Returns the value of the message record component.
      Returns:
      the value of the message record component
    • detail

      public @Nullable String detail()
      Returns the value of the detail record component.
      Returns:
      the value of the detail record component
    • repairable

      public boolean repairable()
      Returns the value of the repairable record component.
      Returns:
      the value of the repairable record component