
    pi                       d dl mZ d dlmZ d dlZg dZ G d de      Z G d de      Z G d	 d
e      Z	 G d de      Z
 G d de      Z G d de      Z G d de
      Z G d de
      Z G d de
      Z G d de
      Z G d de
      Z G d de
      Z G d de
      Z G d d e
      Z G d! d"e
      Z G d# d$e
      Z G d% d&e
      Z G d' d(e
      Zy))    )annotations)LiteralN)BadRequestErrorAuthenticationErrorPermissionDeniedErrorNotFoundErrorConflictErrorUnprocessableEntityErrorRateLimitErrorInternalServerErrorc                      e Zd Zy)AnthropicErrorN__name__
__module____qualname__     W/opt/services/ai/voice_agent/venv/lib/python3.12/site-packages/anthropic/_exceptions.pyr   r          r   r   c                  B     e Zd ZU ded<   ded<   ded<   	 d fdZ xZS )	APIErrorstrmessagehttpx.Requestrequestobject | Nonebodyc               N    t         |   |       || _        || _        || _        y )N)super__init__r   r   r   )selfr   r   r   	__class__s       r   r!   zAPIError.__init__(   s%    !	r   )r   r   r   r   r   r   returnNoner   r   r   __annotations__r!   __classcell__r#   s   @r   r   r      s#    L
 r   r   c                  <     e Zd ZU ded<   ded<   ddd fdZ xZS )	APIResponseValidationErrorhttpx.Responseresponseintstatus_codeNr   c               v    t         |   |xs d|j                  |       || _        |j                  | _        y )Nz1Data returned by API invalid for expected schema.r   )r    r!   r   r-   r/   )r"   r-   r   r   r#   s       r   r!   z#APIResponseValidationError.__init__3   s:    W$WYaYiYiptu #//r   )r-   r,   r   r   r   
str | Noner$   r%   r&   r)   s   @r   r+   r+   /   s    _c 0 0r   r+   c                  D     e Zd ZU dZded<   ded<   ded<   d	 fdZ xZS )
APIStatusErrorz<Raised when an API response has a status code of 4xx or 5xx.r,   r-   r.   r/   r3   
request_idc                   t         |   ||j                  |       || _        |j                  | _        |j
                  j                  d      | _        y )Nr2   z
request-id)r    r!   r   r-   r/   headersgetr6   )r"   r   r-   r   r#   s       r   r!   zAPIStatusError.__init__@   sJ    ("2"2> #//"**..|<r   )r   r   r-   r,   r   r   r$   r%   )r   r   r   __doc__r'   r!   r(   r)   s   @r   r5   r5   9   s"    F= =r   r5   c                  &     e Zd Zddd fdZ xZS )APIConnectionErrorzConnection error.r0   c               *    t         |   ||d        y )Nr2   r    r!   )r"   r   r   r#   s      r   r!   zAPIConnectionError.__init__H   s    '5r   )r   r   r   r   r$   r%   r   r   r   r!   r(   r)   s   @r   r<   r<   G   s    )< 6 6r   r<   c                        e Zd Zd fdZ xZS )APITimeoutErrorc                (    t         |   d|       y )NzRequest timed out or interrupted. This could be due to a network timeout, dropped connection, or request cancellation. See https://docs.anthropic.com/en/api/errors#long-requests for more details.)r   r   r>   )r"   r   r#   s     r   r!   zAPITimeoutError.__init__M   s     Z 	 	
r   )r   r   r$   r%   r?   r)   s   @r   rA   rA   L   s    
 
r   rA   c                      e Zd ZU dZded<   y)r   i  zLiteral[400]r/   Nr   r   r   r/   r'   r   r   r   r   r   T        #K#r   r   c                      e Zd ZU dZded<   y)r   i  zLiteral[401]r/   NrD   r   r   r   r   r   X   rE   r   r   c                      e Zd ZU dZded<   y)r   i  zLiteral[403]r/   NrD   r   r   r   r   r   \   rE   r   r   c                      e Zd ZU dZded<   y)r   i  zLiteral[404]r/   NrD   r   r   r   r   r   `   rE   r   r   c                      e Zd ZU dZded<   y)r	   i  zLiteral[409]r/   NrD   r   r   r   r	   r	   d   rE   r   r	   c                      e Zd ZU dZded<   y)RequestTooLargeErrori  zLiteral[413]r/   NrD   r   r   r   rK   rK   h   rE   r   rK   c                      e Zd ZU dZded<   y)r
   i  zLiteral[422]r/   NrD   r   r   r   r
   r
   l   rE   r   r
   c                      e Zd ZU dZded<   y)r   i  zLiteral[429]r/   NrD   r   r   r   r   r   p   rE   r   r   c                      e Zd ZU dZded<   y)ServiceUnavailableErrori  zLiteral[503]r/   NrD   r   r   r   rO   rO   t   rE   r   rO   c                      e Zd ZU dZded<   y)OverloadedErrori  zLiteral[529]r/   NrD   r   r   r   rQ   rQ   x   rE   r   rQ   c                      e Zd ZU dZded<   y)DeadlineExceededErrori  zLiteral[504]r/   NrD   r   r   r   rS   rS   |   rE   r   rS   c                      e Zd Zy)r   Nr   r   r   r   r   r      r   r   r   )
__future__r   typing_extensionsr   httpx__all__	Exceptionr   r   r+   r5   r<   rA   r   r   r   r   r	   rK   r
   r   rO   rQ   rS   r   r   r   r   <module>rZ      s    # % 		Y 	~ ,0 0=X =6 6

( 
$n $$. $$N $$N $$N $$> $$~ $$^ $$n $$n $$N $	. 	r   