o
    ØRWj’  ã                   @  sF   d dl mZ d dlZd dlmZmZ dd
d„Zeƒ ddœddd„ZdS )é    )ÚannotationsN)ÚAnyÚCallableÚfuncúCallable[..., Any]Úarg_nameÚstrÚreturnÚboolc                 C  s   t  | ¡}||jv S )zBReturns whether or not the given function has a specific parameter)ÚinspectÚ	signatureÚ
parameters)r   r   Úsig© r   úh/home/esfera/Documents/content_generation/venv/lib/python3.10/site-packages/openai/_utils/_reflection.pyÚfunction_has_argument   s   

r   Ú )Úexclude_paramsÚdescriptionÚsource_funcÚ
check_funcr   úset[str]r   ÚNonec          
   
   C  sº   t  |¡}t  | ¡}g }|j ¡ D ]6\}}||v rq|j |¡}	|	s,| d|› d�¡ q|	j|jkrG| d|› dt|jƒ› dt|	jƒ› �¡ qq|r[tt	|ƒ› d|› 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=z- errors encountered when comparing signaturesz:

z

N)r   r   r   ÚitemsÚgetÚappendÚ
annotationÚreprÚAssertionErrorÚlenÚjoin)
r   r   r   r   Ú	check_sigÚ
source_sigÚerrorsÚnameÚsource_paramÚcustom_paramr   r   r   Úassert_signatures_in_sync   s*   
	
 ÿüÿÿr'   )r   r   r   r   r	   r
   )
r   r   r   r   r   r   r   r   r	   r   )	Ú
__future__r   r   Útypingr   r   r   Úsetr'   r   r   r   r   Ú<module>   s    

û