|
17 | 17 | from pydantic_core import ErrorDetails
|
18 | 18 |
|
19 | 19 |
|
20 |
| -class Neo4jGenAiError(Exception): |
| 20 | +class Neo4jGraphRagError(Exception): |
21 | 21 | """Global exception used for the neo4j-graphrag package."""
|
22 | 22 |
|
23 | 23 | pass
|
24 | 24 |
|
25 | 25 |
|
26 |
| -class RetrieverInitializationError(Neo4jGenAiError): |
| 26 | +class RetrieverInitializationError(Neo4jGraphRagError): |
27 | 27 | """Exception raised when initialization of a retriever fails."""
|
28 | 28 |
|
29 | 29 | def __init__(self, errors: list[ErrorDetails]) -> None:
|
30 | 30 | super().__init__(f"Initialization failed: {errors}")
|
31 | 31 | self.errors = errors
|
32 | 32 |
|
33 | 33 |
|
34 |
| -class RagInitializationError(Neo4jGenAiError): |
| 34 | +class RagInitializationError(Neo4jGraphRagError): |
35 | 35 | def __init__(self, errors: list[ErrorDetails]):
|
36 | 36 | super().__init__(f"Initialization failed: {errors}")
|
37 | 37 | self.errors = errors
|
38 | 38 |
|
39 | 39 |
|
40 |
| -class PromptMissingInputError(Neo4jGenAiError): |
| 40 | +class PromptMissingInputError(Neo4jGraphRagError): |
41 | 41 | """Exception raised when a prompt required input is missing."""
|
42 | 42 |
|
43 | 43 | pass
|
44 | 44 |
|
45 | 45 |
|
46 |
| -class LLMGenerationError(Neo4jGenAiError): |
| 46 | +class LLMGenerationError(Neo4jGraphRagError): |
47 | 47 | """Exception raised when answer generation from LLM fails."""
|
48 | 48 |
|
49 | 49 | pass
|
50 | 50 |
|
51 | 51 |
|
52 |
| -class SearchValidationError(Neo4jGenAiError): |
| 52 | +class SearchValidationError(Neo4jGraphRagError): |
53 | 53 | """Exception raised for validation errors during search."""
|
54 | 54 |
|
55 | 55 | def __init__(self, errors: list[ErrorDetails]) -> None:
|
56 | 56 | super().__init__(f"Search validation failed: {errors}")
|
57 | 57 | self.errors = errors
|
58 | 58 |
|
59 | 59 |
|
60 |
| -class FilterValidationError(Neo4jGenAiError): |
| 60 | +class FilterValidationError(Neo4jGraphRagError): |
61 | 61 | """Exception raised when input validation for metadata filtering fails."""
|
62 | 62 |
|
63 | 63 | pass
|
64 | 64 |
|
65 | 65 |
|
66 |
| -class EmbeddingRequiredError(Neo4jGenAiError): |
| 66 | +class EmbeddingRequiredError(Neo4jGraphRagError): |
67 | 67 | """Exception raised when an embedding method is required but not provided."""
|
68 | 68 |
|
69 | 69 | pass
|
70 | 70 |
|
71 | 71 |
|
72 |
| -class InvalidRetrieverResultError(Neo4jGenAiError): |
| 72 | +class InvalidRetrieverResultError(Neo4jGraphRagError): |
73 | 73 | """Exception raised when the Retriever fails to return a result."""
|
74 | 74 |
|
75 | 75 | pass
|
76 | 76 |
|
77 | 77 |
|
78 |
| -class Neo4jIndexError(Neo4jGenAiError): |
| 78 | +class Neo4jIndexError(Neo4jGraphRagError): |
79 | 79 | """Exception raised when handling Neo4j index fails."""
|
80 | 80 |
|
81 | 81 | pass
|
82 | 82 |
|
83 | 83 |
|
84 |
| -class Neo4jInsertionError(Neo4jGenAiError): |
| 84 | +class Neo4jInsertionError(Neo4jGraphRagError): |
85 | 85 | """Exception raised when inserting data into the Neo4j database fails."""
|
86 | 86 |
|
87 | 87 | pass
|
88 | 88 |
|
89 | 89 |
|
90 |
| -class Neo4jVersionError(Neo4jGenAiError): |
| 90 | +class Neo4jVersionError(Neo4jGraphRagError): |
91 | 91 | """Exception raised when Neo4j version does not meet minimum requirements."""
|
92 | 92 |
|
93 | 93 | def __init__(self) -> None:
|
94 | 94 | super().__init__("This package only supports Neo4j version 5.18.1 or greater")
|
95 | 95 |
|
96 | 96 |
|
97 |
| -class Text2CypherRetrievalError(Neo4jGenAiError): |
| 97 | +class Text2CypherRetrievalError(Neo4jGraphRagError): |
98 | 98 | """Exception raised when text-to-cypher retrieval fails."""
|
99 | 99 |
|
100 | 100 | pass
|
101 | 101 |
|
102 | 102 |
|
103 |
| -class SchemaFetchError(Neo4jGenAiError): |
| 103 | +class SchemaFetchError(Neo4jGraphRagError): |
104 | 104 | """Exception raised when a Neo4jSchema cannot be fetched."""
|
105 | 105 |
|
106 | 106 | pass
|
107 | 107 |
|
108 | 108 |
|
109 |
| -class SchemaValidationError(Neo4jGenAiError): |
| 109 | +class SchemaValidationError(Neo4jGraphRagError): |
110 | 110 | """Custom exception for errors in schema configuration."""
|
111 | 111 |
|
112 | 112 | pass
|
113 | 113 |
|
114 | 114 |
|
115 |
| -class PdfLoaderError(Neo4jGenAiError): |
| 115 | +class PdfLoaderError(Neo4jGraphRagError): |
116 | 116 | """Custom exception for errors in PDF loader."""
|
117 | 117 |
|
118 | 118 | pass
|
0 commit comments