
    (GgO              	       z    d dl mZmZmZmZ d dlmZ d dlmZm	Z	 d dl
mZ d dlmZ  G d dee	   ee	e	e	f         Zy)	    )AnyGenericSequenceType)Self)BaseChannelValue)MISSING)EmptyChannelErrorc                        e Zd ZdZdZddededdf fdZdede	fd	Z
edee   fd
       Zedee   fd       ZdefdZdedefdZdee   de	fdZdefdZde	fdZdefdZ xZS )AnyValuezeStores the last value received, assumes that if multiple values are
    received, they are all equal.)typvaluer   keyreturnNc                 <    t         |   ||       t        | _        y N)super__init__r
   r   )selfr   r   	__class__s      y/home/kushmeetdev/apache_webroot/langgraph_flaskproject/venv/lib/python3.12/site-packages/langgraph/channels/any_value.pyr   zAnyValue.__init__   s    c"
    r   c                 "    t        |t              S r   )
isinstancer   )r   r   s     r   __eq__zAnyValue.__eq__   s    %**r   c                     | j                   S )z,The type of the value stored in the channel.r   r   s    r   	ValueTypezAnyValue.ValueType        xxr   c                     | j                   S )z/The type of the update received by the channel.r   r   s    r   
UpdateTypezAnyValue.UpdateType   r!   r   c                 t    | j                  | j                  | j                        }| j                  |_        |S )zReturn a copy of the channel.)r   r   r   r   )r   emptys     r   copyzAnyValue.copy!   s*    txx2jjr   
checkpointc                 p    | j                  | j                  | j                        }|t        ur||_        |S r   )r   r   r   r
   r   )r   r'   r%   s      r   from_checkpointzAnyValue.from_checkpoint'   s.    txx2W$$EKr   valuesc                 r    t        |      dk(  r| j                  t        u ryt        | _        y|d   | _        y)Nr   FT)lenr   r
   )r   r*   s     r   updatezAnyValue.update-   s5    v;!zzW$$
BZ
r   c                 R    | j                   t        u r
t               | j                   S r   )r   r
   r   r   s    r   getzAnyValue.get8   s!    :: #%%zzr   c                 &    | j                   t        uS r   )r   r
   r   s    r   is_availablezAnyValue.is_available=   s    zz((r   c                     | j                   S r   )r   r   s    r   r'   zAnyValue.checkpoint@   s    zzr   ) )__name__
__module____qualname____doc__	__slots__r   strr   objectboolr   propertyr   r	   r    r#   r   r&   r)   r   r.   r0   r2   r'   __classcell__)r   s   @r   r   r   
   s    % !IC c 4 +F +t + 4;   DK  d % D 	Xe_ 	 	U 
)d )E r   r   N)typingr   r   r   r   typing_extensionsr   langgraph.channels.baser   r	   langgraph.constantsr
   langgraph.errorsr   r    r   r   <module>rE      s5    / / " 6 ' .7wu~{5%+>? 7r   