Class ImageToDiagram.State

java.lang.Object
org.bsc.langgraph4j.state.AgentState
dev.langchain4j.image_to_diagram.ImageToDiagram.State
Enclosing interface:
ImageToDiagram

public static class ImageToDiagram.State extends AgentState
Represents the state of an agent, specifically tailored for managing diagram-related data and processes.
  • Constructor Details

    • State

      public State(Map<String,Object> initData)
      Constructs a new `State` object with the provided initialization data.
      Parameters:
      initData - a map containing initial state data
  • Method Details

    • imageData

      Retrieves the image data as an ImageToDiagramProcess.ImageUrlOrData.
      Returns:
      An Optional containing the image data, or empty if not available.
    • diagram

      public Optional<Diagram.Element> diagram()
      Retrieves the diagram element associated with this object.
      Returns:
      an Optional containing the diagram element if it exists, otherwise an empty optional.
    • diagramCode

      public List<String> diagramCode()
      Returns a list of diagram code. If the "diagramCode" value is not present, returns an empty list.
      Returns:
      List of String representing the diagram code
    • evaluationResult

      public Optional<ImageToDiagram.EvaluationResult> evaluationResult()
      Retrieves the evaluation result as an ImageToDiagram.EvaluationResult.
      Returns:
      An Optional containing the evaluation result, or empty if not available.
    • evaluationError

      public Optional<String> evaluationError()
      Returns an Optional containing the value associated with "evaluationError".
      Returns:
      an Optional containing the value associated with "evaluationError"
    • evaluationErrorType

      public Optional<net.sourceforge.plantuml.ErrorUmlType> evaluationErrorType()
      Retrieves the type of evaluation error.
      Returns:
      an Optional containing the error UML type, or an empty optional if not available
    • isExecutionError

      public boolean isExecutionError()
      Checks if an error of execution type has occurred.
      Returns:
      true if the error type is execution error, false otherwise
    • lastTwoDiagramsAreEqual

      public boolean lastTwoDiagramsAreEqual()
      Checks if the last two diagrams in the code are equal.
      Returns:
      true if the last two diagrams are equal; false otherwise