o
    yi                     @  s^   d dl mZ d dlmZmZmZ dZdZdZdZ	dZ
ed ZdddZdddZdddZdS )    )annotations)LiteralUnionget_args   zX-Fal-Request-TimeoutzX-Fal-Request-Timeout-TypezX-Fal-Runner-HintzX-Fal-Queue-Priority)normallowtimeoutUnion[int, float]headersdict[str, str]returnNonec                 C  sR   zt | } W n ty   td|  w | tkr!tdt dt| |t< dS )zV
    Validates the timeout and adds the timeout header to the headers dictionary.
    zTimeout must be a number, got zTimeout must be greater than z secondsN)float
ValueErrorMIN_REQUEST_TIMEOUT_SECONDSstrREQUEST_TIMEOUT_HEADER)r	   r    r   K/home/livre-enfant/venv/lib/python3.10/site-packages/fal_client/_headers.pyadd_timeout_header   s   
r   hintr   c                 C  s   | |t < d S )N)RUNNER_HINT_HEADER)r   r   r   r   r   add_hint_header"   s   r   priorityPriorityc                 C  s2   t t}| |vrtd| d|  d| |t< dS )a&  
    Validates the priority and adds the priority header to the headers dictionary.

    Args:
        priority: Queue priority, must be "normal" or "low".
        headers: Headers dictionary to add the priority header to.

    Raises:
        ValueError: If priority is not a valid value.
    zPriority must be one of z, got ''N)r   r   r   QUEUE_PRIORITY_HEADER)r   r   valid_prioritiesr   r   r   add_priority_header&   s   r   N)r	   r
   r   r   r   r   )r   r   r   r   r   r   )r   r   r   r   r   r   )
__future__r   typingr   r   r   r   r   REQUEST_TIMEOUT_TYPE_HEADERr   r   r   r   r   r   r   r   r   r   <module>   s    

