Record Class LLMPlanStep

java.lang.Object
java.lang.Record
com.tnsai.planning.llm.LLMPlanStep
Record Components:
stepIndex - zero-based position in the plan
actionName - the capability/tool name to invoke
description - human-readable description of what this step does
arguments - arguments to pass to the action/tool
reasoning - LLM's reasoning for why this step is needed

public record LLMPlanStep(int stepIndex, String actionName, String description, Map<String,Object> arguments, String reasoning) extends Record
A single step in an LLM-generated plan.

Each step maps a natural-language description to an executable action or tool call with specific arguments.

Since:
0.3.0
See Also:
  • Constructor Details

    • LLMPlanStep

      public LLMPlanStep(int stepIndex, String actionName, String description, Map<String,Object> arguments, String reasoning)
      Creates an instance of a LLMPlanStep record class.
      Parameters:
      stepIndex - the value for the stepIndex record component
      actionName - the value for the actionName record component
      description - the value for the description record component
      arguments - the value for the arguments record component
      reasoning - the value for the reasoning record component
  • Method Details

    • of

      public static LLMPlanStep of(int index, String actionName, String description)
      Creates a simple step with just action name and description.
    • of

      public static LLMPlanStep of(int index, String actionName, String description, Map<String,Object> arguments)
      Creates a step with arguments.
    • 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.
    • stepIndex

      public int stepIndex()
      Returns the value of the stepIndex record component.
      Returns:
      the value of the stepIndex record component
    • actionName

      public String actionName()
      Returns the value of the actionName record component.
      Returns:
      the value of the actionName record component
    • description

      public String description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component
    • arguments

      public Map<String,Object> arguments()
      Returns the value of the arguments record component.
      Returns:
      the value of the arguments record component
    • reasoning

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