
    A'h/                     J   d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	m
Z
  G d de      Zded	ed
efd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y )!    )Sequence)Enum)Any)EmptyChannelError)Command	Interruptc                        e Zd ZdZdZdZdZdZy)	ErrorCodeGRAPH_RECURSION_LIMITINVALID_CONCURRENT_GRAPH_UPDATEINVALID_GRAPH_NODE_RETURN_VALUEMULTIPLE_SUBGRAPHSINVALID_CHAT_HISTORYN)__name__
__module____qualname__r   r   r   r   r        W/home/kushmeetdev/Regenta/Chatbot/venv/lib/python3.12/site-packages/langgraph/errors.pyr
   r
      s     3&G#&G#-1r   r
   message
error_codereturnc                 $    |  d|j                    S )NzV
For troubleshooting, visit: https://python.langchain.com/docs/troubleshooting/errors/value)r   r   s     r   create_error_messager      s"    ) "","2"2!3	5r   c                       e Zd ZdZy)GraphRecursionErroraP  Raised when the graph has exhausted the maximum number of steps.

    This prevents infinite loops. To increase the maximum number of steps,
    run your graph with a config specifying a higher `recursion_limit`.

    Troubleshooting Guides:

    - [GRAPH_RECURSION_LIMIT](https://python.langchain.com/docs/troubleshooting/errors/GRAPH_RECURSION_LIMIT)

    Examples:

        graph = builder.compile()
        graph.invoke(
            {"messages": [("user", "Hello, world!")]},
            # The config is the second positional argument
            {"recursion_limit": 1000},
        )
    Nr   r   r   __doc__r   r   r   r   r      s    & 	r   r   c                       e Zd ZdZy)InvalidUpdateErroraq  Raised when attempting to update a channel with an invalid set of updates.

    Troubleshooting Guides:

    - [INVALID_CONCURRENT_GRAPH_UPDATE](https://python.langchain.com/docs/troubleshooting/errors/INVALID_CONCURRENT_GRAPH_UPDATE)
    - [INVALID_GRAPH_NODE_RETURN_VALUE](https://python.langchain.com/docs/troubleshooting/errors/INVALID_GRAPH_NODE_RETURN_VALUE)
    Nr   r   r   r   r"   r"   2   s     	r   r"   c                       e Zd Zy)GraphBubbleUpN)r   r   r   r   r   r   r$   r$   >   s    r   r$   c                   4     e Zd ZdZddee   ddf fdZ xZS )GraphInterruptzxRaised when a subgraph is interrupted, suppressed by the root graph.
    Never raised directly, or surfaced to the user.
interruptsr   Nc                 $    t         |   |       y Nsuper__init__)selfr'   	__class__s     r   r,   zGraphInterrupt.__init__F   s    $r   )r   )r   r   r   r    r   r   r,   __classcell__r.   s   @r   r&   r&   B   s%    7%8I#6 % % %r   r&   c                   ,     e Zd ZdZdeddf fdZ xZS )NodeInterruptz(Raised by a node to interrupt execution.r   r   Nc                 :    t         |   t        |      g       y )Nr   )r+   r,   r   )r-   r   r.   s     r   r,   zNodeInterrupt.__init__M   s    )%012r   )r   r   r   r    r   r,   r/   r0   s   @r   r2   r2   J   s    23c 3d 3 3r   r2   c                   6     e Zd ZdZdeeef   ddf fdZ xZS )GraphDelegatez8Raised when a graph is delegated (for distributed mode).argsr   Nc                     t        |   |  y r)   r*   )r-   r6   r.   s     r   r,   zGraphDelegate.__init__T   s    $r   )	r   r   r   r    dictstrr   r,   r/   r0   s   @r   r5   r5   Q   s&    B d38n      r   r5   c                   :     e Zd ZU ee   ed<   deddf fdZ xZS )ParentCommandr6   commandr   Nc                 $    t         |   |       y r)   r*   )r-   r<   r.   s     r   r,   zParentCommand.__init__[   s    !r   )r   r   r   tupler   __annotations__r,   r/   r0   s   @r   r;   r;   X   s%    
." "D " "r   r;   c                       e Zd ZdZy)EmptyInputErrorz*Raised when graph receives an empty input.Nr   r   r   r   rA   rA   _   s    4r   rA   c                       e Zd ZdZy)TaskNotFoundzIRaised when the executor is unable to find a task (for distributed mode).Nr   r   r   r   rC   rC   e   s    Sr   rC   c                       e Zd ZdZy)CheckpointNotLatestzLRaised when the checkpoint is not the latest version (for distributed mode).Nr   r   r   r   rE   rE   k   s    Vr   rE   N)collections.abcr   enumr   typingr   langgraph.checkpoint.baser   langgraph.typesr   r   r
   r9   r   RecursionErrorr   	Exceptionr"   r$   r&   r2   r5   r;   rA   rC   rE   r   r   r   <module>rM      s    $   7 .
2 2S i C 	. 	.		 			I 	%] %3N 3 M  "M "	i 		9 		) 	r   