
    Zǻi(                       d dl mZ d dlmZ  G d de      Z G d de      Z G d de      Z G d	 d
e      Z G d de      Z	 G d de      Z
 G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d d e      Z G d! d"e      Z G d# d$e      Z G d% d&e      Z G d' d(e      Z G d) d*e      Z G d+ d,e      Z G d- d.e	      Z G d/ d0e      Zy1)2    )annotations)ErrorDetailsc                      e Zd ZdZy)Neo4jGraphRagErrorz5Global exception used for the neo4j-graphrag package.N__name__
__module____qualname____doc__     W/opt/lhia/marcimex/agent/venv/lib/python3.12/site-packages/neo4j_graphrag/exceptions.pyr   r          ?r   r   c                  $     e Zd ZdZd fdZ xZS )RetrieverInitializationErrorz:Exception raised when initialization of a retriever fails.c                8    t         |   d|        || _        y NzInitialization failed: super__init__errorsselfr   	__class__s     r   r   z%RetrieverInitializationError.__init__       26(;<r   r   list[ErrorDetails]returnNoner   r	   r
   r   r   __classcell__r   s   @r   r   r      s    D r   r   c                        e Zd Zd fdZ xZS )RagInitializationErrorc                8    t         |   d|        || _        y r   r   r   s     r   r   zRagInitializationError.__init__#   r   r   )r   r   )r   r	   r
   r   r!   r"   s   @r   r$   r$   "   s     r   r$   c                      e Zd ZdZy)PromptMissingInputErrorz9Exception raised when a prompt required input is missing.Nr   r   r   r   r'   r'   (   s    Cr   r'   c                      e Zd ZdZy)LLMGenerationErrorz7Exception raised when answer generation from LLM fails.Nr   r   r   r   r)   r)   .   s    Ar   r)   c                      e Zd ZdZy)EmbeddingsGenerationErrorz4Exception raised when generation of embeddings failsNr   r   r   r   r+   r+   4   s    >r   r+   c                  $     e Zd ZdZd fdZ xZS )SearchValidationErrorz5Exception raised for validation errors during search.c                8    t         |   d|        || _        y )NzSearch validation failed: r   r   s     r   r   zSearchValidationError.__init__;   s    5fX>?r   r   r    r"   s   @r   r-   r-   8   s    ? r   r-   c                      e Zd ZdZy)FilterValidationErrorzDException raised when input validation for metadata filtering fails.Nr   r   r   r   r0   r0   @   s    Nr   r0   c                      e Zd ZdZy)EmbeddingRequiredErrorzGException raised when an embedding method is required but not provided.Nr   r   r   r   r2   r2   F   s    Qr   r2   c                      e Zd ZdZy)InvalidRetrieverResultErrorz=Exception raised when the Retriever fails to return a result.Nr   r   r   r   r4   r4   L   s    Gr   r4   c                      e Zd ZdZy)Neo4jIndexErrorz1Exception raised when handling Neo4j index fails.Nr   r   r   r   r6   r6   R   s    ;r   r6   c                      e Zd ZdZy)Neo4jInsertionErrorzCException raised when inserting data into the Neo4j database fails.Nr   r   r   r   r8   r8   X   s    Mr   r8   c                  $     e Zd ZdZd fdZ xZS )Neo4jVersionErrorzGException raised when Neo4j version does not meet minimum requirements.c                $    t         |   d       y )Nz:This package only supports Neo4j version 5.18.1 or greater)r   r   )r   r   s    r   r   zNeo4jVersionError.__init__a   s    UVr   )r   r   r    r"   s   @r   r:   r:   ^   s    QW Wr   r:   c                      e Zd ZdZy)Text2CypherRetrievalErrorz5Exception raised when text-to-cypher retrieval fails.Nr   r   r   r   r=   r=   e   r   r   r=   c                      e Zd ZdZy)SchemaFetchErrorz6Exception raised when a Neo4jSchema cannot be fetched.Nr   r   r   r   r?   r?   k   s    @r   r?   c                      e Zd ZdZy)SchemaValidationErrorz4Custom exception for errors in schema configuration.Nr   r   r   r   rA   rA   q   s    >r   rA   c                      e Zd ZdZy)SchemaExtractionErrorz;Exception raised for errors in automatic schema extraction.Nr   r   r   r   rC   rC   w   s    Er   rC   c                      e Zd ZdZy)PdfLoaderErrorz*Custom exception for errors in PDF loader.Nr   r   r   r   rE   rE   }   s    4r   rE   c                      e Zd ZdZy)PromptMissingPlaceholderErrorzBException raised when a prompt is missing an expected placeholder.Nr   r   r   r   rG   rG      s    Lr   rG   c                      e Zd ZdZy)InvalidHybridSearchRankerErrorzKException raised when an invalid ranker type for Hybrid Search is provided.Nr   r   r   r   rI   rI      s    Ur   rI   c                      e Zd ZdZy)SearchQueryParseErrorzMException raised when there is a query parse error in the text search string.Nr   r   r   r   rK   rK      s    Wr   rK   c                      e Zd ZdZy)RetryableErrorzSException raised for transient errors that may succeed on retry (e.g. rate limits).Nr   r   r   r   rM   rM      s    ]r   rM   c                      e Zd ZdZy)RateLimitErrorz1Exception raised when API rate limit is exceeded.Nr   r   r   r   rO   rO      s    ;r   rO   N)
__future__r   pydantic_corer   	Exceptionr   r   r$   r'   r)   r+   r-   r0   r2   r4   r6   r8   r:   r=   r?   rA   rC   rE   rG   rI   rK   rM   rO   r   r   r   <module>rS      s>   # &	 	#5 / 	0 		+ 	? 2 ?. 	. 		/ 		"4 		( 		, 	W* W	 2 		) 		. 		. 		' 	M$6 MV%7 VX. X	' 	<^ <r   