class LLMGenerationError(Exception):
    """Raised by a service when the provider call fails outright or returns something
    that can't be parsed/validated as the expected shape. Maps to the README's
    { "error": { "code", "message", "details" } } envelope in main.py's exception handler.
    """

    def __init__(self, message: str, detail: str | None = None) -> None:
        super().__init__(message)
        self.message = message
        self.detail = detail
