Class ReviewResult
java.lang.Object
dev.langchain4j.image_to_diagram.actions.correction.ReviewResult
- All Implemented Interfaces:
Function<ImageToDiagram.State,
,CompletableFuture<Map<String, Object>>> AsyncNodeAction<ImageToDiagram.State>
The ReviewResult class implements the AsyncNodeAction interface for processing ImageToDiagram.State objects.
It handles the review of diagram code and error messages using a language model from OpenAiChatModel.
-
Constructor Summary
ConstructorDescriptionReviewResult
(dev.langchain4j.model.openai.OpenAiChatModel model) Constructor for ReviewResult initializing the model. -
Method Summary
Modifier and TypeMethodDescriptionapply
(ImageToDiagram.State state) Asynchronously applies the logic to a given ImageToDiagram.State object.
-
Constructor Details
-
ReviewResult
public ReviewResult(dev.langchain4j.model.openai.OpenAiChatModel model) Constructor for ReviewResult initializing the model.- Parameters:
model
- The OpenAiChatModel instance to use for processing.
-
-
Method Details
-
apply
Asynchronously applies the logic to a given ImageToDiagram.State object.- Specified by:
apply
in interfaceAsyncNodeAction<ImageToDiagram.State>
- Specified by:
apply
in interfaceFunction<ImageToDiagram.State,
CompletableFuture<Map<String, Object>>> - Parameters:
state
- The ImageToDiagram.State containing diagram code and evaluation errors.- Returns:
- A CompletableFuture containing the review result or an exception if processing fails.
-