a
    fT                     @  sV   d dl mZ d dlZd dlmZmZ dddddd	Ze d
dddddddZdS )    )annotationsN)AnyCallablezCallable[..., Any]strbool)funcarg_namereturnc                 C  s   t | }||jv S )zBReturns whether or not the given function has a specific parameter)inspect	signature
parameters)r   r   sig r   R/var/www/ai-form-bot/venv/lib/python3.9/site-packages/openai/_utils/_reflection.pyfunction_has_argument   s    
r   )exclude_paramszset[str]None)source_func
check_funcr   r	   c          	   
   C  s   t |}t | }g }|j D ]l\}}||v r4q"|j|}|sX|d| d q"|j|jkr"|d| dt|j dt|j  q"q"|rtt	| dd
| dS )	zCEnsure that the signature of the second function matches the first.zthe `z` param is missingztypes for the `z!` param are do not match; source=z
 checking=z0 errors encountered when comparing signatures:

z

N)r
   r   r   itemsgetappend
annotationreprAssertionErrorlenjoin)	r   r   r   Z	check_sigZ
source_sigerrorsnameZsource_paramZcustom_paramr   r   r   assert_signatures_in_sync   s"    

 r   )	
__future__r   r
   typingr   r   r   setr   r   r   r   r   <module>   s
   
