
    i                    b    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ZddZ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                    	 t          |           } n # t          $ r t          d|            w xY 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   s     ]/home/agentuser/.hermes/hermes-agent/venv/lib/python3.11/site-packages/fal_client/_headers.pyadd_timeout_headerr      s    E.. E E EC'CCDDDE ---Q,GQQQ
 
 	
 '*'llG"###s    /hintr   c                    | |t           <   d S )N)RUNNER_HINT_HEADER)r   r   s     r   add_hint_headerr   "   s    "&G    priorityPriorityc                v    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_prioritiess      r   add_priority_headerr#   &   sZ      ))'''K'7KKKKK
 
 	
 &.G!"""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   <module>r(      s    " " " " " " + + + + + + + + + +  1 : ( .  ?#3 3 3 3"' ' ' '. . . . . .r   