o
    ưi                  	   @   s`   d dl mZ d dlmZmZmZ edZ	d
dee deedef gedef f fdd	ZdS )    	lru_cache)CallableOptionalTypeVarTNmaxsizereturn.c                    s*   dt dtf dt dtf f fdd}|S )zB
    Wrapper for lru_cache that caches success and exceptions
    f.r	   c                    s&   t d fddfdd}|S )Nr   c               
      sB   z
d | i |fW S  t y  } z
d|fW  Y d }~S d }~ww )Nsuccesserror)	Exception)argskwargse)r
    Z/home/app/Keep/.python/lib/python3.10/site-packages/litellm/caching/_internal_lru_cache.pywrapper   s   z5lru_cache_wrapper.<locals>.decorator.<locals>.wrapperc                     s*    | i |}|d dkr|d |d S )Nr   r      r   )r   r   result)r   r   r   wrapped   s   z5lru_cache_wrapper.<locals>.decorator.<locals>.wrappedr   )r
   r   r   )r
   r   r   	decorator   s   z$lru_cache_wrapper.<locals>.decorator)r   r   )r   r   r   r   r   lru_cache_wrapper   s   &r   )N)		functoolsr   typingr   r   r   r   intr   r   r   r   r   <module>   s    