
    ^hׅ              	       P   S r SSKrSSKrSSKrSSKrSSKJrJrJrJ	r	J
r
JrJrJrJrJr  SSKJr  SSKrSSKJrJr  SSKJr  SSKJr  SSKJr  SS	KJrJrJrJ r J!r!J"r"  \(       a  SS
K#J$r%  SSK&J'r'  O\r%\r' " S S\5      r( " S S5      r) SS\	S\\\S4      S\
\*\4   4S jjr+g)a  
This contains LLMCachingHandler 

This exposes two methods:
    - async_get_cache
    - async_set_cache

This file is a wrapper around caching.py

This class is used to handle caching logic specific for LLM API requests (completion / embedding / text_completion / transcription etc)

It utilizes the (RedisCache, s3Cache, RedisSemanticCache, QdrantSemanticCache, InMemoryCache, DiskCache) based on what the user has setup

In each method it will call the appropriate method from caching.py
    N)
TYPE_CHECKINGAnyAsyncGeneratorCallableDict	GeneratorListOptionalTupleUnion)	BaseModel)print_verboseverbose_logger)S3Cache)1_assemble_complete_response_from_streaming_chunks)RerankResponse)	CallTypes	EmbeddingEmbeddingResponseModelResponseTextCompletionResponseTranscriptionResponse)LoggingCustomStreamWrapperc                   P    \ rS rSr% SrSr\\   \S'   Sr	\\
   \S'   Sr\\S'   Srg)	CachingHandlerResponse<   a  
This is the response object for the caching handler. We need to separate embedding cached responses and (completion / text_completion / transcription) cached responses

For embeddings there can be a cache hit for some of the inputs in the list and a cache miss for others
Ncached_resultfinal_embedding_cached_responseF embedding_all_elements_cache_hit )__name__
__module____qualname____firstlineno____doc__r   r
   r   __annotations__r    r   r!   bool__static_attributes__r"       Y/home/james-whalen/.local/lib/python3.13/site-packages/litellm/caching/caching_handler.pyr   r   <   s7     $(M8C='CG#X.?%@G %d r+   r   c                      \ rS rSrS\S\\\4   S\R                  4S jr	 S)S\S\S\
S\R                  S	\S
\\\4   S\\\S4      S\4S jjr S)S\S\S\
S\R                  S	\S
\\\4   S\\\S4      S\4S jjrS\\   S\\\\\4         S
\\\4   S\
S\R                  S\S\\\   \4   4S jrS\S\S\R                  S\R                  S\4
S jrS\
S\S\R                  S\R                  S\4
S jrS	\S
\\\4   S\\S4   S\\   4S jr S)S\S	\S
\\\4   S\
S\S\\S4   S\\   S\\\\\\\\4      4S jjrS\S	\S\
S\S\4
S jr S)S\S\S
\\\4   S\\\S4      4S jjr S)S\S
\\\4   S\\\S4      4S jjr S\S
\\\4   S\4S  jr!S\S\4S! jr"S"\4S# jr#S"\4S$ jr$ S*S\
S\S
\\\4   S\S%\S&\4S' jjr%S(r&g)+LLMCachingHandlerJ   original_functionrequest_kwargs
start_timec                 D    / U l         / U l        X l        Xl        X0l        g N)async_streaming_chunkssync_streaming_chunksr1   r0   r2   )selfr0   r1   r2   s       r,   __init__LLMCachingHandler.__init__K   s(     <>#:<",!2$r+   Nmodellogging_obj	call_typekwargsargs.returnc                   #    SSK Jn  U=(       d    SnSn	Sn
SnUR                  SS5      c  [        R                  c  UR                  SS5      SL Ga  UR                  S0 5      R                  S	S5      SLGa`  [        R                  GbN  U R                  US
9(       Ga9  [        R                  " S5        U R                  UUUS9I Sh  vN nUGbq  [        U[        5      (       Gd[  [        R                  " S5        Sn[        R                  R                  5       n[        R                  " UUR                  SS5      UR                  SS5      UR                  SS5      S9u  n    nU R                  UUUUSS9  UR                  nU R!                  UUUUUUR                  SS5      US9nUR                  SS5      SL a  U R#                  UUUUUS9  [        R                  R$                  " S0 UD6n[        U[&        5      (       d  [        X5      (       a  [)        US5      (       a  XR*                  S'   [-        US9$ U[.        R0                  R2                  :X  aw  Ubt  [        U[        5      (       a_  [        R                  bN  [        [        R                  R                  [4        5      (       d!  U R7                  U	UUUUUS9u  n	n
[-        U	U
S9$ [        R                  " SU 35        [-        UU	S9$  GN27f)a  
Internal method to get from the cache.
Handles different call types (embeddings, chat/completions, text_completion, transcription)
and accordingly returns the cached response

Args:
    model: str:
    original_function: Callable:
    logging_obj: LiteLLMLoggingObj:
    start_time: datetime.datetime:
    call_type: str:
    kwargs: Dict[str, Any]:
    args: Optional[Tuple[Any, ...]] = None:


Returns:
    CachingHandlerResponse:
Raises:
    None
r   r   r"   NFcachingTcachezno-cacher0   Checking Cache)r<   r=   r>   z
Cache Hit!custom_llm_providerapi_baseapi_keyr:   rE   rF   rG   r;   r:   r=   r   is_asyncr   r<   r=   r;   r:   rE   r>   streamr;   r   r2   end_time	cache_hit_hidden_params	cache_keyr   )r    r   r=   r;   r2   r:   )r    r!   zCACHE RESULT: )r   r    )litellm.utilsr   getlitellmrB    _is_call_type_supported_by_cacher   debug_retrieve_from_cache
isinstancelistdatetimenowget_llm_provider'_update_litellm_logging_obj_environmentr#   (_convert_cached_result_to_model_response!_async_log_cache_hit_on_callbacks!_get_preset_cache_key_from_kwargsr   hasattrrP   r   r   
aembeddingvaluer   (_process_async_embedding_cached_response)r7   r:   r0   r;   r2   r<   r=   r>   r   r    r!   r   rO   rN   _rQ   s                   r,   _async_get_cache"LLMCachingHandler._async_get_cacheX   s    < 	6zrGK'16('+ZZ	4(0W]]5Nzz)U+t3JJw#''
E:$F}}(T-R-R"3 .S . $$%56&*&?&?'! '@ ' ! !,Zt5T5T"((6 $I'00446H%,%=%=#,2JJ7Ld,S!'J!= &

9d ;	&NE1a @@$/#%&3!% A  !2 : :I$($Q$Q&3"+%$/#,2JJ7Ld,S! %R %M zz(E2e;>>(3*7'1%-&/ ?  !( O O ! !I #=)<<%mII!-1ABBDM44[A1NN!5!5!;!;;%1"=$771&++W  EE8W&3%$/#-# F 78 28W9Y  	~m_=>%',K
 	
]!s   C	L K=H2L c                    SSK Jn  U=(       d    SnUR                  5       n	U	R                  [	        U R
                  U5      5        S n
[        R                  Gb  U R                  US9(       Ga  [        S5        [        R                  R                  " S0 U	D6n
U
Gb^  SU
;   a  GOVUR                  nU R                  U
UUUUUR                  SS 5      US9n
S	n[        R                  R                  5       n[        R                   " U=(       d    S
UR                  SS 5      UR                  SS 5      UR                  SS 5      S9u  nnnnU R#                  UUUU
SS9  [$        R&                  " UR(                  XX4S9R+                  5         [        R                  R,                  " S0 UD6n[/        U
[0        5      (       d  [/        X5      (       a   [3        U
S5      (       a  UU
R4                  S'   [7        U
S9$ [7        U
S9$ )Nr   r   r"   rC   rD   detailrE   rK   T rF   rG   rH   FrI   targetr>   rP   rQ   rR   )rS   r   copyupdateconvert_args_to_kwargsr0   rU   rB   rV   r   	get_cacher#   r_   rT   r[   r\   r]   r^   	threadingThreadsuccess_handlerstartra   rY   r   rb   rP   r   )r7   r:   r0   r;   r2   r<   r=   r>   r   
new_kwargsr   rO   rN   rE   dynamic_api_keyrF   rQ   s                    r,   _sync_get_cache!LLMCachingHandler._sync_get_cache   s     	6zr[[]
"&&	
 (,==$)N)N/ *O *
 *+#MM33AjAM(}, 1 : :I$($Q$Q&3"+%$/#,2JJ7Ld,S! %R %M !%I'00446H  00#kr,2JJ7Ld,S!'J!= &

9d ;	+'  @@$/#%&3!& A  $$*::+M eg ' O O ! !I #=)<<%mII!-1ABBDM44[A1NN%MBBr+   r    r   c           	         Sn/ n/ n	[        U5       H3  u  pUc  UR                  US   U
   5        M!  U	R                  X45        M5     US   nXS'   [        U	5      S:  ay  [        S[        U	5       35        [	        UR                  S5      S/[        U5      -  S9nSUR                  S	'   U	 H'  nUu  pUc  M  [        US
   U
S
S9UR                  U
'   M)     [        U5      S:X  a  SnSn[        R                  R                  5       n[        R                  " UUR                  SS5      UR                  SS5      UR                  SS5      S9u  nnnnU R                  UUUUSSS9  U R                  UUUUUS9  X4$ X4$ )a1  
Returns the final embedding cached response and a boolean indicating if all elements in the list have a cache hit

For embedding responses, there can be a cache hit for some of the inputs in the list and a cache miss for others
This function processes the cached embedding responses and returns the final embedding cached response and a boolean indicating if all elements in the list have a cache hit

Args:
    final_embedding_cached_response: Optional[EmbeddingResponse]:
    cached_result: List[Optional[Dict[str, Any]]]:
    kwargs: Dict[str, Any]:
    logging_obj: LiteLLMLoggingObj:
    start_time: datetime.datetime:
    model: str:

Returns:
    Tuple[Optional[EmbeddingResponse], bool]:
    Returns the final embedding cached response and a boolean indicating if all elements in the list have a cache hit


FNinputr   zEMBEDDING CACHE HIT! - r:   )r:   dataTrO   	embedding)r}   indexobjectrE   rF   rG   rH   )r;   r:   r=   r   rJ   is_embeddingrM   )	enumerateappendlenr   r   rT   rP   r   r|   r[   r\   rU   r]   r^   r`   )r7   r    r   r=   r;   r2   r:   r!   remaining_listnon_null_listidxcroriginal_kwargs_inputvalrO   rN   rE   rw   rF   s                      r,   re   :LLMCachingHandler._process_async_embedding_cached_response*  s   : 27( /GCz%%fWoc&:;$$cY/	 0
 !'w(w}!3C4F3GHI.?jj)Vc"788/+ KO+::;G$>@I"$[/!*A388= % ~!#I/3,((,,.H (($*JJ/Dd$KJ5

9d3	# 88'=! 9  22'=%!# 3  3TT.PPr+   _caching_handler_responseembedding_responserN   c                    UR                   c  U$ Sn/ nUR                   R                   HI  nUc2  UR                  b%  UR                  UR                  U   5        US-  nM8  UR                  U5        MK     XaR                   l        SUR                   R                  S'   XC-
  R	                  5       S-  UR                   l        UR                   $ )a  
Combines the cached embedding response with the API EmbeddingResponse

For caching there can be a cache hit for some of the inputs in the list and a cache miss for others
This function combines the cached embedding response with the API EmbeddingResponse

Args:
    caching_handler_response: CachingHandlerResponse:
    embedding_response: EmbeddingResponse:

Returns:
    EmbeddingResponse:
r      TrO   i  )r    r|   r   rP   total_seconds_response_ms)r7   r   r   r2   rN   r   final_data_listitems           r,   2_combine_cached_embedding_response_with_api_resultDLLMCachingHandler._combine_cached_embedding_response_with_api_result  s    ( %DDL%%-MMRRD| 2 7 7 C&&'9'>'>s'CDq&&t, S JYAAF  	"AAPP	
 !
-/DR!!AAN )HHHr+   rO   c                     [         R                  " UR                  X#XE5      5        [        R                  " UR
                  X#XE4S9R                  5         g)aP  
Helper function to log the success of a cached result on callbacks

Args:
    logging_obj (LiteLLMLoggingObj): The logging object.
    cached_result: The cached result.
    start_time (datetime): The start time of the operation.
    end_time (datetime): The end time of the operation.
    cache_hit (bool): Whether it was a cache hit.
rl   N)asynciocreate_taskasync_success_handlerrr   rs   rt   ru   )r7   r;   r   r2   rN   rO   s         r,   r`   3LLMCachingHandler._async_log_cache_hit_on_callbacks  sO    $ 	--8	

 	..XA	
 %'r+   c                 \  #    [         R                  c  gUR                  5       nUR                  [	        U R
                  U5      5        SnU[        R                  R                  :X  a  [        US   [        5      (       a  / n[        US   5       HW  u  px[         R                  R                  " S0 0 UESU0ED6n	UR                  [         R                  R                  U	S95        MY     [        R                   " U6 I Sh  vN nUb.  [        U[        5      (       a  [#        S U 5       5      (       a  SnU$ [         R                  R%                  5       SL a*  [         R                  R                  " S0 UD6I Sh  vN nU$ [         R                  R&                  " S0 UD6nU$  N N*7f)a-  
Internal method to
- get cache key
- check what type of cache is used - Redis, RedisSemantic, Qdrant, S3
- async get cache value
- return the cached value

Args:
    call_type: str:
    kwargs: Dict[str, Any]:
    args: Optional[Tuple[Any, ...]] = None:

Returns:
    Optional[Any]:
Raises:
    None
Nr{   )rQ   c              3   (   #    U  H  oS L v   M
     g 7fr4   r"   ).0results     r,   	<genexpr>9LLMCachingHandler._retrieve_from_cache.<locals>.<genexpr>  s     BM&~Ms   Tr"   )rU   rB   rn   ro   rp   r0   r   rc   rd   rY   rZ   r   get_cache_keyr   async_get_cacher   gatherall_supports_asyncrq   )
r7   r<   r=   r>   rv   r   tasksr   ipreset_cache_keys
             r,   rX   &LLMCachingHandler._retrieve_from_cache  s    ( == [[]
"&&	
 (,	,,222zw8
 8
 E#Jw$78#*==#>#> $00Wa0$  W]]::EU:VW	 9
 #*..%"88M(Zt-L-LBMBBB$(M 	 }},,.$6&-mm&C&C&Qj&Q Q  !( 7 7 E* E 9 !Rs%   DF,F(A;F,?F* )F,*F,rE   c                    SSK Jn  U[        R                  R                  :X  d  U[        R
                  R                  :X  aL  [        U[        5      (       a7  UR                  SS5      SL a  U R                  UUUUS9nOU" U[        5       S9nU[        R                  R                  :X  d  U[        R                  R                  :X  aK  [        U[        5      (       a6  UR                  SS5      SL a  U R                  UUUUS9nGO1[        S0 UD6nGO$U[        R                  R                  :X  d  U[        R                  R                  :X  a&  [        U[        5      (       a  U" U[!        5       SS	9nOU[        R"                  R                  :X  d  U[        R$                  R                  :X  a  [        U[        5      (       a	  U" US
SS	9nOhU[        R&                  R                  :X  d  U[        R(                  R                  :X  a,  [        U[        5      (       a  SUSS.n	U" U[+        5       SU	S9n[-        US5      (       a;  UR.                  b.  [        UR.                  [        5      (       a  SUR.                  S'   U$ )a  
Internal method to process the cached result

Checks the call type and converts the cached result to the appropriate model response object
example if call type is text_completion -> returns TextCompletionResponse object

Args:
    cached_result: Any:
    call_type: str:
    kwargs: Dict[str, Any]:
    logging_obj: LiteLLMLoggingObj:
    model: str:
    custom_llm_provider: Optional[str] = None:
    args: Optional[Tuple[Any, ...]] = None:

Returns:
    Optional[Any]:
r   ) convert_to_model_response_objectrL   FT)r   r<   r;   r:   )response_objectmodel_response_objectr}   )r   r   response_typeNrerankz	whisper-1)r:   rE   rO   audio_transcription)r   r   r   hidden_paramsrP   rO   r"   )rS   r   r   acompletionrd   
completionrY   dictrT   _convert_cached_stream_responser   atext_completiontext_completionr   rc   r}   r   arerankr   atranscriptiontranscriptionr   rb   rP   )
r7   r   r<   r=   r;   r:   r>   rE   r   r   s
             r,   r_   :LLMCachingHandler._convert_cached_result_to_model_response  s@   J 	C ..444I00666--zz(E*d2 $ D D"/' +	 !E ! !A$1*7/!
 33999I55;;;--zz(E*d2 $ D D"/' +	 !E ! !7 G G--333I//555--< -&7&9)M **000IAQAQAWAW4W--< -&*&M 11777I33999--$':!M
 = -&;&=3+	M M#344,,8=77>>8<M((5r+   c                     SSK JnJnJn  U[        R
                  R                  :X  d  U[        R                  R                  :X  a  U" US9nOU" US9nU" UUSUS9$ )Nr   )r   convert_to_streaming_response#convert_to_streaming_response_async)r   cached_response)completion_streamr:   rE   r;   )rS   r   r   r   r   r   rd   r   )	r7   r   r<   r;   r:   r   r   r   _stream_cached_results	            r,   r   1LLMCachingHandler._convert_cached_stream_responsel  sp    	
 	
 ..444I66<<<$G -%! %B -%! #3 1#	
 	
r+   r   c                   #    UR                  5       nUR                  [        UU5      5        [        R                  c  gU R                  X%S9(       Ga  [        U[        R                  5      (       dJ  [        U[        R                  5      (       d+  [        U[        5      (       d  [        U[        5      (       GaP  [        U[        5      (       a  [        US   [        5      (       at  [        R                  bc  [        [        R                  R                  [        5      (       d6  [        R                  " [        R                  R                  " U40 UD65        g[        [        R                  R                  [        5      (       a>  [         R"                  " [        R                  R$                  U4US9R'                  5         g[        R                  " [        R                  R(                  " UR+                  5       40 UD65        g[        R                  " [        R                  R(                  " U40 UD65        gg7f)a  
Internal method to check the type of the result & cache used and adds the result to the cache accordingly

Args:
    result: Any:
    original_function: Callable:
    kwargs: Dict[str, Any]:
    args: Optional[Tuple[Any, ...]] = None:

Returns:
    None
Raises:
    None
Nr0   r=   r{   )rm   r>   r=   )rn   ro   rp   rU   rB   _should_store_result_in_cacherY   r   r   r   r   rZ   r   r   r   async_add_cache_pipelinerr   rs   	add_cacheru   async_add_cachemodel_dump_json)r7   r   r0   r=   r>   rv   s         r,   async_set_cache!LLMCachingHandler.async_set_cache  s    , [[]
"!	
 == --/ . 
 67#8#899fg&?&?@@f&;<<fn55 v'899":g#6==1&++W  ''>>vTT   3 3W==$$&}}66$Y) eg''55"2248B ##GMM$A$A&$WJ$WXC
s   IIc                    UR                  5       nUR                  [        U R                  U5      5        [        R
                  c  gU R                  U R                  US9(       a!  [        R
                  R                  " U40 UD6  g)z5
Sync internal method to add the result to the cache
Nr   )rn   ro   rp   r0   rU   rB   r   r   )r7   r   r=   r>   rv   s        r,   sync_set_cache LLMCachingHandler.sync_set_cache  sz     [[]
"&&	
 == --"44Z . 
 MM##F9j9r+   c                 0   [         R                  SL=(       a~    [         R                  R                  SL=(       a[    [        UR                  5      [         R                  R                  ;   =(       a$    UR                  S0 5      R                  SS5      SL$ )z
Helper function to determine if the result should be stored in the cache.

Returns:
    bool: True if the result should be stored in the cache, False otherwise.
NrB   zno-storeFT)rU   rB   supported_call_typesstrr#   rT   )r7   r0   r=   s      r,   r   /LLMCachingHandler._should_store_result_in_cache  sy     ]]$& M22$>M&//0GMM4V4VVM GR(,,Z?tK		
r+   c                     [         R                  bM  [         R                  R                  b2  [        UR                  5      [         R                  R                  ;   a  gg)a  
Helper function to determine if the call type is supported by the cache.

call types are acompletion, aembedding, atext_completion, atranscription, arerank

Defined on `litellm.types.utils.CallTypes`

Returns:
    bool: True if the call type is supported by the cache, False otherwise.
TF)rU   rB   r   r   r#   )r7   r0   s     r,   rV   2LLMCachingHandler._is_call_type_supported_by_cache  sB     MM%22>%../7==3U3UUr+   processed_chunkc           	        #    [        UU R                  [        R                  R                  5       U R                  U R
                  SS9nUb.  U R                  UU R                  U R                  S9I Sh  vN   gg N7f)z
Internal method to add the streaming response to the cache


- If 'streaming_chunk' has a 'finish_reason' then assemble a litellm.ModelResponse object
- Else append the chunk to self.async_streaming_chunks

Tr   r2   rN   r1   streaming_chunksrJ   N)r   r0   r=   )r   r2   r[   r\   r1   r5   r   r0   r7   r   complete_streaming_responses      r,    _add_streaming_response_to_cache2LLMCachingHandler._add_streaming_response_to_cache  s      >"&&**,..!88
 	$ '2&&2"&"8"8** '    3s   A4A?6A=7A?c           	          [        UU R                  [        R                  R                  5       U R                  U R
                  SS9nUb  U R                  UU R                  S9  gg)zA
Sync internal method to add the streaming response to the cache
Fr   N)r   r=   )r   r2   r[   r\   r1   r6   r   r   s      r,   %_sync_add_streaming_response_to_cache7LLMCachingHandler._sync_add_streaming_response_to_cache+  sn     >"&&**,..!77
 	$ '22**    3r+   rJ   r   c                 >   UR                  SS5      UUR                  SS5      UR                  S0 5      UR                  S0 5      UR                  SS5      UR                  S0 5      S	.n[        R                  b$  [        R                  R                  " S0 UD6US
'   OSUS
'   UR	                  UUR                  SS5      0 UU(       d  UR                  SS5      OUR                  SS5      UR                  SS5      [        U5      SUR                  SS5      S9	  g)a  
Helper function to update the LiteLLMLoggingObj environment variables.

Args:
    logging_obj (LiteLLMLoggingObj): The logging object to update.
    model (str): The model being used.
    kwargs (Dict[str, Any]): The keyword arguments from the original function call.
    cached_result (Any): The cached result to log.
    is_async (bool): Whether the call is asynchronous or not.
    is_embedding (bool): Whether the call is for embeddings or not.

Returns:
    None
	logger_fnNrF   rk   metadata
model_infoproxy_server_requeststream_response)r   r   rF   r   r   r   r   r   usermessagesr{   rG   rL   F)	r:   r   optional_paramslitellm_paramsr{   rG   original_responseadditional_argsrL   r"   )rT   rU   rB   ra   update_environment_variablesr   )r7   r;   r:   r=   r   rJ   r   r   s           r,   r^   9LLMCachingHandler._update_litellm_logging_obj_environmentA  s   0  K6#

:r2

:r2 **\26$*JJ/Et$L%zz*;R@
 ==$??I&I -. 26N-.00FD)) $ 

:r*ZZ,JJy$/!-0 ::h. 	1 	
r+   )r5   r0   r1   r2   r6   r4   )F)'r#   r$   r%   r&   r   r   r   r   r[   r8   LiteLLMLoggingObjr
   r   r   rg   rx   r   r	   r)   re   r   r`   rX   r   r   r   r   r   r   r_   r   r   r   r   rV   r   r   r^   r*   r"   r+   r,   r.   r.   J   s   # S#X %%	* +/@
@
 $@
 '	@

 %%@
 @
 S#X@
 uS#X'@
 
 @
T +/NCNC $NC '	NC
 %%NC NC S#XNC uS#X'NC 
 NC`XQ)12C)DXQ HT#s(^45XQ S#X	XQ
 'XQ %%XQ XQ 
x)*D0	1XQt'I#9'I .'I %%	'I
 ##'I 
'IR&  %%	
 ## 833&*38n3<A#s(O3	#3z .2ll l S#X	l
 'l l CHol &c]l 
"!!	
	
l\

 
 '	

 
 

J +/AYAY $AY S#X	AY
 uS#X'AYN +/	 S#X uS#X'	4
!)
37S>
	
 # 
,m 8] : #6
&6
 6
 S#X	6

 6
 6
 6
 6
r+   r.   r0   r>   .r?   c                     [         R                  " U 5      n[        UR                  R	                  5       5      n0 nU(       a-  [        U5       H  u  pVU[        U5      :  d  M  X5   nXdU'   M      U$ r4   )inspect	signaturerZ   
parameterskeysr   r   )r0   r>   r   param_namesargs_to_kwargsr~   arg
param_names           r,   rp   rp   z  so    
 !!"34I y++0023K N#D/JEs;''(/
-0z* *
 r+   r4   ),r'   r   r[   r   rr   typingr   r   r   r   r   r   r	   r
   r   r   pydanticr   rU   litellm._loggingr   r   litellm.caching.cachingr   (litellm.litellm_core_utils.logging_utilsr   litellm.types.rerankr   litellm.types.utilsr   r   r   r   r   r   *litellm.litellm_core_utils.litellm_loggingr   r   rS   r   r   r.   r   rp   r"   r+   r,   <module>r      s             : + 0  W1Y m
 m
d '+
5c?
# 
#s(^r+   