Ë
    A²Xj¤  ã                  ó  — d dl mZ d dlmZmZ d dlmZ d dlZddlm	Z	 ddl
m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 G d-„ d.e«      Z  G d/„ d0e«      Z!y)1é    )Úannotations)ÚUnionÚcast)ÚLiteralNé   )Úis_dict)Ú	ErrorType)ÚBadRequestErrorÚAuthenticationErrorÚPermissionDeniedErrorÚNotFoundErrorÚConflictErrorÚUnprocessableEntityErrorÚRateLimitErrorÚInternalServerErrorc                  ó   — e Zd Zy)ÚAnthropicErrorN©Ú__name__Ú
__module__Ú__qualname__© ó    ú[/var/www/html/content_generation/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!   r2   r4   )r'   r2   r#   r   r(   s       €r   r&   z#APIResponseValidationError.__init__7   s:   ø€ Ü‰Ñ˜ÒWÐ$WÐYa×YiÑYiÐptÐÔuØ ˆŒØ#×/Ñ/ˆÕr   )r2   r1   r#   r"   r   ú
str | Noner)   r*   r+   r.   s   @r   r0   r0   3   s   ø… ØÓØÓà_c÷ 0ó 0r   r0   c                  ó   — e Zd Zy)ÚAPIWebhookValidationErrorNr   r   r   r   r:   r:   =   r   r   r:   c                  óN   ‡ — e Zd ZU dZded<   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.r1   r2   r3   r4   r8   Ú
request_idzErrorType | NoneÚtypec               óh  •— t         ‰| �  ||j                  |¬«       || _        |j                  | _        |j
                  j                  d«      | _        d | _        t        |«      rK|j                  d«      }t        |«      r.t        t        t        d f   |j                  d«      «      | _        y y y )Nr7   z
request-idÚerrorr>   )r%   r&   r!   r2   r4   ÚheadersÚgetr=   r>   r   r   r   r	   )r'   r   r2   r#   r@   r(   s        €r   r&   zAPIStatusError.__init__I   s—   ø€ Ü‰Ñ˜ (×"2Ñ"2¸ÐÔ>Ø ˆŒØ#×/Ñ/ˆÔØ"×*Ñ*×.Ñ.¨|Ó<ˆŒàˆŒ	Ü�4Œ=Ø—H‘H˜WÓ%ˆEÜ�uŒ~Ü ¤¤y°$ Ñ!7¸¿¹À6Ó9JÓK�•	ð ð r   )r   r   r2   r1   r#   r"   r)   r*   )r   r   r   Ú__doc__r,   r&   r-   r.   s   @r   r<   r<   A   s*   ø… ÙFàÓØÓØÓØ
Ó÷
Lñ 
Lr   r<   c                  ó&   ‡ — e Zd Zddœdˆ fd„Zˆ xZS )ÚAPIConnectionErrorzConnection error.r5   c               ó*   •— t         ‰| �  ||d ¬«       y )Nr7   ©r%   r&   )r'   r   r!   r(   s      €r   r&   zAPIConnectionError.__init__W   s   ø€ Ü‰Ñ˜ '°ÐÕ5r   )r   r   r!   r    r)   r*   ©r   r   r   r&   r-   r.   s   @r   rE   rE   V   s   ø„ Ø)<÷ 6ó 6r   rE   c                  ó    ‡ — e Zd Zdˆ fd„Zˆ xZS )ÚAPITimeoutErrorc                ó(   •— t         ‰| �  d|¬«       y )NzÃRequest 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!   rG   )r'   r!   r(   s     €r   r&   zAPITimeoutError.__init__\   s   ø€ Ü‰Ñð ZØð 	õ 	
r   )r!   r    r)   r*   rH   r.   s   @r   rJ   rJ   [   s   ø„ ÷
ñ 
r   rJ   c                  ó   — e Zd ZdZy)ÚRetryableErrora  An error that opts into the SDK's retry policy: raise it (e.g. from
    middleware) to have the request attempt retried.

    The request is only retried while `max_retries` has not been exhausted;
    once exhausted the error propagates to the caller as-is.
    N)r   r   r   rC   r   r   r   rM   rM   c   s   „ òr   rM   c                  ó   — e Zd ZU dZded<   y)r
   i�  zLiteral[400]r4   N©r   r   r   r4   r,   r   r   r   r
   r
   l   ó   … Ø #€K�Ô#r   r
   c                  ó   — e Zd ZU dZded<   y)r   i‘  zLiteral[401]r4   NrO   r   r   r   r   r   p   rP   r   r   c                  ó   — e Zd ZU dZded<   y)r   i“  zLiteral[403]r4   NrO   r   r   r   r   r   t   rP   r   r   c                  ó   — e Zd ZU dZded<   y)r   i”  zLiteral[404]r4   NrO   r   r   r   r   r   x   rP   r   r   c                  ó   — e Zd ZU dZded<   y)r   i™  zLiteral[409]r4   NrO   r   r   r   r   r   |   rP   r   r   c                  ó   — e Zd ZU dZded<   y)ÚRequestTooLargeErrori�  zLiteral[413]r4   NrO   r   r   r   rV   rV   €   rP   r   rV   c                  ó   — e Zd ZU dZded<   y)r   i¦  zLiteral[422]r4   NrO   r   r   r   r   r   „   rP   r   r   c                  ó   — e Zd ZU dZded<   y)r   i­  zLiteral[429]r4   NrO   r   r   r   r   r   ˆ   rP   r   r   c                  ó   — e Zd ZU dZded<   y)ÚServiceUnavailableErrori÷  zLiteral[503]r4   NrO   r   r   r   rZ   rZ   Œ   rP   r   rZ   c                  ó   — e Zd ZU dZded<   y)ÚOverloadedErrori  zLiteral[529]r4   NrO   r   r   r   r\   r\   �   rP   r   r\   c                  ó   — e Zd ZU dZded<   y)ÚDeadlineExceededErroriø  zLiteral[504]r4   NrO   r   r   r   r^   r^   ”   rP   r   r^   c                  ó   — e Zd Zy)r   Nr   r   r   r   r   r   ˜   r   r   r   )"Ú
__future__r   Útypingr   r   Útyping_extensionsr   ÚhttpxÚ_utilsr   Útypes.shared.error_typer	   Ú__all__Ú	Exceptionr   r   r0   r:   r<   rE   rJ   rM   r
   r   r   r   r   rV   r   r   rZ   r\   r^   r   r   r   r   Ú<module>rh      s  ðõ #ç Ý %ã å Ý .ò	€ô	�Yô 	ôˆ~ô ô,0 ô 0ô	 ô 	ôL�Xô Lô*6˜ô 6ô

Ð(ô 
ô�^ô ô$�nô $ô$˜.ô $ô$˜Nô $ô$�Nô $ô$�Nô $ô$˜>ô $ô$˜~ô $ô$�^ô $ô$˜nô $ô$�nô $ô$˜Nô $ô	˜.õ 	r   