+
    ik!                         R t ^ RIHtHtHtHtHt ^ RIt^ RIt^ RI	t	^RI
Ht ]'       d   ^RIHt ^ RIt ! R R]4      t ! R R]4      t ! R	 R
]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t]P0                  tR# )z Error classes for the GenAI SDK.)AnyCallableOptionalTYPE_CHECKINGUnionN)_common)ReplayResponsec                   @  a a ] tR t^t oRtRtRtRV3R lV 3R llltV3R lR lt]	V3R lR l4       t
V3R	 lR
 ltV3R lR ltV3R lR ltV3R lR lt]V3R lR l4       t]V3R lR l4       t]V3R lR l4       t]V3R lR l4       tV3R ltRtVtV ;t# )APIErrorz'General errors raised by the GenAI API.Nc          
      f   < V ^8  d   QhRS[ RS[RS[S[RS[P
                  R3,          ,          /# )   coderesponse_jsonresponser   aiohttp.ClientResponseintr   r   r   httpxResponse)format__classdict__s   "f/Users/igloo/.openclaw/workspace/scratch/fb_ad_env/lib/python3.14/site-packages/google/genai/errors.py__annotate__APIError.__annotate__&   sH     C CC C 
 %..2JJ
K	C    c                  < \        V\        4      '       d   \        V4      ^8X  d
   V^ ,          pW0n        W n        V P                  V4      V n        V P                  V4      V n        V'       d   TMV P                  V4      V n
        \        SV `1  V P                   RV P                   RV P                   24       R# )    . N)
isinstancelistlenr   details_get_messagemessage_get_statusstatus	_get_coder   super__init__)selfr   r   r   	__class__s   &&&&r   r)   APIError.__init__&   s     -&&3}+=+B#A&mM L$$]3DL""=1DK$.."?DI	G		{!DKK=4<<.ABr   c                j   < V ^8  d   QhRS[ S[R,          S[ S[S[S[3,          ,          3,          /# )r   return).r
   )tupler   dictstrr   )r   r   s   "r   r   r   9   s1     / /Xo&d38n(==>/r   c                h    V P                   P                  4       pV P                  P                  V33# )zGReturns a tuple that can be used to reconstruct the error for pickling.)__dict__copyr+   _rebuild)r*   states   & r   
__reduce__APIError.__reduce__9   s-     MM ENN##eX..r   c                :   < V ^8  d   QhRS[ S[S[3,          RR/# )r   r6   r.   r
   )r0   r1   r   )r   r   s   "r   r   r   A   s#      d38n  r   c                    \         P                  \         4      pVP                  P                  V 4       \        P                  WP                   RVP                   RVP                   24       V# )z"Rebuilds the error from the state.r   r   )	r
   __new__r3   update	Exceptionr)   r   r&   r"   )r6   objs   & r   r5   APIError._rebuild@   sV     

8
$CLLsxxj#**R}EFJr   c                &   < V ^8  d   QhRS[ RS[ /# r   r   r.   r   )r   r   s   "r   r   r   H   s     	 	s 	s 	r   c                     VP                  R VP                  R/ 4      P                  R R4      4      pV#   \         d     R# i ; i)r&   errorNgetAttributeError)r*   r   r&   s   && r   r%   APIError._get_statusH   sQ      
M%%gr266xFf m     36 AAc                &   < V ^8  d   QhRS[ RS[ /# rA   rB   )r   r   s   "r   r   r   S   s     	 	 	 	r   c                     VP                  R VP                  R/ 4      P                  R R4      4      pV#   \         d     R# i ; i)r$   rD   NrE   )r*   r   r$   s   && r   r#   APIError._get_messageS   sQ    !!
]&&w377	4Hg n  rI   c                &   < V ^8  d   QhRS[ RS[ /# rA   rB   )r   r   s   "r   r   r   ^   s      S S r   c                f    VP                  R VP                  R/ 4      P                  R R4      4      # )r   rD   N)rF   )r*   r   s   &&r   r'   APIError._get_code^   s4    !!'2.2264@ r   c                4   < V ^8  d   QhRS[ P                  /# )r   r.   )r   
StringDict)r   r   s   "r   r   r   c   s      !3!3 r   c                R    RRV P                   RV P                  RV P                  //# )zReturns a dictionary representation of the error for replay recording.

details is not included since it may expose internal information in the
replay file.
rD   r   r$   r&   )r   r$   r&   )r*   s   &r   _to_replay_recordAPIError._to_replay_recordc   s1     	DIIt||dkk
 r   c                L   < V ^8  d   QhRS[ RS[P                  3,          RR/# )r   r   r   r.   Nr   r   r   )r   r   s   "r   r   r   r   s0     C C+U^^;<CCr   c                   VP                   ^8X  d   R# \        V\        P                  4      '       d#    VP	                  4        VP                  4       pM#VP                  ^ ,          P                  R/ 4      pV P                  VP                   W!4       R#   \
        P                  P                   d     TP                  pRTRTP                  /p L[i ; i)PRaises an error with detailed error message if the response has an error status.Nr$   r&   rD   )status_coder   r   r   readjsondecoderJSONDecodeErrortextreason_phrasebody_segmentsrF   raise_error)clsr   r   r$   s   &&  r   raise_for_responseAPIError.raise_for_responseq   s    
 s"(ENN++
  ,,Q/33GR@mOOH((-B \\)) 
--wh,,

s    B ;CCc          
      j   < V ^8  d   QhRS[ RS[RS[S[RS[P
                  R3,          ,          RR/# r   rY   r   r   r   r   r.   Nr   )r   r   s   "r   r   r      sM     6 66 6 
 %..2JJ
K	6 6r   c                    RTu;8:  d   R8  d   M M\        WV4      hRTu;8:  d   R8  d   M M\        WV4      hV ! WV4      ha  Raises an appropriate APIError subclass based on the status code.

Args:
  status_code: The HTTP status code of the response.
  response_json: The JSON body of the response, or a dict containing error
    details.
  response: The original response object.

Raises:
  ClientError: If the status code is in the 4xx range.
  ServerError: If the status code is in the 5xx range.
  APIError: For other error status codes.
i  i  iX  ClientErrorServerErrorrb   rY   r   r   s   &&&&r   ra   APIError.raise_error   sE    , kCH==		!c	!H==H55r   c                N   < V ^8  d   QhRS[ RS[P                  R3,          RR/# )r   r   r   r   r.   NrV   )r   r   s   "r   r   r      s7     2F 2F
ENN,D
D2F
 2Fr   c                <  "   ^ pRp\        V\        P                  4      '       dJ   VP                  ^8X  d   R#  VP	                  4       G Rj  xL
  VP                  4       pVP                  pM\        VR4      '       dV   \        VR4      '       dD   VP                  ^8X  d   R# VP                  ^ ,          P                  R/ 4      pVP                  pMp ^ RIp\        WP                  4      '       d:   VP                  ^8X  d   R#  VP                  4       G Rj  xL
 pVP                  pM\'        R\)        V4       24      hV P-                  W#V4      G Rj  xL
  R#  EL  \
        P                  P                   d!    TP                  pRTRTP                  /p ELAi ; i L  TP                   P"                   d-    TP                  4       G Rj  xL 
 pRTRTP$                  /p Li ; i  \*         d    \'        R\)        T4       24      hi ; i L5i)rX   Nr$   r&   r`   rY   rD   zUnsupported response type: )r   r   r   rY   areadr[   r\   r]   r^   r_   hasattrr`   rF   aiohttpClientResponser&   client_exceptionsContentTypeErrorreason
ValueErrortypeImportErrorraise_error_async)rb   r   rY   r   r$   rr   s   &&    r   raise_for_async_response!APIError.raise_for_async_response   s     KM(ENN++				$
nn  ((k	?	+	+-1 1 
			$,,Q/33GR@m((kIh 6 677__#"*--/1M !+8h8HIJ
J 

H
EEEK 	\\)) 
--wh,,

, 2**;; $MMO++G7(//M  I6tH~6FGHHI Fs   8HE& E#E& #A4H0G4 HF* F(F* #G4 /H0G4 HHH#E& &;F%!H$F%%H(F* *.G1GG1.G4 0G11G4 4#HHc          
      j   < V ^8  d   QhRS[ RS[RS[S[RS[P
                  R3,          ,          RR/# rf   r   )r   r   s   "r   r   r      sI     6 66,/6;C
 %..2JJ
K<6 	6r   c                   "   RTu;8:  d   R8  d   M M\        WV4      hRTu;8:  d   R8  d   M M\        WV4      hV ! WV4      h5irh   ri   rl   s   &&&&r   rz   APIError.raise_error_async   sH     & kCH==		!c	!H==H55s   AAc                   < V ^8  d   Qh/ S[ ;R&   S[RS[P                  R3,          ;R&   S[S[,          ;R&   S[S[,          ;R&   # )r   r   r   r   r   r&   r$   )r   r   r   r   r   r1   )r   r   s   "r   r   r      sP     )  "ENN4LLMM 
 3-  C= r   )r   r"   r$   r   r&   )N)__name__
__module____qualname____firstlineno____doc__r&   r$   r)   r7   staticmethodr5   r%   r#   r'   rS   classmethodrc   ra   r{   rz   __annotate_func____static_attributes____classdictcell____classcell__)r+   r   s   @@r   r
   r
      s     / &'C C&/ /  	 		 	 
  C C, 6 68 2F 2Fh 6 6{  r   r
   c                       ] tR t^tRtRtR# )rj   z%Client error raised by the GenAI API. Nr   r   r   r   r   r   r   r   r   rj   rj          -r   rj   c                       ] tR t^tRtRtR# )rk   z%Server error raised by the GenAI API.r   Nr   r   r   r   rk   rk      r   r   rk   c                       ] tR t^tRtRtR# ) UnknownFunctionCallArgumentErrorzWRaised when the function call argument cannot be converted to the parameter annotation.r   Nr   r   r   r   r   r      s    _r   r   c                       ] tR tRtRtRtR# )UnsupportedFunctionErrori  z*Raised when the function is not supported.r   Nr   r   r   r   r   r     s    2r   r   c                       ] tR tRtRtRtR# )FunctionInvocationErrori	  zDRaised when the function cannot be invoked with the given arguments.r   Nr   r   r   r   r   r   	  s    Lr   r   c                       ] tR tRtRtRtR# )UnknownApiResponseErrori  z?Raised when the response from the API cannot be parsed as JSON.r   Nr   r   r   r   r   r     s    Gr   r   )r   typingr   r   r   r   r   r   r[   
websockets r   replay_api_clientr   rr   r=   r
   rj   rk   rw   r   r   r   r   ExperimentalWarningr   r   r   <module>r      s     ' @ @     /T6y T6n( 
( 
z 
z 
j 
j  11 r   