o
    i                     @   s   d dl Zd dlZd dlmZmZmZmZ d dlm	Z	 d dl
mZ ededef dZdZd	Zd
gZdedefddZdedefddZdS )    N)CallableTypeVarAnycast)wraps)MistralClientExceptionF.)bound)   
   z3.10mcpmodule_namereturnc                 C   s   t j| }|d uS )N)	importlibutil	find_spec)r   spec r   _/var/www/html/karishye-ai-python/venv/lib/python3.10/site-packages/mistralai/extra/run/utils.pyis_module_installed   s   r   funcc                    s   t   fdd}tt|S )Nc               	      sd   t jtk rt j dt dt jj dt jj dtD ]}t	|s*t j dq | i |S )Nz' requires a Python version higher than z.You are using Python .zC requires the sdk to be installed with 'agents' extra dependencies.)
sysversion_infoREQUIRED_PYTHON_VERSIONr   __name__REQUIRED_PYTHON_VERSION_STRmajorminorREQUIRED_PACKAGESr   )argskwargspackager   r   r   wrapper   s   

z!run_requirements.<locals>.wrapper)r   r   r   )r   r$   r   r#   r   run_requirements   s   
r%   )importlib.utilr   r   typingr   r   r   r   	functoolsr   mistralai.extra.exceptionsr   r   r   r   r   strboolr   r%   r   r   r   r   <module>   s    