Class DiagramOutputParser

java.lang.Object
dev.langchain4j.image_to_diagram.DiagramOutputParser

public class DiagramOutputParser extends Object
This class provides functionality to parse a JSON formatted string and convert it into a `Diagram.Element` object.
  • Constructor Details

    • DiagramOutputParser

      public DiagramOutputParser()
  • Method Details

    • parse

      public Diagram.Element parse(String s)
      Parses a JSON string and converts it into a Diagram.Element object.
      Parameters:
      s - The JSON string to be parsed.
      Returns:
      A Diagram.Element object representing the parsed JSON data.
      Throws:
      IllegalArgumentException - If no valid JSON is found in the input string.