Class ReActStep

java.lang.Object
com.tnsai.reasoning.react.ReActStep

public final class ReActStep extends Object
Represents a single step in a ReAct (Reason + Act + Observe) loop.

Each step captures the three phases:

  1. Thought - The agent's reasoning about what to do next
  2. Action - The action taken (tool call, LLM query, etc.)
  3. Observation - The result of the action
  • Method Details

    • getStepNumber

      public int getStepNumber()
    • getThought

      public String getThought()
    • getAction

      public Optional<String> getAction()
    • getActionInput

      public Optional<String> getActionInput()
    • getObservation

      public Optional<String> getObservation()
    • getTimestamp

      public Instant getTimestamp()
    • getDuration

      public Optional<Duration> getDuration()
    • hasAction

      public boolean hasAction()
      Returns true if this step includes an action (not just a thought).
    • hasObservation

      public boolean hasObservation()
      Returns true if this step includes an observation.
    • format

      public String format()
      Returns a formatted representation of this step.
    • builder

      public static ReActStep.Builder builder()
    • toString

      public String toString()
      Overrides:
      toString in class Object