Coverage for /home/admin/Documents/AI/applications/lexigram-dev/lexigram/experimental/ai/lexigram-ai-rag/src/lexigram/ai/rag/exceptions.py: 100%
20 statements
« prev ^ index » next coverage.py v7.15.4, created at 2026-08-25 07:19 +0800
« prev ^ index » next coverage.py v7.15.4, created at 2026-08-25 07:19 +0800
1"""Exceptions for the RAG package."""
3from __future__ import annotations
5from lexigram.contracts.ai.exceptions import RAGError as _ContractsRAGError
6from lexigram.contracts.ai.rag import ChunkingError, RetrievalError, SynthesisError
9class RAGError(_ContractsRAGError):
10 """Base exception for RAG errors."""
12 _code: str = "LEX_ERR_RAG_005"
15class PreprocessingError(RAGError):
16 """Raised when document preprocessing fails."""
18 _code: str = "LEX_ERR_RAG_006"
21class MultimodalError(RAGError):
22 """Base exception for multimodal processing errors."""
24 _code: str = "LEX_ERR_RAG_010"
27class AudioLoaderError(MultimodalError):
28 """Raised when audio loading fails."""
30 _code: str = "LEX_ERR_RAG_011"
33class VideoLoaderError(MultimodalError):
34 """Raised when video loading fails."""
36 _code: str = "LEX_ERR_RAG_012"
39class ImageLoaderError(MultimodalError):
40 """Raised when image loading fails."""
42 _code: str = "LEX_ERR_RAG_013"
45class CLIPEmbeddingError(MultimodalError):
46 """Raised when CLIP embedding computation fails."""
48 _code: str = "LEX_ERR_RAG_014"
51class MissingCitationsError(RAGError):
52 """Raised when a pipeline with ``require_citations=True`` produces no citations."""
54 _code: str = "LEX_ERR_RAG_015"
57__all__ = [
58 "AudioLoaderError",
59 "CLIPEmbeddingError",
60 "ChunkingError",
61 "ImageLoaderError",
62 "MissingCitationsError",
63 "MultimodalError",
64 "PreprocessingError",
65 "RAGError",
66 "RetrievalError",
67 "SynthesisError",
68 "VideoLoaderError",
69]