
    /j                        S SK Jr   " S S\5      r " S S\5      r " S S\5      r " S S	\5      r " S
 S\5      r " S S\5      r SSSS.         SS jjjr	g)    )annotationsc                      \ rS rSrSrSrg)AssignmentTimeoutError   zRaised when accepting a job but not receiving an assignment within the specified timeout.
The server may have chosen another worker to handle this job. N)__name__
__module____qualname____firstlineno____doc____static_attributes__r       K/app/agent/.venv/lib/python3.13/site-packages/livekit/agents/_exceptions.pyr   r      s    E 	r   r   c                  x   ^  \ rS rSr% SrS\S'    S\S'    SrS\S	'    S
SS.SU 4S jjjrSS jrSS jr	Sr
U =r$ )APIError   zKRaised when an API request failed.
This is used on our TTS/STT/LLM plugins.strmessageobject | NonebodyFbool	retryableNTr   r   c               H   > [         TU ]  U5        Xl        X l        X0l        g N)super__init__r   r   r   )selfr   r   r   	__class__s       r   r   APIError.__init__"   s    !	"r   c                    U R                   $ r   )r   r   s    r   __str__APIError.__str__)   s    ||r   c                    U R                   R                   SU R                  < SU R                  < SU R                  < S3$ )N(, body=, retryable=))r   r   r   r   r   r"   s    r   __repr__APIError.__repr__,   s>    ..))*!DLL+;7499-|\`\j\j[mmnoor   )r   r   r   )r   r   r   r   r   r   returnNoner,   r   )r   r	   r
   r   r   __annotations__r   r   r#   r*   r   __classcell__r   s   @r   r   r      sQ    0 L  It+>BVZ # #p pr   r   c                     ^  \ rS rSr% SrS\S'    S\S'    SSSSS	.           SU 4S
 jjjrSS jrSS jrSr	U =r
$ )APIStatusError0   z<Raised when an API response has a status code of 4xx or 5xx.intstatus_code
str | None
request_idN)r6   r8   r   r   c               `   > Uc  SnUS:  a  US:  a  Sn[         TU ]  XUS9  X l        X0l        g )NTi  i  Fr   )r   r   r6   r8   )r   r   r6   r8   r   r   r   s         r   r   APIStatusError.__init__9   sA     Ic!kC&7!	yA&$r   c                :   SU R                   < 3SU R                   3SU R                   3/nU R                  (       a  UR	                  SU R                   35        U R
                  (       a  UR	                  SU R
                   35        SR                  U5      $ )Nzmessage=zstatus_code=z
retryable=zrequest_id=zbody=z, )r   r6   r   r8   appendr   join)r   partss     r   r#   APIStatusError.__str__M   s    t||&'4++,-()

 ??LL;t&78999LL5,-yyr   c                    U R                   R                   SU R                  < SU R                  < SU R                  < SU R
                  < SU R                  < S3$ )Nr&   z, status_code=z, request_id=r'   r(   r)   )r   r   r   r6   r8   r   r   r"   s    r   r*   APIStatusError.__repr__Y   sf    ~~&&'q(8 9++. ///, -II= !*!	-	
r   )r8   r6   )r   r   r6   r5   r8   r7   r   r   r   zbool | Noner,   r-   r.   )r   r	   r
   r   r   r/   r   r#   r*   r   r0   r1   s   @r   r3   r3   0   sy    F.; !%"!%%% 	%
 % % % 
% %(
 
 
r   r3   c                  <   ^  \ rS rSrSrSSS.SU 4S jjjjrSrU =r$ )	APIConnectionErrorc   z<Raised when an API request failed due to a connection error.Tr   c               $   > [         TU ]  US US9  g )Nr   r   r   r   r   r   r   s      r   r   APIConnectionError.__init__f   s    tyAr   r   )zConnection error.r   r   r   r   r,   r-   r   r	   r
   r   r   r   r   r0   r1   s   @r   rD   rD   c   s!    FBPT B B Br   rD   c                  <   ^  \ rS rSrSrSSS.SU 4S jjjjrSrU =r$ )	APITimeoutErrorj   z%Raised when an API request timed out.TrF   c                   > [         TU ]  XS9  g )NrF   rH   rI   s      r   r   APITimeoutError.__init__m   s    6r   r   )zRequest timed out.rK   rL   r1   s   @r   rN   rN   j   s    /7QU 7 7 7r   rN   c                      \ rS rSrSrg)CLIErrorq   r   N)r   r	   r
   r   r   r   r   r   rS   rS   q   s    r   rS   N)r8   r   c                   SSK Jn   U" U5      R                  nU (       a  X:w  a  U  SU SU S3nOU SU S3n[	        UUUUS9$ ! [         a    SU 3n N=f = f)zCreate an APIStatusError from an HTTP status code.

When the message carries extra detail beyond the standard reason phrase,
both the message and the reason are shown. Otherwise just the reason.
r   )
HTTPStatuszHTTP z ( r)   )r   r6   r8   r   )httprV   phrase
ValueErrorr3   )r   statusr8   r   rV   reasondisplays          r   create_api_error_from_httpr^   u   s      "F#** 7$IRxq2HBvha(	   "!"s   A AA) )
r   r   r[   r5   r8   r7   r   r   r,   r3   )

__future__r   	Exceptionr   r   r3   rD   rN   rS   r^   r   r   r   <module>rb      s    "	Y 	py pD0
X 0
fB B7( 7	y 	
  "  	
  r   