Class Json
java.lang.Object
com.hw.langchain.output.parsers.json.Json
- Author:
- HamaWhite
-
Method Summary
Modifier and TypeMethodDescriptionparseAndCheckJsonMarkdown
(String markdown, List<String> expectedKeys) Parse a JSON string from a Markdown string and check that it contains the expected keys.static com.fasterxml.jackson.databind.JsonNode
parseJsonMarkdown
(String jsonString) Parse a JSON string from a Markdown string.
-
Method Details
-
parseJsonMarkdown
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.
-