
    g                        d dl mZ d dlmZ d dlmZmZmZ d dlm	Z	 d dl
mZmZmZ d dlmZ erd dlmZ d dlmZ 	 	 	 	 	 	 	 	 	 	 	 	 dd	Z	 	 	 	 	 	 	 	 	 	 dd
ZddZ ed      Z ed      ZeZg dZy)    )annotations)TYPE_CHECKING)CACHE_DATA_MESSAGE_REPLAY_CTXCacheDataAPIget_data_cache_stats_provider)CACHE_DOCS_URL)!CACHE_RESOURCE_MESSAGE_REPLAY_CTXCacheResourceAPI!get_resource_cache_stats_provider)cache)Message)Blockc                h    t        j                  | ||||       t        j                  | ||||       y)zSave the message for an element to a thread-local callstack, so it can
    be used later to replay the element when a cache-decorated function's
    execution is skipped.
    N)r   save_element_messager	   )
delta_typeelement_protoinvoked_dg_id
used_dg_idreturned_dg_ids        W/var/www/openai/venv/lib/python3.12/site-packages/streamlit/runtime/caching/__init__.pyr   r   &   s8     "66M=*n &::M=*n    c                d    t        j                  | |||       t        j                  | |||       y)zSave the message for a block to a thread-local callstack, so it can
    be used later to replay the block when a cache-decorated function's
    execution is skipped.
    N)r   save_block_messager	   )block_protor   r   r   s       r   r   r   9   s4     "44]J &88]Jr   c                `    t        j                  | ||       t        j                  | ||       y )N)r   save_image_datar	   )
image_datamimetypeimage_ids      r   save_media_datar    K   s&    !11*hQ%55j(HUr   
cache_data)decorator_metric_namecache_resource)	r   r   r   r   r    r   r   r!   r#   N)r   strr   r   r   r$   r   r$   r   r$   returnNone)
r   r   r   r$   r   r$   r   r$   r%   r&   )r   zbytes | strr   r$   r   r$   r%   r&   )
__future__r   typingr   (streamlit.runtime.caching.cache_data_apir   r   r   &streamlit.runtime.caching.cache_errorsr   ,streamlit.runtime.caching.cache_resource_apir	   r
   r   *streamlit.runtime.caching.legacy_cache_apir   _cachegoogle.protobuf.messager   streamlit.proto.Block_pb2r   r   r   r    r!   r#   __all__ r   r   <module>r2      s    #   
 B 
 G//  	
  
&  	
 
$V =
!8HI 	
r   