exc

Custom exceptions for the prompt_risk package.

exception prompt_risk.exc.JsonExtractionError(raw_output: str, cause: Exception)[source]

Failed to extract valid JSON from LLM output text.

Raised when prompt_risk.llm_output.extract_json() cannot parse the LLM response into a JSON object. The error message includes a truncated preview of the raw LLM output to aid debugging.

Attributes

raw_outputstr

The full, unmodified LLM output text that failed extraction.