Skip to content

Commit

Permalink
Update Neo4jGenAiError and various remaining documentation references…
Browse files Browse the repository at this point in the history
… to GenAI (neo4j#134)

* Update Neo4jGenAiError and various remaining documentation references to GenAI

* Revert documentation link in README
  • Loading branch information
willtai authored Sep 13, 2024
1 parent 05bcaec commit 75138c1
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Bug Report
about: Report a bug in the Neo4j GenAI library
about: Report a bug in the Neo4j GraphRAG library
labels: "bug"
---

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ISSUE_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Feature Request
about: Suggest an idea for the Neo4j GenAI library
about: Suggest an idea for the Neo4j GraphRAG library
labels: "feature request"
---

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The purpose of this package is to provide a first party package to developers,
where Neo4j can guarantee long term commitment and maintenance as well as being
fast to ship new features and high performing patterns and methods.

Documentation: https://neo4j.com/docs/neo4j-graphrag-python/
Documentation: https://neo4j.com/docs/neo4j-genai-python/

Python versions supported:

Expand Down
8 changes: 4 additions & 4 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ Errors
******


* :class:`neo4j_graphrag.exceptions.Neo4jGenAiError`
* :class:`neo4j_graphrag.exceptions.Neo4jGraphRagError`

* :class:`neo4j_graphrag.exceptions.RetrieverInitializationError`

Expand Down Expand Up @@ -255,10 +255,10 @@ Errors
* :class:`neo4j_graphrag.experimental.pipeline.exceptions.PipelineStatusUpdateError`


Neo4jGenAiError
===============
Neo4jGraphRagError
==================

.. autoclass:: neo4j_graphrag.exceptions.Neo4jGenAiError
.. autoclass:: neo4j_graphrag.exceptions.Neo4jGraphRagError
:show-inheritance:


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
[tool.poetry]
name = "neo4j-graphrag"
version = "0.6.2"
description = "Python package to allow easy integration to Neo4j's GenAI features"
description = "Python package to allow easy integration to Neo4j's GraphRAG features"
authors = ["Neo4j, Inc <[email protected]>"]
license = "Apache License, Version 2.0"
readme = "README.md"
Expand Down
32 changes: 16 additions & 16 deletions src/neo4j_graphrag/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,102 +17,102 @@
from pydantic_core import ErrorDetails


class Neo4jGenAiError(Exception):
class Neo4jGraphRagError(Exception):
"""Global exception used for the neo4j-graphrag package."""

pass


class RetrieverInitializationError(Neo4jGenAiError):
class RetrieverInitializationError(Neo4jGraphRagError):
"""Exception raised when initialization of a retriever fails."""

def __init__(self, errors: list[ErrorDetails]) -> None:
super().__init__(f"Initialization failed: {errors}")
self.errors = errors


class RagInitializationError(Neo4jGenAiError):
class RagInitializationError(Neo4jGraphRagError):
def __init__(self, errors: list[ErrorDetails]):
super().__init__(f"Initialization failed: {errors}")
self.errors = errors


class PromptMissingInputError(Neo4jGenAiError):
class PromptMissingInputError(Neo4jGraphRagError):
"""Exception raised when a prompt required input is missing."""

pass


class LLMGenerationError(Neo4jGenAiError):
class LLMGenerationError(Neo4jGraphRagError):
"""Exception raised when answer generation from LLM fails."""

pass


class SearchValidationError(Neo4jGenAiError):
class SearchValidationError(Neo4jGraphRagError):
"""Exception raised for validation errors during search."""

def __init__(self, errors: list[ErrorDetails]) -> None:
super().__init__(f"Search validation failed: {errors}")
self.errors = errors


class FilterValidationError(Neo4jGenAiError):
class FilterValidationError(Neo4jGraphRagError):
"""Exception raised when input validation for metadata filtering fails."""

pass


class EmbeddingRequiredError(Neo4jGenAiError):
class EmbeddingRequiredError(Neo4jGraphRagError):
"""Exception raised when an embedding method is required but not provided."""

pass


class InvalidRetrieverResultError(Neo4jGenAiError):
class InvalidRetrieverResultError(Neo4jGraphRagError):
"""Exception raised when the Retriever fails to return a result."""

pass


class Neo4jIndexError(Neo4jGenAiError):
class Neo4jIndexError(Neo4jGraphRagError):
"""Exception raised when handling Neo4j index fails."""

pass


class Neo4jInsertionError(Neo4jGenAiError):
class Neo4jInsertionError(Neo4jGraphRagError):
"""Exception raised when inserting data into the Neo4j database fails."""

pass


class Neo4jVersionError(Neo4jGenAiError):
class Neo4jVersionError(Neo4jGraphRagError):
"""Exception raised when Neo4j version does not meet minimum requirements."""

def __init__(self) -> None:
super().__init__("This package only supports Neo4j version 5.18.1 or greater")


class Text2CypherRetrievalError(Neo4jGenAiError):
class Text2CypherRetrievalError(Neo4jGraphRagError):
"""Exception raised when text-to-cypher retrieval fails."""

pass


class SchemaFetchError(Neo4jGenAiError):
class SchemaFetchError(Neo4jGraphRagError):
"""Exception raised when a Neo4jSchema cannot be fetched."""

pass


class SchemaValidationError(Neo4jGenAiError):
class SchemaValidationError(Neo4jGraphRagError):
"""Custom exception for errors in schema configuration."""

pass


class PdfLoaderError(Neo4jGenAiError):
class PdfLoaderError(Neo4jGraphRagError):
"""Custom exception for errors in PDF loader."""

pass
8 changes: 4 additions & 4 deletions src/neo4j_graphrag/experimental/pipeline/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from neo4j_graphrag.exceptions import Neo4jGenAiError
from neo4j_graphrag.exceptions import Neo4jGraphRagError


class PipelineDefinitionError(Neo4jGenAiError):
class PipelineDefinitionError(Neo4jGraphRagError):
"""Raised when the pipeline graph is invalid"""

pass


class PipelineMissingDependencyError(Neo4jGenAiError):
class PipelineMissingDependencyError(Neo4jGraphRagError):
"""Raised when a task is scheduled but its dependencies are not yet done"""

pass


class PipelineStatusUpdateError(Neo4jGenAiError):
class PipelineStatusUpdateError(Neo4jGraphRagError):
"""Raises when trying an invalid change of state (e.g. DONE => DOING)"""

pass

0 comments on commit 75138c1

Please sign in to comment.