java.lang.Object
com.hw.langchain.output.parsers.json.Json

public class Json extends Object
Author:
HamaWhite
  • Method Details

    • parseJsonMarkdown

      public static com.fasterxml.jackson.databind.JsonNode parseJsonMarkdown(String jsonString)
      Parse a JSON string from a Markdown string.
      Parameters:
      jsonString - The Markdown string.
      Returns:
      The parsed JSON object as a Python dictionary.
    • parseAndCheckJsonMarkdown

      public static Map<String,Object> parseAndCheckJsonMarkdown(String markdown, List<String> expectedKeys)
      Parse a JSON string from a Markdown string and check that it contains the expected keys.
      Parameters:
      markdown - The Markdown string.
      expectedKeys - The expected keys in the JSON string.
      Returns:
      The parsed JSON object as a JsonNode.