
    h                       S SK Jr  S SKJrJrJrJr  S SKJr  S SK	r	SSK
Jr  SSKJr  \(       a  SSKJr  / S	Q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\5      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%\5      r " S& S'\5      r  " S( S)\5      r!g)*    )annotations)TYPE_CHECKINGAnyOptionalcast)LiteralN   )is_dict)construct_type)ChatCompletion)
BadRequestErrorAuthenticationErrorPermissionDeniedErrorNotFoundErrorConflictErrorUnprocessableEntityErrorRateLimitErrorInternalServerErrorLengthFinishReasonErrorContentFilterFinishReasonErrorc                      \ rS rSrSrg)OpenAIError    N__name__
__module____qualname____firstlineno____static_attributes__r       D/var/www/html/env/lib/python3.13/site-packages/openai/_exceptions.pyr   r          r!   r   c                  t   ^  \ rS rSr% S\S'   S\S'   S\S'    SrS	\S
'   SrS	\S'   S	\S'   SU 4S jjrSrU =r	$ )APIError"   strmessagehttpx.Requestrequestobject | NonebodyNzOptional[str]codeparamtypec          	       > [         TU ]  U5        X l        Xl        X0l        [        U5      (       a  [        [        [        [        [           UR                  S5      S95      U l        [        [        [        [        [           UR                  S5      S95      U l        [        [        [        [        UR                  S5      S95      U l        g S U l        S U l        S U l        g )Nr-   )type_valuer.   r/   )super__init__r*   r(   r,   r
   r   r   r   r   r'   getr-   r.   r/   )selfr(   r*   r,   	__class__s       r"   r4   APIError.__init__5   s    !	4==S.x}DHHU[L\"]^DIc>TXXV]M^#_`DJS.s$((6BR"STDIDIDJDIr!   )r,   r-   r(   r.   r*   r/   )r(   r'   r*   r)   r,   r+   returnNone)
r   r   r   r   __annotations__r-   r.   r4   r    __classcell__r7   s   @r"   r%   r%   "   s?    L
 D-E=
 r!   r%   c                  J   ^  \ rS rSr% S\S'   S\S'   SS.S
U 4S jjjrS	rU =r$ )APIResponseValidationErrorE   httpx.Responseresponseintstatus_codeNr(   c               x   > [         TU ]  U=(       d    SUR                  US9  Xl        UR                  U l        g )Nz1Data returned by API invalid for expected schema.r,   )r3   r4   r*   rB   rD   )r6   rB   r,   r(   r7   s       r"   r4   #APIResponseValidationError.__init__I   s8    W$WYaYiYiptu #//r!   )rB   rD   )rB   rA   r,   r+   r(   
str | Noner9   r:   r   r   r   r   r;   r4   r    r<   r=   s   @r"   r?   r?   E   s!    _c 0 0 0r!   r?   c                  P   ^  \ rS rSr% SrS\S'   S\S'   S\S'   SU 4S	 jjrS
rU =r$ )APIStatusErrorO   z<Raised when an API response has a status code of 4xx or 5xx.rA   rB   rC   rD   rI   
request_idc                  > [         TU ]  XR                  US9  X l        UR                  U l        UR
                  R                  S5      U l        g )NrG   zx-request-id)r3   r4   r*   rB   rD   headersr5   rN   )r6   r(   rB   r,   r7   s       r"   r4   APIStatusError.__init__V   sF    "2"2> #//"**..~>r!   )rN   rB   rD   )r(   r'   rB   rA   r,   r+   r9   r:   )	r   r   r   r   __doc__r;   r4   r    r<   r=   s   @r"   rL   rL   O   s"    F? ?r!   rL   c                  4   ^  \ rS rSrSS.SU 4S jjjrSrU =r$ )APIConnectionError]   zConnection error.rE   c               "   > [         TU ]  XS S9  g )NrG   r3   r4   )r6   r(   r*   r7   s      r"   r4   APIConnectionError.__init__^   s    5r!   r   )r(   r'   r*   r)   r9   r:   r   r   r   r   r4   r    r<   r=   s   @r"   rT   rT   ]   s    )< 6 6 6r!   rT   c                  ,   ^  \ rS rSrSU 4S jjrSrU =r$ )APITimeoutErrorb   c                "   > [         TU ]  SUS9  g )NzRequest timed out.)r(   r*   rW   )r6   r*   r7   s     r"   r4   APITimeoutError.__init__c   s    !5wGr!   r   )r*   r)   r9   r:   rY   r=   s   @r"   r[   r[   b   s    H Hr!   r[   c                  $    \ rS rSr% SrS\S'   Srg)r   g   i  zLiteral[400]rD   r   Nr   r   r   r   rD   r;   r    r   r!   r"   r   r   g        #K#r!   r   c                  $    \ rS rSr% SrS\S'   Srg)r   k   i  zLiteral[401]rD   r   Nra   r   r!   r"   r   r   k   rb   r!   r   c                  $    \ rS rSr% SrS\S'   Srg)r   o   i  zLiteral[403]rD   r   Nra   r   r!   r"   r   r   o   rb   r!   r   c                  $    \ rS rSr% SrS\S'   Srg)r   s   i  zLiteral[404]rD   r   Nra   r   r!   r"   r   r   s   rb   r!   r   c                  $    \ rS rSr% SrS\S'   Srg)r   w   i  zLiteral[409]rD   r   Nra   r   r!   r"   r   r   w   rb   r!   r   c                  $    \ rS rSr% SrS\S'   Srg)r   {   i  zLiteral[422]rD   r   Nra   r   r!   r"   r   r   {   rb   r!   r   c                  $    \ rS rSr% SrS\S'   Srg)r      i  zLiteral[429]rD   r   Nra   r   r!   r"   r   r      rb   r!   r   c                      \ rS rSrSrg)r      r   Nr   r   r!   r"   r   r      r#   r!   r   c                  :   ^  \ rS rSr% S\S'    SU 4S jjrSrU =r$ )r      r   
completionc               z   > SnUR                   (       a  USUR                    3-  n[        TU ]	  U5        Xl        g )Nz@Could not parse response content as the length limit was reachedz - )usager3   r4   rs   )r6   rs   msgr7   s      r"   r4    LengthFinishReasonError.__init__   s;    PS))*++C$r!   )rs   )rs   r   r9   r:   rJ   r=   s   @r"   r   r      s    % %r!   r   c                  ,   ^  \ rS rSrSU 4S jjrSrU =r$ )r      c                $   > [         TU ]  S5        g )NzRCould not parse response content as the request was rejected by the content filterrW   )r6   r7   s    r"   r4   'ContentFilterFinishReasonError.__init__   s    `	
r!   r   )r9   r:   rY   r=   s   @r"   r   r      s    
 
r!   r   )"
__future__r   typingr   r   r   r   typing_extensionsr   httpx_utilsr
   _modelsr   
types.chatr   __all__	Exceptionr   r%   r?   rL   rT   r[   r   r   r   r   r   r   r   r   r   r   r   r!   r"   <module>r      s    # 5 5 %   #*	) 	 {  F0 0?X ?6 6
H( H
$n $$. $$N $$N $$N $$~ $$^ $	. 	%k %"
[ 
r!   