o
    Ã¿i7  ã                   @   s*   d Z 	ddededededef
d	d
„ZdS )zQBase class for network utilities, providing exponential backoff time calculation.é   é
   é   ÚattemptÚmin_waitÚmax_waitÚ
multiplierÚreturnc              	   C   sH   zd| d  | }t dt||ƒƒ}t ||ƒW S  ttfy#   | Y S w )a3  Calculate exponential backoff wait time.

    Args:
        attempt: Current attempt number (1-based)
        min_wait: Minimum wait time in seconds
        max_wait: Maximum wait time in seconds
        multiplier: Base multiplier for exponential calculation

    Returns:
        Wait time in seconds
    é   r   é    )ÚmaxÚminÚ
ValueErrorÚArithmeticError)r   r   r   r   ÚexpÚresult© r   úI/home/ubuntu/.local/lib/python3.10/site-packages/pipecat/utils/network.pyÚexponential_backoff_time
   s   ÿr   N)r   r   r   )Ú__doc__ÚintÚfloatr   r   r   r   r   Ú<module>   s   ÿÿÿÿÿþ