ó
    ýÞ j;  ã                  ó¼   • S SK Jr  S SKJrJr  S SKJr  S SKJrJ	r	J
r
  S SKJr  S SKJr  S SKJr  \
" S5      r\
" S	5      r\
" S
5      rSr " S S\	\\\4   \5      rg)é    )Úannotations)ÚABCÚabstractmethod)ÚSequence)ÚAnyÚGenericÚTypeVar)ÚSelf)ÚMISSING)ÚEmptyChannelErrorÚValueÚUpdateÚ
Checkpoint)ÚBaseChannelc                  óÔ   • \ rS rSrSrSrSSS jjr\\SS j5       5       r	\\SS j5       5       r
SS jrSS jr\SS	 j5       r\SS
 j5       rSS jr\SS j5       rSS jrSS jrSrg)r   é   zBase class for all channels.)ÚkeyÚtypc                ó   • Xl         X l        g )N)r   r   )Úselfr   r   s      ÚQ/var/www/html/gaurav/venv/lib/python3.13/site-packages/langgraph/channels/base.pyÚ__init__ÚBaseChannel.__init__   s   € ØŒØ�ó    c                ó   • g)z,The type of the value stored in the channel.N© ©r   s    r   Ú	ValueTypeÚBaseChannel.ValueType   ó   � r   c                ó   • g)z/The type of the update received by the channel.Nr   r   s    r   Ú
UpdateTypeÚBaseChannel.UpdateType!   r    r   c                ó@   • U R                  U R                  5       5      $ )z«Return a copy of the channel.

By default, delegates to `checkpoint()` and `from_checkpoint()`.

Subclasses can override this method with a more efficient implementation.
)Úfrom_checkpointÚ
checkpointr   s    r   ÚcopyÚBaseChannel.copy(   s   € ð ×#Ñ# D§O¡OÓ$5Ó6Ð6r   c                óP   •  U R                  5       $ ! [         a	    [        s $ f = f)z®Return a serializable representation of the channel's current state.

Raises `EmptyChannelError` if the channel is empty (never updated yet),
or doesn't support checkpoints.
)Úgetr   r   r   s    r   r&   ÚBaseChannel.checkpoint1   s'   € ð	Ø—8‘8“:ÐøÜ ó 	ÜŠNð	ús   ‚ ’%¤%c                ó   • g)z–Return a new identical channel, optionally initialized from a checkpoint.

If the checkpoint contains complex data structures, they should be copied.
Nr   )r   r&   s     r   r%   ÚBaseChannel.from_checkpoint<   r    r   c                ó   • g)zqReturn the current value of the channel.

Raises `EmptyChannelError` if the channel is empty (never updated yet).Nr   r   s    r   r*   ÚBaseChannel.getE   r    r   c                óF   •  U R                  5         g! [         a     gf = f)zÔReturn `True` if the channel is available (not empty), `False` otherwise.

Subclasses should override this method to provide a more efficient
implementation than calling `get()` and catching `EmptyChannelError`.
TF)r*   r   r   s    r   Úis_availableÚBaseChannel.is_availableK   s%   € ð	Ø�H‰HŒJØøÜ ó 	Ùð	ús   ‚ “
 Ÿ c                ó   • g)a�  Update the channel's value with the given sequence of updates.
The order of the updates in the sequence is arbitrary.
This method is called by Pregel for all channels at the end of each step.

If there are no updates, it is called with an empty sequence.

Raises `InvalidUpdateError` if the sequence of updates is invalid.

Returns `True` if the channel was updated, `False` otherwise.Nr   )r   Úvaluess     r   ÚupdateÚBaseChannel.updateY   r    r   c                ó   • g)zæNotify the channel that a subscribed task ran.

By default, no-op.

A channel can use this method to modify its state, preventing the value from being consumed again.

Returns `True` if the channel was updated, `False` otherwise.
Fr   r   s    r   ÚconsumeÚBaseChannel.consumee   ó   € ð r   c                ó   • g)zÏNotify the channel that the Pregel run is finishing.

By default, no-op.

A channel can use this method to modify its state, preventing finish.

Returns `True` if the channel was updated, `False` otherwise.
Fr   r   s    r   ÚfinishÚBaseChannel.finishp   r:   r   N)Ú )r   r   r   ÚstrÚreturnÚNone)r@   r   )r@   r
   )r@   úCheckpoint | Any)r&   rB   r@   r
   )r@   r   )r@   Úbool)r4   zSequence[Update]r@   rC   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú	__slots__r   Úpropertyr   r   r"   r'   r&   r%   r*   r1   r5   r8   r<   Ú__static_attributes__r   r   r   r   r      s    † Ù&à€Iöð Øó;ó ó ð;ð Øó>ó ó ð>ô
7ô	ð óó ðð óSó ðSô

ð ó	Ió ð	Iô	÷	r   r   N)Ú
__future__r   Úabcr   r   Úcollections.abcr   Útypingr   r   r	   Útyping_extensionsr
   Úlanggraph._internal._typingr   Úlanggraph.errorsr   r   r   r   Ú__all__r   r   r   r   Ú<module>rT      s\   ðÝ "ç #Ý $ß (Ñ (å "å /Ý .á�Ó€Ù	�Ó	€Ù�\Ó"€
à
€ôf�'˜% ¨Ð3Ñ4°cõ fr   