langchain.output_parsers.json.parse_partial_json¶

langchain.output_parsers.json.parse_partial_json(s: str, *, strict: bool = False) Any[source]¶

Parse a JSON string that may be missing closing braces.

Parameters
  • s – The JSON string to parse.

  • strict – Whether to use strict parsing. Defaults to False.

Returns

The parsed JSON object as a Python dictionary.