Robust best-effort JSON parser for LLM-generated text (Gemini/other LLMs).
Handles:
Full JSON (object or array)
Newline-delimited JSON
Adjacent JSON objects without newlines: {}{}
Fallback: returns a normalized object with description and safety.
Silently ignores unparseable fragments, but logs a warning once per parse.
Robust best-effort JSON parser for LLM-generated text (Gemini/other LLMs). Handles:
descriptionandsafety. Silently ignores unparseable fragments, but logs a warning once per parse.DO NOT use for: