Package dev.langchain4j.image_to_diagram
Class ImageToDiagram.State
java.lang.Object
org.bsc.langgraph4j.state.AgentState
dev.langchain4j.image_to_diagram.ImageToDiagram.State
- Enclosing interface:
- ImageToDiagram
Represents the state of an agent, specifically tailored for managing diagram-related data and processes.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondiagram()
Retrieves the diagram element associated with this object.Returns a list of diagram code.Returns anOptional
containing the value associated with "evaluationError".Optional<net.sourceforge.plantuml.ErrorUmlType>
Retrieves the type of evaluation error.Retrieves the evaluation result as anImageToDiagram.EvaluationResult
.Retrieves the image data as anImageToDiagramProcess.ImageUrlOrData
.boolean
Checks if an error of execution type has occurred.boolean
Checks if the last two diagrams in the code are equal.Methods inherited from class org.bsc.langgraph4j.state.AgentState
appendableValue, data, mergeWith, toString, updateState, updateState, value, value, value
-
Constructor Details
-
State
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 anImageToDiagramProcess.ImageUrlOrData
.- Returns:
- An
Optional
containing the image data, or empty if not available.
-
diagram
Retrieves the diagram element associated with this object.- Returns:
- an
Optional
containing the diagram element if it exists, otherwise an empty optional.
-
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
Retrieves the evaluation result as anImageToDiagram.EvaluationResult
.- Returns:
- An
Optional
containing the evaluation result, or empty if not available.
-
evaluationError
Returns anOptional
containing the value associated with "evaluationError".- Returns:
- an
Optional
containing the value associated with "evaluationError"
-
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
-