o
    ©i+  ã                   @   s"   d dl Z d dlZG dd„ dƒZdS )é    Nc                	   @   sj   e Zd ZU eƒ Zejeejej	e
 ejf f ed< dedejfdd„Zddedejdedd	fd
d„Zd	S )Ú
CacheMixinÚ_cacheÚkeyÚreturnc                 C   sD   | j  |¡}|d u rd S |\}}|d u s|t ¡ kr|S | j |= d S ©N)r   ÚgetÚtime)Úselfr   ÚvalÚexpiry_timestampÚvalue© r   úf/var/www/html/karishye-ai-python/venv/lib/python3.10/site-packages/cohere/manually_maintained/cache.pyÚ
_cache_get	   s   zCacheMixin._cache_geté  r   ÚttlNc                 C   s*   d }|d urt   ¡ | }||f| j|< d S r   )r   r   )r	   r   r   r   r   r   r   r   Ú
_cache_set   s   zCacheMixin._cache_set)r   )Ú__name__Ú
__module__Ú__qualname__Údictr   ÚtypingÚDictÚstrÚTupleÚOptionalÚfloatÚAnyÚ__annotations__r   Úintr   r   r   r   r   r      s   
 *"
r   )r   r   r   r   r   r   r   Ú<module>   s    