
    h                     2    d Z ddlZddlmZ  G d de      Zy)zK
Add the event loop to the cache key, to prevent event loop closed errors.
    N   )InMemoryCachec                   B     e Zd Zd Z fdZ fdZ fdZ fdZ xZS )LLMClientCachec                     	 t        j                         }t        t        |            }| d| S # t        $ r |cY S w xY w)z
        Add the event loop to the cache key, to prevent event loop closed errors.
        If none, use the key as is.
        -)asyncioget_running_loopstridRuntimeError)selfkey
event_loopstringified_event_loops       _/var/www/Befach/backend/env/lib/python3.12/site-packages/litellm/caching/llm_caching_handler.py update_cache_key_with_event_loopz/LLMClientCache.update_cache_key_with_event_loop   sK    
	 113J%(J%8"U!2344 	J	s   .1 ??c                 H    | j                  |      }t        |   ||fi |S N)r   super	set_cacher   r   valuekwargs	__class__s       r   r   zLLMClientCache.set_cache   s*    33C8w e6v66    c                 d   K   | j                  |      }t        |   ||fi | d {   S 7 wr   )r   r   async_set_cacher   s       r   r   zLLMClientCache.async_set_cache   s4     33C8W,S%B6BBBBs   &0.0c                 F    | j                  |      }t        |   |fi |S r   )r   r   	get_cacher   r   r   r   s      r   r    zLLMClientCache.get_cache   s(    33C8w ///r   c                 b   K   | j                  |      }t        |   |fi | d {   S 7 wr   )r   r   async_get_cacher!   s      r   r#   zLLMClientCache.async_get_cache$   s2     33C8W,S;F;;;;s   %/-/)	__name__
__module____qualname__r   r   r   r    r#   __classcell__)r   s   @r   r   r   
   s"    
7C0
< <r   r   )__doc__r	   in_memory_cacher   r    r   r   <module>r+      s     *<] <r   