}
        self.__send_event(event)
[docs]    def on_llm_error(
        self,
        error: BaseException,
        *,
        run_id: UUID,
        parent_run_id: Union[UUID, None] = None,
        **kwargs: Any,
    ) -> Any:
        event = {
            "event": "error",
            "type": "llm",
            "runId": str(run_id),
            "parent_run_id": str(parent_run_id) if parent_run_id else None,
            "error": {"message": str(error), "stack": traceback.format_exc()},
        }
        self.__send_event(event)
__all__ = ["LLMonitorCallbackHandler", "identify"]