o
    +i                     @  sL  d dl mZ d dlmZ d dlZg dZG dd deZG dd deZG d	d
 d
eZ	G dd deZ
G dd deZG dd deZG dd de
ZG dd de
ZG dd de
ZG dd de
ZG dd de
ZG dd de
ZG dd de
ZG dd  d e
ZG d!d" d"e
ZG d#d$ d$e
ZG d%d& d&e
ZG d'd( d(e
ZdS ))    )annotations)LiteralN)BadRequestErrorAuthenticationErrorPermissionDeniedErrorNotFoundErrorConflictErrorUnprocessableEntityErrorRateLimitErrorInternalServerErrorc                   @     e Zd ZdS )AnthropicErrorN__name__
__module____qualname__ r   r   R/var/www/html/psymed-ai/venv/lib/python3.10/site-packages/anthropic/_exceptions.pyr          r   c                      s:   e Zd ZU ded< ded< ded< 	 d fd	d
Z  ZS )APIErrorstrmessagehttpx.Requestrequestobject | NonebodyreturnNonec                  s"   t  | || _|| _|| _d S )N)super__init__r   r   r   )selfr   r   r   	__class__r   r   r   (   s   
zAPIError.__init__)r   r   r   r   r   r   r   r   r   r   r   __annotations__r   __classcell__r   r   r!   r   r      s   
 
r   c                      s6   e Zd ZU ded< ded< ddd fddZ  ZS )APIResponseValidationErrorhttpx.Responseresponseintstatus_codeNr   r   r   r   
str | Noner   r   c                  s*   t  j|pd|j|d || _|j| _d S )Nz1Data returned by API invalid for expected schema.r   )r   r   r   r(   r*   )r    r(   r   r   r!   r   r   r   3   s   z#APIResponseValidationError.__init__)r(   r'   r   r   r   r,   r   r   r#   r   r   r!   r   r&   /   s   
 r&   c                      s<   e Zd ZU dZded< ded< ded< d fddZ  ZS )APIStatusErrorz<Raised when an API response has a status code of 4xx or 5xx.r'   r(   r)   r*   r,   
request_idr   r   r   r   r   r   c                  s4   t  j||j|d || _|j| _|jd| _d S )Nr-   z
request-id)r   r   r   r(   r*   headersgetr/   )r    r   r(   r   r!   r   r   r   @   s   zAPIStatusError.__init__)r   r   r(   r'   r   r   r   r   )r   r   r   __doc__r$   r   r%   r   r   r!   r   r.   9   s   
 r.   c                      s$   e Zd Zddd fd	d
Z  ZS )APIConnectionErrorzConnection error.r+   r   r   r   r   r   r   c                  s   t  j||d d d S )Nr-   r   r   )r    r   r   r!   r   r   r   H   s   zAPIConnectionError.__init__)r   r   r   r   r   r   r   r   r   r   r%   r   r   r!   r   r3   G   s    r3   c                      s   e Zd Zd fddZ  ZS )APITimeoutErrorr   r   r   r   c                   s   t  jd|d d S )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   r4   )r    r   r!   r   r   r   M   s   
zAPITimeoutError.__init__)r   r   r   r   r5   r   r   r!   r   r6   L   s    r6   c                   @     e Zd ZU dZded< dS )r   i  zLiteral[400]r*   Nr   r   r   r*   r$   r   r   r   r   r   T      
 r   c                   @  r7   )r   i  zLiteral[401]r*   Nr8   r   r   r   r   r   X   r9   r   c                   @  r7   )r   i  zLiteral[403]r*   Nr8   r   r   r   r   r   \   r9   r   c                   @  r7   )r   i  zLiteral[404]r*   Nr8   r   r   r   r   r   `   r9   r   c                   @  r7   )r   i  zLiteral[409]r*   Nr8   r   r   r   r   r   d   r9   r   c                   @  r7   )RequestTooLargeErrori  zLiteral[413]r*   Nr8   r   r   r   r   r:   h   r9   r:   c                   @  r7   )r	   i  zLiteral[422]r*   Nr8   r   r   r   r   r	   l   r9   r	   c                   @  r7   )r
   i  zLiteral[429]r*   Nr8   r   r   r   r   r
   p   r9   r
   c                   @  r7   )ServiceUnavailableErrori  zLiteral[503]r*   Nr8   r   r   r   r   r;   t   r9   r;   c                   @  r7   )OverloadedErrori  zLiteral[529]r*   Nr8   r   r   r   r   r<   x   r9   r<   c                   @  r7   )DeadlineExceededErrori  zLiteral[504]r*   Nr8   r   r   r   r   r=   |   r9   r=   c                   @  r   )r   Nr   r   r   r   r   r      r   r   )
__future__r   typing_extensionsr   httpx__all__	Exceptionr   r   r&   r.   r3   r6   r   r   r   r   r   r:   r	   r
   r;   r<   r=   r   r   r   r   r   <module>   s,   
