Class AgentExecutor.State

java.lang.Object
org.bsc.langgraph4j.state.AgentState
org.bsc.spring.agentexecutor.AgentExecutor.State
Enclosing class:
AgentExecutor

public static class AgentExecutor.State extends AgentState
Represents the state of an agent in a system. This class extends AgentState and defines constants for keys related to input, agent outcome, and intermediate steps. It includes a static map schema that specifies how these keys should be handled.
  • Field Details

  • Constructor Details

    • State

      public State(Map<String,Object> initData)
      Constructs a new State object using the initial data provided in the initData map.
      Parameters:
      initData - the map containing the initial settings for this state
  • Method Details

    • input

      public Optional<String> input()
      Retrieves input from the user with a specified key.
      Returns:
      An Optional containing the input value if found; an empty Optional otherwise.
    • agentOutcome

      public Optional<AgentExecutor.Outcome> agentOutcome()
      Returns the outcome for the agent.
      Returns:
      an Optional containing the agent's outcome, or an empty Optional if not available.
    • intermediateSteps

      public List<AgentExecutor.Step> intermediateSteps()
      Retrieves the list of intermediate steps. This method returns a List of Step objects that represent the intermediate steps. If no such list is available, it creates and returns a new empty list.
      Returns:
      a non-null list of intermediate steps