langchain/chains/query_constructor/base.py/StructuredQueryOutputParser/parse
class StructuredQueryOutputParser:    def parse(self, text: str) -> StructuredQuery:
        try:
            expected_keys = ["query", "filter"]
            parsed = parse_and_check_json_markdown(text, expected_keys)
            if len(parsed["query"]) == 0:
                parsed["query"] = " "
            if parsed["filter"] == "NO_FILTER" or not parsed["filter"]:
                parsed["filter"] = None
            else:
                parsed["filter"] = self.ast_parse(parsed["filter"])
            return StructuredQuery(
                query=parsed["query"],
                filter=parsed["filter"],
                limit=parsed.get("limit"),
            )
        except Exception as e:
            raise OutputParserException(
                f"Parsing text\n{text}\n raised following error:\n{e}"
            )