
    9i                    `   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	 d dl
mZ d dlmZ d dlmZmZ d d	lmZ d
Z G d de      Zd!dZ G d de      Z G d de      Z G d de      Z G d de      Z edd       G d de             Z G d de      Z G d de      Z G d d e      Zy)"    )annotations)Sequence)Enum)Any)warn)EmptyChannelError)
deprecated)Command	Interrupt)LangGraphDeprecatedSinceV10)
r   	ErrorCodeGraphRecursionErrorInvalidUpdateErrorGraphBubbleUpGraphInterruptNodeInterruptParentCommandEmptyInputErrorTaskNotFoundc                       e Zd ZdZdZdZdZdZy)r   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        Z/var/www/html/backtest/airagagent/rag_env/lib/python3.12/site-packages/langgraph/errors.pyr   r      s     3&G#&G#-1r    r   c                $    |  d|j                    S )NzT
For troubleshooting, visit: https://docs.langchain.com/oss/python/langgraph/errors/value)message
error_codes     r!   create_error_messager'   %   s"    ) ""#	%r    c                      e Zd ZdZy)r   aI  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://docs.langchain.com/oss/python/langgraph/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)r   ac  Raised when attempting to update a channel with an invalid set of updates.

    Troubleshooting guides:

    - [`INVALID_CONCURRENT_GRAPH_UPDATE`](https://docs.langchain.com/oss/python/langgraph/INVALID_CONCURRENT_GRAPH_UPDATE)
    - [`INVALID_GRAPH_NODE_RETURN_VALUE`](https://docs.langchain.com/oss/python/langgraph/INVALID_GRAPH_NODE_RETURN_VALUE)
    Nr)   r   r    r!   r   r   D   s     	r    r   c                      e Zd Zy)r   N)r   r   r   r   r    r!   r   r   P   s    r    r   c                  &     e Zd ZdZdd fdZ xZS )r   zxRaised when a subgraph is interrupted, suppressed by the root graph.
    Never raised directly, or surfaced to the user.c                $    t         |   |       y Nsuper__init__)self
interrupts	__class__s     r!   r2   zGraphInterrupt.__init__X   s    $r    )r   )r4   zSequence[Interrupt]returnNoner   r   r   r*   r2   __classcell__r5   s   @r!   r   r   T   s    7% %r    r   zYNodeInterrupt is deprecated. Please use [`interrupt`][langgraph.types.interrupt] instead.N)categoryc                  &     e Zd ZdZdd fdZ xZS )r   z(Raised by a node to interrupt execution.c                    t        dt        d       |t        |   t	        |      g       y t        |   t	        ||      g       y )NzLNodeInterrupt is deprecated. Please use `langgraph.types.interrupt` instead.   )
stacklevelr#   )r$   id)r   r   r1   r2   r   )r3   r$   r@   r5   s      r!   r2   zNodeInterrupt.__init__c   sG    Z'	

 :Gie456Gie;<=r    r/   )r$   r   r@   z
str | Noner6   r7   r8   r:   s   @r!   r   r   \   s    
 3	> 	>r    r   c                  ,     e Zd ZU ded<   d fdZ xZS )r   ztuple[Command]argsc                $    t         |   |       y r/   r0   )r3   commandr5   s     r!   r2   zParentCommand.__init__r   s    !r    )rD   r
   r6   r7   )r   r   r   __annotations__r2   r9   r:   s   @r!   r   r   o   s    
" "r    r   c                      e Zd ZdZy)r   z*Raised when graph receives an empty input.Nr)   r   r    r!   r   r   v   s    4r    r   c                      e Zd ZdZy)r   zIRaised when the executor is unable to find a task (for distributed mode).Nr)   r   r    r!   r   r   |   s    Sr    r   )r%   strr&   r   r6   rH   ) 
__future__r   collections.abcr   enumr   typingr   warningsr   langgraph.checkpoint.baser   typing_extensionsr	   langgraph.typesr
   r   langgraph.warningsr   __all__r   r'   RecursionErrorr   	Exceptionr   r   r   r   r   r   r   r   r    r!   <module>rU      s    " $    8 ( . :2 2	. 	.		 			I 	%] % _>N >	>"M "	i 		9 	r    