o
    gy                     @   s|   d dl mZ d dlmZmZmZmZ d dlmZm	Z	 ededef dZ
edee dZG dd	 d	eZG d
d deZdS )    )abstractmethod)	AwaitableCallableTypeVarAny)	ComponentSystemT.)boundAc                       @   e Zd ZdZdeddf fddZededefdd	Z  Z	S )
RateLimitEnforcerz
    Rate limit enforcer.

    Implemented as a wrapper around server functions to block requests if rate limits are exceeded.
    systemreturnNc                       t  | d S Nsuper__init__selfr   	__class__ S/var/www/visachat/venv/lib/python3.10/site-packages/chromadb/rate_limit/__init__.pyr         zRateLimitEnforcer.__init__funcc                 C      d S r   r   r   r   r   r   r   
rate_limit      zRateLimitEnforcer.rate_limit)
__name__
__module____qualname____doc__r   r   r   r	   r   __classcell__r   r   r   r   r   	   
    r   c                       r   )
AsyncRateLimitEnforcerz
    Rate limit enforcer.

    Implemented as a wrapper around async functions to block requests if rate limits are exceeded.
    r   r   Nc                    r   r   r   r   r   r   r   r      r   zAsyncRateLimitEnforcer.__init__r   c                 C   r   r   r   r   r   r   r   r   "   r    z!AsyncRateLimitEnforcer.rate_limit)
r!   r"   r#   r$   r   r   r   r   r   r%   r   r   r   r   r'      r&   r'   N)abcr   typingr   r   r   r   chromadb.configr   r   r	   r   r   r'   r   r   r   r   <module>   s    