a
    ”˜ëj;Y  ã                   @  s0  d Z ddlmZ ddlZddlZddlZddlZddlmZ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mZmZmZmZmZmZ dd
lmZmZ ddlmZ eràddlmZm Z m!Z!m"Z"m#Z# ddl$m%Z% eddd�Z&eddd�Z'ddddœdd„Z(ddddœdd„Z)ddd œd!d"„Z*ddd œd#d$„Z+ddd œd%d&„Z,ed'd(�dd)œd*d+„ƒZ-d,d-œd.d/dd.d0œd1d2„Z.G d3d4„ d4ej/ƒZ0G d5d6„ d6ej/ƒZ1G d7d8„ d8ej/ƒZ2G d9d:„ d:ej/ƒZ3G d;d<„ d<ej/ƒZ4d=d>d?œd@dA„Z5d=dBd?œdCdD„Z6edEd(�d=dFd?œdGdH„ƒZ7dIdIdIdJœdKdL„Z8G dMdN„ dNe9e:ef ƒZ;edOdd�Z<edPdd�Z=G dQdR„ dRee=e<f ƒZ>edSe>eef dT�Z?dUdVdWœdXdY„Z@dZdVdWœd[d\„ZAG d]d^„ d^eƒZBG d_d`„ d`eƒZCG dadb„ dbeƒZDeeBeCeDf ZEG dcdd„ ddeƒZFdedfdgœdhdi„ZGG djdk„ dkƒZHddld?œdmdn„ZIddod?œdpdq„ZJdS )rzUtility code for runnables.é    )ÚannotationsN)ÚMappingÚSequence)ÚContext)Ú	lru_cache)Ú	signature)Úgroupby)ÚTYPE_CHECKINGÚAnyÚCallableÚ
NamedTupleÚOptionalÚProtocolÚTypeVarÚUnion)Ú	TypeGuardÚoverride)Úcreate_model)ÚAsyncIterableÚAsyncIteratorÚ	AwaitableÚ	CoroutineÚIterable)ÚStreamEventÚInputT)ÚcontravariantÚOutput)Ú	covariantzasyncio.Semaphorer   r
   )Ú	semaphoreÚcoroÚreturnc              	   Ã  sF   | 4 I dH š  |I dH W  d  ƒI dH  S 1 I dH s80    Y  dS )z±Run a coroutine with a semaphore.

    Args:
        semaphore: The semaphore to use.
        coro: The coroutine to run.

    Returns:
        The result of the coroutine.
    N© )r   r   r!   r!   ú]/mnt/bigstor/www/usecases/.venv/lib/python3.9/site-packages/langchain_core/runnables/utils.pyÚ
gated_coro.   s    
r#   zUnion[int, None]Úlist)ÚnÚcorosr    c                 ‡  s@   | du rt j|Ž I dH S t  | ¡‰ t j‡ fdd„|D ƒŽ I dH S )zëGather coroutines with a limit on the number of concurrent coroutines.

    Args:
        n: The number of coroutines to run concurrently.
        *coros: The coroutines to run.

    Returns:
        The results of the coroutines.
    Nc                 3  s   | ]}t ˆ |ƒV  qd S ©N)r#   )Ú.0Úc©r   r!   r"   Ú	<genexpr>K   ó    z*gather_with_concurrency.<locals>.<genexpr>)ÚasyncioZgatherÚ	Semaphore)r%   r&   r!   r*   r"   Úgather_with_concurrency<   s    

r/   zCallable[..., Any]Úbool)Úcallabler    c                 C  s0   zt | ƒj d¡duW S  ty*   Y dS 0 dS )zÎCheck if a callable accepts a run_manager argument.

    Args:
        callable: The callable to check.

    Returns:
        bool: True if the callable accepts a run_manager argument, False otherwise.
    Zrun_managerNF©r   Ú
parametersÚgetÚ
ValueError©r1   r!   r!   r"   Úaccepts_run_managerN   s    	r7   c                 C  s0   zt | ƒj d¡duW S  ty*   Y dS 0 dS )zÄCheck if a callable accepts a config argument.

    Args:
        callable: The callable to check.

    Returns:
        bool: True if the callable accepts a config argument, False otherwise.
    ÚconfigNFr2   r6   r!   r!   r"   Úaccepts_config]   s    	r9   c                 C  s0   zt | ƒj d¡duW S  ty*   Y dS 0 dS )zÆCheck if a callable accepts a context argument.

    Args:
        callable: The callable to check.

    Returns:
        bool: True if the callable accepts a context argument, False otherwise.
    ÚcontextNFr2   r6   r!   r!   r"   Úaccepts_contextl   s    	r;   é   )Úmaxsize©r    c                   C  s
   t tjƒS )zÈCache the result of checking if asyncio.create_task accepts a ``context`` arg.

    Returns:
        bool: True if ``asyncio.create_task`` accepts a context argument, False
            otherwise.
    )r;   r-   Úcreate_taskr!   r!   r!   r"   Úasyncio_accepts_context{   s    r@   F)r?   zAwaitable[Any]r   )r   r:   r?   r    c                C  s&   t ƒ rtj| |d�S |r"t | ¡S | S )zôAwait a coroutine with a context.

    Args:
        coro: The coroutine to await.
        context: The context to use.
        create_task: Whether to create a task. Defaults to False.

    Returns:
        The coroutine with the context.
    )r:   )r@   r-   r?   )r   r:   r?   r!   r!   r"   Úcoro_with_context†   s
    
rA   c                   @  sJ   e Zd ZdZddddœdd„Zeddd	œd
d„ƒZeddd	œdd„ƒZdS )ÚIsLocalDictz Check if a name is a local dict.Ústrzset[str]ÚNone)ÚnameÚkeysr    c                 C  s   || _ || _dS )z|Initialize the visitor.

        Args:
            name: The name to check.
            keys: The keys to populate.
        N)rE   rF   )ÚselfrE   rF   r!   r!   r"   Ú__init__�   s    zIsLocalDict.__init__zast.Subscript©Únoder    c                 C  sZ   t |jtjƒrVt |jtjƒrV|jj| jkrVt |jtj	ƒrVt |jjt
ƒrV| j |jj¡ dS )zTVisit a subscript node.

        Args:
            node: The node to visit.
        N)Ú
isinstanceÚctxÚastÚLoadÚvalueÚNameÚidrE   ÚsliceÚConstantrC   rF   Úadd©rG   rJ   r!   r!   r"   Úvisit_Subscript§   s    ÿþýüûzIsLocalDict.visit_Subscriptzast.Callc                 C  s„   t |jtjƒr€t |jjtjƒr€|jjj| jkr€|jjdkr€t	|j
ƒdv r€t |j
d tjƒr€t |j
d jtƒr€| j |j
d j¡ dS )zOVisit a call node.

        Args:
            node: The node to visit.
        r4   >   r<   é   r   N)rK   ÚfuncrM   Ú	AttributerO   rP   rQ   rE   ÚattrÚlenÚargsrS   rC   rF   rT   rU   r!   r!   r"   Ú
visit_Call¸   s    ÿþý
üûúù
zIsLocalDict.visit_CallN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__rH   r   rV   r]   r!   r!   r!   r"   rB   š   s   
rB   c                   @  sZ   e Zd ZdZddœdd„Zedddœdd	„ƒZed
ddœdd„ƒZedddœdd„ƒZdS )ÚIsFunctionArgDictz4Check if the first argument of a function is a dict.rD   r>   c                 C  s   t ƒ | _dS )z#Create a IsFunctionArgDict visitor.N)ÚsetrF   ©rG   r!   r!   r"   rH   Ï   s    zIsFunctionArgDict.__init__ú
ast.LambdarI   c                 C  s2   |j j sdS |j j d j}t|| jƒ |j¡ dS )úUVisit a lambda function.

        Args:
            node: The node to visit.
        Nr   )r\   ÚargrB   rF   ÚvisitÚbody©rG   rJ   Zinput_arg_namer!   r!   r"   Úvisit_LambdaÓ   s    zIsFunctionArgDict.visit_Lambdaúast.FunctionDefc                 C  s0   |j j sdS |j j d j}t|| jƒ |¡ dS )úYVisit a function definition.

        Args:
            node: The node to visit.
        Nr   ©r\   rg   rB   rF   rh   rj   r!   r!   r"   Úvisit_FunctionDefß   s    z#IsFunctionArgDict.visit_FunctionDefúast.AsyncFunctionDefc                 C  s0   |j j sdS |j j d j}t|| jƒ |¡ dS )ú`Visit an async function definition.

        Args:
            node: The node to visit.
        Nr   rn   rj   r!   r!   r"   Úvisit_AsyncFunctionDefë   s    z(IsFunctionArgDict.visit_AsyncFunctionDefN)	r^   r_   r`   ra   rH   r   rk   ro   rr   r!   r!   r!   r"   rb   Ì   s   rb   c                   @  sF   e Zd ZdZddœdd„Zedddœdd	„ƒZed
ddœdd„ƒZdS )Ú	NonLocalsz Get nonlocal variables accessed.rD   r>   c                 C  s   t ƒ | _t ƒ | _dS )zCreate a NonLocals visitor.N)rc   ÚloadsÚstoresrd   r!   r!   r"   rH   û   s    zNonLocals.__init__zast.NamerI   c                 C  s>   t |jtjƒr| j |j¡ nt |jtjƒr:| j |j¡ dS )zOVisit a name node.

        Args:
            node: The node to visit.
        N)	rK   rL   rM   rN   rt   rT   rQ   ÚStoreru   rU   r!   r!   r"   Ú
visit_Name   s    zNonLocals.visit_Namezast.Attributec                 C  sø   t |jtjƒrô|j}|j}t |tjƒr<|jd | }|j}qt |tjƒrn| j 	|j
d | ¡ | j |j
¡ n†t |tjƒrôt |jtjƒrš| j 	|jj
¡ nZ|j}d}t |tjƒrÒ|rÄ|jd | }n|j}|j}q¤t |tjƒrô| j 	|j
d | ¡ dS )zUVisit an attribute node.

        Args:
            node: The node to visit.
        Ú.Ú N)rK   rL   rM   rN   rO   rZ   rY   rP   rt   rT   rQ   ÚdiscardÚCallrX   )rG   rJ   ÚparentZ	attr_exprr!   r!   r"   Úvisit_Attribute  s*    zNonLocals.visit_AttributeN)r^   r_   r`   ra   rH   r   rw   r}   r!   r!   r!   r"   rs   ø   s   rs   c                   @  sZ   e Zd ZdZddœdd„Zedddœdd	„ƒZed
ddœdd„ƒZedddœdd„ƒZdS )ÚFunctionNonLocalsz2Get the nonlocal variables accessed of a function.rD   r>   c                 C  s   t ƒ | _dS )z#Create a FunctionNonLocals visitor.N)rc   Ú	nonlocalsrd   r!   r!   r"   rH   /  s    zFunctionNonLocals.__init__rl   rI   c                 C  s(   t ƒ }| |¡ | j |j|j ¡ dS )rm   N©rs   rh   r   Úupdatert   ru   ©rG   rJ   Úvisitorr!   r!   r"   ro   3  s    
z#FunctionNonLocals.visit_FunctionDefrp   c                 C  s(   t ƒ }| |¡ | j |j|j ¡ dS )rq   Nr€   r‚   r!   r!   r"   rr   >  s    
z(FunctionNonLocals.visit_AsyncFunctionDefre   c                 C  s(   t ƒ }| |¡ | j |j|j ¡ dS )rf   Nr€   r‚   r!   r!   r"   rk   I  s    
zFunctionNonLocals.visit_LambdaN)	r^   r_   r`   ra   rH   r   ro   rr   rk   r!   r!   r!   r"   r~   ,  s   

r~   c                   @  s2   e Zd ZdZddœdd„Zedddœdd	„ƒZd
S )ÚGetLambdaSourcez)Get the source code of a lambda function.rD   r>   c                 C  s   d| _ d| _dS )zInitialize the visitor.Nr   )ÚsourceÚcountrd   r!   r!   r"   rH   X  s    zGetLambdaSource.__init__re   rI   c                 C  s(   |  j d7  _ ttdƒr$t |¡| _dS )rf   r<   ÚunparseN)r†   ÚhasattrrM   r‡   r…   rU   r!   r!   r"   rk   ]  s    
zGetLambdaSource.visit_LambdaN)r^   r_   r`   ra   rH   r   rk   r!   r!   r!   r"   r„   U  s   r„   r   úOptional[list[str]])rX   r    c                 C  sb   z@t  | ¡}t t |¡¡}tƒ }| |¡ |jr<t	|jƒndW S  t
tttfy\   Y dS 0 dS )zíGet the keys of the first argument of a function if it is a dict.

    Args:
        func: The function to check.

    Returns:
        Optional[list[str]]: The keys of the first argument if it is a dict,
            None otherwise.
    N)ÚinspectÚ	getsourcerM   ÚparseÚtextwrapÚdedentrb   rh   rF   ÚsortedÚSyntaxErrorÚ	TypeErrorÚOSErrorÚSystemError)rX   ÚcodeÚtreerƒ   r!   r!   r"   Ú get_function_first_arg_dict_keysi  s    


r–   úOptional[str]c                 C  s’   z| j dkr| j nd}W n ty.   d}Y n0 z.t | ¡}t t |¡¡}tƒ }| 	|¡ W n t
tttfy|   | Y S 0 |jdkrŽ|jS |S )z´Get the source code of a lambda function.

    Args:
        func: a Callable that can be a lambda function.

    Returns:
        str: the source code of the lambda function.
    z<lambda>Nr<   )r^   ÚAttributeErrorrŠ   r‹   rM   rŒ   r�   rŽ   r„   rh   r�   r‘   r’   r“   r†   r…   )rX   rE   r”   r•   rƒ   r!   r!   r"   Úget_lambda_source}  s    	


r™   é   z	list[Any]c                 C  s4  �zt  | ¡}t t |¡¡}tƒ }| |¡ g }t| dƒrRt	| j
ƒrRt  | j
¡nt  | ¡}i |j¥|j¥}| ¡ D ]–\}}||jv r�| |¡ |jD ]r}	d|	v r–|	 |¡r–|}
|	 d¡dd… D ]:}|
du rÒ q–zt|
|ƒ}
W qÂ t� yú   Y  q–Y qÂ0 qÂ| |
¡ q–qtW n  ttttf�y.   g  Y S 0 |S )z¹Get the nonlocal variables accessed by a function.

    Args:
        func: The function to check.

    Returns:
        list[Any]: The nonlocal variables accessed by the function.
    Ú__wrapped__rx   r<   N)rŠ   r‹   rM   rŒ   r�   rŽ   r~   rh   rˆ   r1   r›   ÚgetclosurevarsÚglobalsr   ÚitemsÚappendÚ
startswithÚsplitÚgetattrr˜   r�   r‘   r’   r“   )rX   r”   r•   rƒ   ÚvaluesÚclosureÚ
candidatesÚkÚvÚkkÚvvÚpartr!   r!   r"   Úget_function_nonlocals”  s<    


ÿÿý



r«   rC   )ÚtextÚprefixr    c                   sB   t |ƒ}d| ‰ |  ¡ }d |d g‡ fdd„|dd… D ƒ ¡S )zÐIndent all lines of text after the first line.

    Args:
        text: The text to indent.
        prefix: Used to determine the number of spaces to indent.

    Returns:
        str: The indented text.
    ú Ú
r   c                   s   g | ]}ˆ | ‘qS r!   r!   )r(   Úline©Úspacesr!   r"   Ú
<listcomp>Ì  r,   z,indent_lines_after_first.<locals>.<listcomp>r<   N)r[   Ú
splitlinesÚjoin)r¬   r­   Zn_spacesÚlinesr!   r±   r"   Úindent_lines_after_first¿  s    
r·   c                   @  s0   e Zd ZdZd d dœdd„Zd d dœdd„ZdS )ÚAddableDictz3Dictionary that can be added to another dictionary.)Úotherr    c              	   C  s|   t | ƒ}|D ]j}||vs$|| du r2|| ||< q|| durz|| ||  }W n tyl   || }Y n0 |||< q|S )zÊAdd a dictionary to this dictionary.

        Args:
            other: The other dictionary to add.

        Returns:
            A dictionary that is the result of adding the two dictionaries.
        N©r¸   r‘   ©rG   r¹   ÚchunkÚkeyÚaddedr!   r!   r"   Ú__add__Ò  s    	
zAddableDict.__add__c              	   C  s|   t |ƒ}| D ]j}||vs$|| du r2| | ||< q| | durz|| | |  }W n tyl   | | }Y n0 |||< q|S )zØAdd this dictionary to another dictionary.

        Args:
            other: The other dictionary to be added to.

        Returns:
            A dictionary that is the result of adding the two dictionaries.
        Nrº   r»   r!   r!   r"   Ú__radd__ç  s    	
zAddableDict.__radd__N)r^   r_   r`   ra   r¿   rÀ   r!   r!   r!   r"   r¸   Ï  s   r¸   Ú_T_coÚ	_T_contrac                   @  s    e Zd ZdZdddœdd„ZdS )ÚSupportsAddz+Protocol for objects that support addition.rÂ   rÁ   )Úxr    c                C  s   dS )z!Add the object to another object.Nr!   )rG   rÄ   r!   r!   r"   r¿     s    zSupportsAdd.__add__N)r^   r_   r`   ra   r¿   r!   r!   r!   r"   rÃ     s   rÃ   ÚAddable)ÚboundzIterable[Addable]zOptional[Addable])Úaddablesr    c                 C  s&   d}| D ]}|du r|n|| }q|S )z¼Add a sequence of addable objects together.

    Args:
        addables: The addable objects to add.

    Returns:
        Optional[Addable]: The result of adding the addable objects.
    Nr!   ©rÇ   Úfinalr¼   r!   r!   r"   rT     s    	rT   zAsyncIterable[Addable]c                 Ã  s0   d}| 2 z 3 dH W }|du r |n|| }q6 |S )zËAsynchronously add a sequence of addable objects together.

    Args:
        addables: The addable objects to add.

    Returns:
        Optional[Addable]: The result of adding the addable objects.
    Nr!   rÈ   r!   r!   r"   Úaadd  s    	rÊ   c                   @  s\   e Zd ZU dZded< dZded< dZded< dZded	< d
Zded< e	ddœdd„ƒZ
dS )ÚConfigurableFieldz)Field that can be configured by the user.rC   rQ   Nr—   rE   ÚdescriptionzOptional[Any]Ú
annotationFr0   Ú	is_sharedÚintr>   c                 C  s   t | j| jfƒS r'   )ÚhashrQ   rÍ   rd   r!   r!   r"   Ú__hash__7  s    zConfigurableField.__hash__)r^   r_   r`   ra   Ú__annotations__rE   rÌ   rÍ   rÎ   r   rÑ   r!   r!   r!   r"   rË   )  s   
rË   c                   @  s`   e Zd ZU dZded< ded< ded< dZded	< dZded
< dZded< eddœdd„ƒZ	dS )ÚConfigurableFieldSingleOptionz>Field that can be configured by the user with a default value.rC   rQ   úMapping[str, Any]ÚoptionsÚdefaultNr—   rE   rÌ   Fr0   rÎ   rÏ   r>   c                 C  s   t | jt| j ¡ ƒ| jfƒS r'   ©rÐ   rQ   ÚtuplerÕ   rF   rÖ   rd   r!   r!   r"   rÑ   L  s    z&ConfigurableFieldSingleOption.__hash__©
r^   r_   r`   ra   rÒ   rE   rÌ   rÎ   r   rÑ   r!   r!   r!   r"   rÓ   <  s   
rÓ   c                   @  s`   e Zd ZU dZded< ded< ded< dZd	ed
< dZd	ed< dZded< eddœdd„ƒZ	dS )ÚConfigurableFieldMultiOptionzFField that can be configured by the user with multiple default values.rC   rQ   rÔ   rÕ   zSequence[str]rÖ   Nr—   rE   rÌ   Fr0   rÎ   rÏ   r>   c                 C  s    t | jt| j ¡ ƒt| jƒfƒS r'   r×   rd   r!   r!   r"   rÑ   a  s    z%ConfigurableFieldMultiOption.__hash__rÙ   r!   r!   r!   r"   rÚ   Q  s   
rÚ   c                   @  s^   e Zd ZU dZded< ded< dZded< dZded	< dZded
< dZded< dZ	ded< dS )ÚConfigurableFieldSpeczKField that can be configured by the user. It is a specification of a field.rC   rQ   r
   rÍ   Nr—   rE   rÌ   rÖ   Fr0   rÎ   r‰   Údependencies)
r^   r_   r`   ra   rÒ   rE   rÌ   rÖ   rÎ   rÜ   r!   r!   r!   r"   rÛ   k  s   
rÛ   zIterable[ConfigurableFieldSpec]zlist[ConfigurableFieldSpec])Úspecsr    c                   sŒ   t t| dd„ d�dd„ ƒ}g }|D ]d\}}t|ƒ‰ t|ƒ}t|ƒdks\t‡ fdd„|D ƒƒrh| ˆ ¡ q"d|› d	ˆ g|¢› �}t|ƒ‚q"|S )
a  Get the unique config specs from a sequence of config specs.

    Args:
        specs: The config specs.

    Returns:
        list[ConfigurableFieldSpec]: The unique config specs.

    Raises:
        ValueError: If the runnable sequence contains conflicting config specs.
    c                 S  s   | j g| jpg ¢R S r'   )rQ   rÜ   ©Úsr!   r!   r"   Ú<lambda>�  r,   z)get_unique_config_specs.<locals>.<lambda>)r½   c                 S  s   | j S r'   )rQ   rÞ   r!   r!   r"   rà   �  r,   r   c                 3  s   | ]}|ˆ kV  qd S r'   r!   )r(   Úo©Úfirstr!   r"   r+   “  r,   z*get_unique_config_specs.<locals>.<genexpr>z6RunnableSequence contains conflicting config specsfor z: )r   r�   Únextr$   r[   ÚallrŸ   r5   )rÝ   ZgroupedÚuniqueZspec_idZdupesZothersÚmsgr!   râ   r"   Úget_unique_config_specs~  s"    ÿ"ÿÿÿ
rè   c                	   @  sH   e Zd Zdddddddœddddddddœdd„Zdd	d
dœdd„ZdS )Ú_RootEventFilterN©Úinclude_namesÚinclude_typesÚinclude_tagsÚexclude_namesÚexclude_typesÚexclude_tagszOptional[Sequence[str]]rD   )rë   rì   rí   rî   rï   rð   r    c                C  s(   || _ || _|| _|| _|| _|| _dS )zÜUtility to filter the root event in the astream_events implementation.

        This is simply binding the arguments to the namespace to make save on
        a bit of typing in the astream_events implementation.
        Nrê   )rG   rë   rì   rí   rî   rï   rð   r!   r!   r"   rH   Ÿ  s    z_RootEventFilter.__init__r   rC   r0   )ÚeventÚ	root_typer    c                   sê   ˆ j du r$ˆ jdu r$ˆ jdu r$d}nd}| d¡p4g }ˆ j durR|pP|d ˆ j v }ˆ jdurj|ph|ˆ jv }ˆ jdurŽ|pŒt‡ fdd„|D ƒƒ}ˆ jdurª|o¨|d ˆ jv}ˆ jdurÂ|oÀ|ˆ jv}ˆ jduræ|oät‡ fdd„|D ƒƒ}|S )	z&Determine whether to include an event.NTFÚtagsrE   c                 3  s   | ]}|ˆ j v V  qd S r'   )rí   ©r(   Útagrd   r!   r"   r+   Ç  r,   z1_RootEventFilter.include_event.<locals>.<genexpr>c                 3  s   | ]}|ˆ j vV  qd S r'   )rð   rô   rd   r!   r"   r+   Î  s   )	rë   rì   rí   r4   Úanyrî   rï   rð   rå   )rG   rñ   rò   ÚincludeZ
event_tagsr!   rd   r"   Úinclude_eventµ  s0    ÿþý





ÿz_RootEventFilter.include_event)r^   r_   r`   rH   rø   r!   r!   r!   r"   ré   ž  s   øré   z'TypeGuard[Callable[..., AsyncIterator]]c                 C  s    t  | ¡pt| dƒot  | j¡S )zæCheck if a function is an async generator.

    Args:
        func: The function to check.

    Returns:
        TypeGuard[Callable[..., AsyncIterator]: True if the function is
            an async generator, False otherwise.
    Ú__call__)rŠ   Úisasyncgenfunctionrˆ   rù   ©rX   r!   r!   r"   Úis_async_generatorÕ  s    


þrü   z#TypeGuard[Callable[..., Awaitable]]c                 C  s    t  | ¡pt| dƒot  | j¡S )zÈCheck if a function is async.

    Args:
        func: The function to check.

    Returns:
        TypeGuard[Callable[..., Awaitable]: True if the function is async,
            False otherwise.
    rù   )r-   Úiscoroutinefunctionrˆ   rù   rû   r!   r!   r"   Úis_async_callableç  s    


þrþ   )Kra   Ú
__future__r   rM   r-   rŠ   r�   Úcollections.abcr   r   Zcontextvarsr   Ú	functoolsr   r   Ú	itertoolsr   Útypingr	   r
   r   r   r   r   r   r   Ztyping_extensionsr   r   Zlangchain_core.utils.pydanticr   r   r   r   r   r   Zlangchain_core.runnables.schemar   r   r   r#   r/   r7   r9   r;   r@   rA   ÚNodeVisitorrB   rb   rs   r~   r„   r–   r™   r«   r·   ÚdictrC   r¸   rÁ   rÂ   rÃ   rÅ   rT   rÊ   rË   rÓ   rÚ   ZAnyConfigurableFieldrÛ   rè   ré   rü   rþ   r!   r!   r!   r"   Ú<module>   sn   (ÿ2,4)*.ÿ 7