Class DescribeDiagramImage
java.lang.Object
dev.langchain4j.image_to_diagram.actions.DescribeDiagramImage
- All Implemented Interfaces:
NodeAction<ImageToDiagram.State>
This class implements the `NodeAction` interface for diagram image description.
It provides functionality to process the state of an image and generate a textual description based on its content using a vision model.
-
Constructor Summary
ConstructorDescriptionDescribeDiagramImage
(@NonNull dev.langchain4j.model.chat.ChatLanguageModel visionModel) Constructs a `DescribeDiagramImage` instance with the given language model. -
Method Summary
Modifier and TypeMethodDescriptionapply
(ImageToDiagram.State state) Applies the provided image to create a diagram.
-
Constructor Details
-
DescribeDiagramImage
public DescribeDiagramImage(@NonNull @NonNull dev.langchain4j.model.chat.ChatLanguageModel visionModel) Constructs a `DescribeDiagramImage` instance with the given language model.- Parameters:
visionModel
- The language model used to generate descriptions.
-
-
Method Details
-
apply
Applies the provided image to create a diagram.- Specified by:
apply
in interfaceNodeAction<ImageToDiagram.State>
- Parameters:
state
- The current state of the image to be converted into a diagram.- Returns:
- A map containing the resulting diagram and associated image data.
- Throws:
Exception
- if no image data is provided in the state.
-