+
    iI                       a Rv tl0 t R t^ RIt^ RIHtHt ^ RIHtHt ^ RI	t	^ RI
t
^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHtHtHtHtHtHt ^RIHt ^RIHt ^RIHt ]P<                  '       d   ^ RIt ^ RI!t!^RI"H#t# ^R	I"Ht ^R
I"Ht ]PH                  ! R4      t%]PL                  Rw8  d,   ]PN                  t(]P.                  ]PN                  3t)^ RIH*t* M]PV                  t(]P.                  3t)^ RI,H*t* ]P<                  '       d   ^ RI-H.t/ ^ RI0H1t2 M]t/] ^ k ]t2] ^k  ^ RI-H.t/ ^ RI0H1t2 RRRRRR/t4]4Pk                  4        U Uu/ uF  w  rWbK	  	  upp t6R^/R R llt7R R lt8R R lt9R R lt:R R lt;R  R! lt<R" R# lt=R$ R% lt>R& R' lt?R( R) lt@R* R+ ltAR, R- ltBR. R/ ltCR0 R1 ltDR2 R3 ltE]]P                  ]P                  ]P                  3,          tIR4 R5 ltJR6 R7 ltKR8 R9 ltLR: R; ltMR< R= ltNR> R? ltORxR@RA/RB RC llltPRD RE ltQRF RG ltRRH RI ltSRJ RK ltTRL RM ltURN RO ltVRP RQ ltWRR RS ltXRT RU ltYRV RW ltZRX RY lt[RZ R[ lt\R\ R] lt]R^ R_ lt^R`t_Rat`RbtaRctbRd Re ltcRf Rg ltdRh Ri lteRj Rk ltfRl Rm ltgRyRn Ro llthRp Rq ltiRr Rs ltjRt Ru ltkR#   ]3 d	    Rt/Rt2 ELi ; iu upp i )zz"Transformers for Google GenAI SDK.N)IterableMapping)EnumEnumMeta)AnyGenericAliasListOptionalSequenceUnion)mcp_to_gemini_tool)get_value_by_path)is_duck_type_of)_api_client)_common)typeszgoogle_genai._transformers)	TypeGuard)ClientSession)Toolexact_matchexactMatchSpecbleubleuSpec
rouge_spec	rougeSpeccollection_hierarchy_depthc          
      h    V ^8  d   QhR\         P                  R\        R\        R\        R\        /# )   clientresource_namecollection_identifierr   return)r   BaseApiClientstrint)formats   "m/Users/igloo/.openclaw/workspace/scratch/fb_ad_env/lib/python3.14/site-packages/google/genai/_transformers.py__annotate__r'   L   sG     Z Z%%ZZ 	Z
 !$Z 	Z    c                  VP                  V R24      '       * ;'       d!    V RV 2P                  R4      ^,           V8H  pV P                  '       d   VP                  R4      '       d   V# VP                  R4      '       d   RV P                   RV 2# VP                  V R24      '       d    RV P                   RV P                   RV 2# V'       d#   RV P                   RV P                   RV RV 2# V# V'       d   V RV 2# V# )a  Prepends resource name with project, location, collection_identifier if needed.

The collection_identifier will only be prepended if it's not present
and the prepending won't violate the collection hierarchy depth.
When the prepending condition doesn't meet, returns the input
resource_name.

Args:
  client: The API client.
  resource_name: The user input resource name to be completed.
  collection_identifier: The collection identifier to be prepended. See
    collection identifiers in https://google.aip.dev/122.
  collection_hierarchy_depth: The collection hierarchy depth. Only set this
    field when the resource has nested collections. For example,
    `users/vhugo1802/events/birthday-dinner-226`, the collection_identifier is
    `users` and collection_hierarchy_depth is 4. See nested collections in
    https://google.aip.dev/122.

Example:

  resource_name = 'cachedContents/123'
  client.vertexai = True
  client.project = 'bar'
  client.location = 'us-west1'
  _resource_name(client, 'cachedContents/123',
    collection_identifier='cachedContents')
  returns: 'projects/bar/locations/us-west1/cachedContents/123'

Example:

  resource_name = 'projects/foo/locations/us-central1/cachedContents/123'
  # resource_name = 'locations/us-central1/cachedContents/123'
  client.vertexai = True
  client.project = 'bar'
  client.location = 'us-west1'
  _resource_name(client, resource_name,
    collection_identifier='cachedContents')
  returns: 'projects/foo/locations/us-central1/cachedContents/123'

Example:

  resource_name = '123'
  # resource_name = 'cachedContents/123'
  client.vertexai = False
  _resource_name(client, resource_name,
    collection_identifier='cachedContents')
  returns 'cachedContents/123'

Example:
  resource_name = 'some/wrong/cachedContents/resource/name/123'
  resource_prefix = 'cachedContents'
  client.vertexai = False
  # client.vertexai = True
  _resource_name(client, resource_name,
    collection_identifier='cachedContents')
  returns: 'some/wrong/cachedContents/resource/name/123'

Returns:
  The completed resource name.
/	projects/z
locations//locations/)
startswithcountvertexaiprojectlocation)r   r   r    r   $should_prepend_collection_identifiers   &&$$ r&   _resource_namer3   L   s1   J 
"
"&;%<A#>
?? $ $ ##1]O
4
:
:3
?!
C	#$	 ' ___,,		!	!,	/	/(-99		!	!%:$;1"=	>	>(FOO3DAm_UU	-(FOO3DAF[E\\]^k]lmm+%&a77r(   c                P    V ^8  d   QhR\         P                  R\        R\        /# )r   r   modelr!   r   r"   r#   )r%   s   "r&   r'   r'      s'      K-- c c r(   c                    V'       g   \        R 4      hRV9   g   RV9   g   RV9   d   \        R4      hV P                  '       dp   VP                  R4      '       g/   VP                  R4      '       g   VP                  R4      '       d   V# RV9   d   VP                  R^4      w  r#RV R	V 2# R
V 2# VP                  R4      '       d   V# VP                  R4      '       d   V# RV 2# )zmodel is required.z..?&zinvalid model parameter.r+   models/publishers/r*   z/models/zpublishers/google/models/ztunedModels/)
ValueErrorr/   r-   split)r   r5   	publishermodel_ids   &&  r&   t_modelr@      s    	
)
**	U]cUlcUl
/
00___%%I&&M**l	!KKQ/i9+XhZ88(00	""l			.	)	)lugr(   c                P    V ^8  d   QhR\         P                  R\        R\        /# )r   
api_clientbase_modelsr!   )r   r"   boolr#   )r%   s   "r&   r'   r'      s*      ))8<r(   c                 V    V P                   '       d   V'       d   R # R# V'       d   R# R# )zpublishers/google/modelsmodelstunedModels)r/   )rB   rC   s   &&r&   t_models_urlrH      s"     'r(   c                n    V ^8  d   QhR\         P                  R\        \         P                  ,          /# )r   responser!   )r   
StringDictlist)r%   s   "r&   r'   r'      s-        	'

r(   c                 J   V '       g   . # V P                  R 4      pVe   V# V P                  R4      pVe   V# V P                  R4      pVe   V# V P                  R4      e   V P                  R4      f   . # \        P                  R4       \        P                  RV 4       . # )rF   rG   publisherModelshttpHeadersjsonPayloadz!Cannot determine the models type.z1Cannot determine the models type for response: %s)getloggerwarningdebug)rJ   rF   tuned_modelspublisher_modelss   &   r&   t_extract_modelsrW      s     
I/7||H/E&M5=\\-5P,9A: ! ll=!-
,,}
%
-I
NN67
LLDhOIr(   c                f    V ^8  d   QhR\         P                  R\        R\        \        ,          /# )r   rB   r5   r!   )r   r"   r#   r	   )r%   s   "r&   r'   r'      s.      ))25c]r(   c                 P   \        W4      pV'       g   R # VP                  R4      '       d2   V P                  '       d    RV P                   RV P                   RV 2# VP                  R4      '       d2   V P                  '       d    RV P                   RV P                   RV 2# V# )Nr;   r+   r,   r*   r:   z/publishers/google/)r@   r-   r/   r0   r1   )rB   r5   s   &&r&   t_caches_modelrZ      s     *
$%	
m$$)<)<)< J&&'{:3F3F2GqP 	""z':':':z))*+j6I6I5JJ]^c]deeLr(   c                D    V ^8  d   QhR\         R\        P                  /# )r   imager!   )r   r   Blob)r%   s   "r&   r'   r'     s     ; ;s ;uzz ;r(   c                 p   R p\        4       pV P                  R8X  d9   \        V RR4      '       d&   V P                  R9   d   RpVP	                  RR7       \
        P                  ! 4       pV P                  ! W13/ VB  VP                  4       pRVP                  4        2p\        P                  ! WER7      # )	PNGJPEGfilename keep)qualityimage/)data	mime_type)1LRGBRGBXCMYK)dictr%   getattrmodeupdateioBytesIOsavegetvaluelowerr   r]   )r\   image_formatsave_paramsimage_ioimage_bytesrg   s   &     r&   pil_to_blobrz     s    , $+llf
%R
(
(
**9
9Lv&ZZ\(**X3{3!!#+|))+,-)		::r(   c                X    V ^8  d   QhR\         P                  R\         P                  /# )r   function_responser!   )r   FunctionResponseOrDictFunctionResponse)r%   s   "r&   r'   r'     s(      33
r(   c                    V '       g   \        R 4      h\        V \        4      '       d    \        P                  P                  V 4      # \        V \        P                  4      '       d   V # \        R\        V 4       24      h)zfunction_response is required.zOCould not parse input as FunctionResponse. Unsupported function_response type: )	r<   
isinstancerm   r   r~   model_validater   	TypeErrortype)r|   s   &r&   t_function_responser     sv     

5
66!4((!!001BCC(%*@*@AA
	$$():$;#<	> r(   c                    V ^8  d   QhR\         \        P                  \        \        P                  ,          3,          R\        \        P
                  ,          /# )r   function_responsesr!   )r   r   r}   r
   rL   r~   )r%   s   "r&   r'   r'   %  sJ     5 5$$--.	05
 
%
 
 !5r(   c                     V '       g   \        R 4      h\        V \        4      '       d   V  Uu. uF  p\        V4      NK  	  up# \        V 4      .# u upi )z function_responses are required.)r<   r   r
   r   )r   rJ   s   & r&   t_function_responsesr   %  sS     

7
88"H--:LM:Lh):LMM 2344 Ns   Ac                    V ^8  d   QhR\         \        P                  \        \        P                  ,          3,          R\        \        P                  ,          /# )r   blobsr!   )r   r   BlobImageUnionDictrL   r]   )r%   s   "r&   r'   r'   3  s@      ))40H0H+IIJ	%**r(   c                     \        V \        4      '       d   V  Uu. uF  p\        V4      NK  	  up# \        V 4      .# u upi N)r   rL   t_blob)r   blobs   & r&   t_blobsr   3  s;     t%*+UTF4LU++5M? ,   >c                X    V ^8  d   QhR\         P                  R\         P                  /# r   r   r!   r   r   r]   )r%   s   "r&   r'   r'   <  s$      )) ejj r(   c                    V '       g   \        R 4      h\        V \        P                  4      '       d   V # \	        V \
        4      '       d    \        P                  P                  V 4      # RV P                  P                  P                  4       9   d<    ^ RI
pVP                  P                  pVe   \	        W4      '       d   \        V 4      # \        R\        V 4       24      h  \         d    Rp LFi ; i)zblob is required.r\   Nz6Could not parse input as Blob. Unsupported blob type: )r<   r   r   r]   r   rm   r   	__class____name__ru   	PIL.ImageImageImportErrorrz   r   r   )r   PIL	PIL_Images   &  r&   r   r   <  s    	
(
))T5::&&Kd::$$T**''--//))//i D!<!<>tDzlK	   is   C& &C65C6c                X    V ^8  d   QhR\         P                  R\         P                  /# r   r   )r%   s   "r&   r'   r'   V  s(     A Au// AEJJ Ar(   c                     \        V 4      p V P                  '       d$   V P                  P                  R 4      '       d   V # \        RV P                  : 24      h)re   Unsupported mime type: r   rg   r-   r<   r   s   &r&   t_image_blobr   V  E    	$	^^^11(;;K,T^^,>?@@r(   c                X    V ^8  d   QhR\         P                  R\         P                  /# r   )r   
BlobOrDictr]   )r%   s   "r&   r'   r'   ]  s(     A Au'' AEJJ Ar(   c                     \        V 4      p V P                  '       d$   V P                  P                  R 4      '       d   V # \        RV P                  : 24      h)zaudio/r   r   r   s   &r&   t_audio_blobr   ]  r   r(   c                n    V ^8  d   QhR\         \        P                  ,          R\        P                  /# r   partr!   )r	   r   PartUnionDictPart)r%   s   "r&   r'   r'   d  s-     C C%--. C5:: Cr(   c                    V f   \        R4      h\        V \        4      '       d   \        P                  ! V R7      # \        V \        P                  4      '       de   V P                  '       d   V P                  '       g   \        R4      h\        P                  P                  V P                  V P                  R7      # \        V \        4      '       d!    \        P                  P                  V 4      # \        V \        P                  4      '       d   V # RV P                  P                   P#                  4       9   dQ    ^ R IpVP&                  P&                  pVe2   \        W4      '       d!   \        P                  ! \+        V 4      R7      # \        R\-        V 4       24      h  \        P                   d8    \        P                  ! \        P                  P                  T 4      R7      u # i ; i  \(         d    R p Li ; i)	Nzcontent part is required.)textz$file uri and mime_type are required.)file_urirg   )	file_datar\   )inline_datazUnsupported content part type: )r<   r   r#   r   r   r   Fileurirg   from_urirm   r   pydanticValidationErrorFileDatar   r   ru   r   r   r   rz   r   r   r   r   s   &  r&   t_partr   d  sx   	\
0
11c::4  T5::&&8884>>>=>>::DNNKKdGZZ&&t,, T5::&&K''--//))//i D!<!<ZZK$5664T$ZLABB ## GZZ%.."?"?"EFFG  is%   F) G8 )A	G54G58HHc                   V ^8  d   QhR\         \        \        \        P                  ,          \        P                  \        \        P
                  ,          3,          ,          R\        \        P
                  ,          /# r   partsr!   )r	   r   rL   r   r   r   )r%   s   "r&   r'   r'     sU      d5&&')<)<d5::>NNO 
%**	r(   c                     V e   \        V \        4      '       d   V '       g   \        R4      h\        V \        4      '       d   V  Uu. uF  p\        V4      NK  	  up# \        V 4      .# u upi )Nzcontent parts are required.)r   rL   r<   r   )r   r   s   & r&   t_partsr     sZ     ]z%..u
2
33t%*+UTF4LU++5M? ,s   A+c                    V ^8  d   QhR\         \        \        \        \        3,          ,          ,          R\         \
        \        P                  ,          ,          /# )r   predictionsr!   )r	   r   r   r#   r   rL   r   GeneratedImage)r%   s   "r&   r'   r'     s?      (738#456d5''()r(   c           
         V '       g   R # . pV  Ft  pVP                  R4      '       g   K  VP                  \        P                  ! \        P                  ! VR,          R,          VR,          R,          R7      R7      4       Kv  	  V# )Nr\   gcsUri
imageBytes)gcs_uriry   )r\   )rQ   appendr   r   r   )r   images
predictions   &  r&   t_image_predictionsr     so     
&j~~gmm


KK$W-h7(1,?   
-r(   c                |    V ^8  d   QhR\         \        \        P                  R3,          R\        P                  /# )r   contentNr!   )r   ContentTyper   ContentDictContent)r%   s   "r&   r'   r'     s2     * *; 1 1478*
]]*r(   c                    V f   \        R4      h\        V \        P                  4      '       d   V # \	        V \
        4      '       d!    \        P                  P                  V 4      # \        V \        P                  4      '       d"   \        P                  ! \        V 4      .R7      # \        V \        P                  4      '       dC   V P                  '       d   \        P                  ! V .R7      # \        P                  ! V .R7      # \        P                  ! V R7      #   \        P                   dQ    \        T 4      pTP                  '       d   \        P                  ! T.R7      M\        P                  ! T.R7      u # i ; i)Nzcontent is required.r   )r<   r   r   r   r   rm   r   r   r   r   function_callModelContentUserContentr   r   )r   possible_parts   & r&   	t_contentr     s2    _
+
,,Wemm,,N]]))'22 Wejj))F7O#455Wejj))     	'+ gY/
 
			)) ## Wom ((( 

M?
3  7s   	D" "A"FFc          	      2   V ^8  d   QhR\         P                  R\        \        \        P
                  ,          \        \        P                  ,          \        3,          R\        \        \        ,          \        \        P
                  ,          3,          /# )r   r   contentsr!   )	r   r"   r   rL   r   r   r   r   r#   )r%   s   "r&   r'   r'     sc        %% D'e.?.?)@+MN  49d5==))* r(   c                    \        V\        4      '       d   V Uu. uF  p\        V4      NK  	  ppM\        V4      .pV P                  '       d   . pV F  pVf   K	  \        V\        4      '       d    \
        P                  P                  V4      pVP                  f   KN  VP                   FG  pVP                  '       d   VP                  VP                  4       K2  \        P                  R4       KI  	  K  	  V# V# u upi )Nz/Non-text part found, only returning text parts.)r   rL   r   r/   rm   r   r   r   r   r   r   rR   rS   )r   r   r   transformed_contents
text_partsr   s   &&    r&   t_contents_for_embedr     s     $>FGh7Ig.hG%h/0___J'		gt$$MM009'==$mmdyyy		*nnNP	 $ ( % Hs   Dc                    V ^8  d   QhR\         \        \        P                  \        P                  \        P
                  3,          ,          R\        \        P
                  ,          /# r   r   r!   )r	   r   r   ContentListUnionContentListUnionDictr   rL   )r%   s   "r&   r'   r'     sO     i ie$$e&@&@%--OPi 
%--	ir(   c                 .  aaa V e   \        V \        4      '       d   V '       g   \        R4      h\        V \        4      '       g   \        V 4      .# . p. pR R lpR R loR V3R lloR V3R	 lloR
 VVV3R llpV  EF  p\	        V\
        P                  4      '       g   \        V\        4      '       dZ   S! W4       \        V\        4      '       d)   VP                  \
        P                  ! VR7      4       K  VP                  V4       K  V! V4      '       d   V! WV4       K  \        V\        4      '       d1   VP                  \
        P                  P                  V4      4       K  \        R\        V4       24      h	  S! W4       V# )Nzcontents are required.c                    V ^8  d   QhR\         \        P                  \        3,          R\        \        P                  ,          /# r   )r   r   r   r   r   )r%   s   "r&   r'    t_contents.<locals>.__annotate__  s7     # #%%%s*+#$$%#r(   c                    \        V \        4      '       gA   \        V \        P                  4      '       g!   \        V \        P
                  4      '       d   R # \        V \        4      '       d-   V '       g   R#  \        P
                  P                  V 4       R # RV P                  P                  P                  4       9   d3    ^ RIpVP                  P                  pVe   \        W4      '       d   R # R#   \        P                   dB     \        P                  P                  T 4        R #   \        P                   d      R# i ; ii ; i  \          d    Rp Li ; i)TFr\   N)r   r#   r   r   r   r   rm   r   r   r   r   r   r   ru   r   r   r   r   s   &  r&   _is_partt_contents.<locals>._is_part  s    	44,,4,,$

!!$' $..))//11IIOO	 
	:d#>#>% %% 	
..
'
'
-'' 			  	s<   :C8 E 8ED00E
E	E

EE! E!c                D    V ^8  d   QhR\         P                  R\        /# r   )r   r   rD   )r%   s   "r&   r'   r     s     " "%** " "r(   c                 $    V P                   '       * # r   )r   )r   s   &r&   _is_user_part!t_contents.<locals>._is_user_part  s    !!!!r(   c                Z    V ^8  d   QhR\         \        P                  ,          R\        /# r   )rL   r   r   rD   )r%   s   "r&   r'   r     s#     6 6T%**- 6$ 6r(   c                 x   < \         ;QJ d    V3R  lV  4       F  '       d   K   R# 	  R# ! V3R  lV  4       4      # )c              3   4   <"   T F  pS! V4      x  K  	  R # 5ir    ).0r   r   s   & r&   	<genexpr>6t_contents.<locals>._are_user_parts.<locals>.<genexpr>  s     5ut}T""us   FT)all)r   r   s   &r&   _are_user_parts#t_contents.<locals>._are_user_parts  s,    35u53353535u555r(   c                    V ^8  d   QhR\         \        P                  ,          R\         \        P                  ,          RR/# )r   resultaccumulated_partsr!   N)rL   r   r   r   )r%   s   "r&   r'   r     s8      5==!ejj) r(   c                    < V'       g   R # T P                  S! V4      '       d   \        P                  ! VR7      M\        P                  ! VR7      4       . VR&   R # )Nr   NNN)r   r   r   r   )r   r   r   s   &&r&   $_append_accumulated_parts_as_content8t_contents.<locals>._append_accumulated_parts_as_content  sP     
MM,-- 	 12&78
 ar(   c                    V ^8  d   QhR\         \        P                  ,          R\         \        P                  ,          R\        P                  RR/# )r   r   r   current_partr!   N)rL   r   r   r   r   )r%   s   "r&   r'   r   !  sH     
, 
,5==!
,ejj)
, ''
, 	
,r(   c                    < \        V4      pS! V4      S! V4      8X  d   VP                  V4       R# S! W4       V.VR &   R# )r   N)r   r   )r   r   r   r   r   r   s   &&&r&   _handle_current_part(t_contents.<locals>._handle_current_part!  sE    
 ,'L\"o6G&HH|,*6E*^r(   r   zUnsupported content type: )r   rL   r<   r   r   r   r   r   r   rm   r   r   )	r   r   r   r   r   r   r   r   r   s	   &     @@@r&   
t_contentsr     s8   
 *Xt44X
-
..	Hd	#	#h   "&(*#J"6 6 
, 
,& gw..*Wd2K2K*6E	GT	"	"e''g67g	'		6g>	GT	"	"mmEMM009:3DM?CDD  'vA	-r(   c                <    V ^8  d   QhR\         P                  RR/# )r   schemar!   Nr   rK   )r%   s   "r&   r'   r'   H  s      8 8w11 8d 8r(   c                x   V P                  RR4      R8X  d   RV R&   V R R# RV 9   d   V R,           F  pRV9   g   K  VR,          R8X  g   K  RV R&   V R,          P                  RR/4       \        V R,          4      ^8X  g   KT  V R,          ^ ,          P                  4        F	  w  r#W0V&   K  	  V R K  	  R# R# )a  Process null fields in the schema so it is compatible with OpenAPI.

The OpenAPI spec does not support 'type: 'null' in the schema. This function
handles this case by adding 'nullable: True' to the null field and removing
the {'type': 'null'} entry.

https://swagger.io/docs/specification/v3_0/data-models/data-types/#null

Example of schema properties before and after handling null fields:
  Before:
    {
      "name": {
        "title": "Name",
        "type": "string"
      },
      "total_area_sq_mi": {
        "anyOf": [
          {
            "type": "integer"
          },
          {
            "type": "null"
          }
        ],
        "default": None,
        "title": "Total Area Sq Mi"
      }
    }

  After:
    {
      "name": {
        "title": "Name",
        "type": "string"
      },
      "total_area_sq_mi": {
        "type": "integer",
        "nullable": true,
        "default": None,
        "title": "Total Area Sq Mi"
      }
    }
r   NnullTnullableanyOf)rQ   removelenitems)r  itemkeyvals   &   r&   handle_null_fieldsr  H  s    X ZZ'F:v&w	4DLF2!zw/0vg1$ /!,224hc3K 5Wo   r(   c                (    V ^8  d   QhR\         RR/# )r   originr!   N)r   )r%   s   "r&   r'   r'     s     9 9s 9t 9r(   c                    \        RV  24      h)z2Raises an error if the schema type is unsupported.Unsupported schema type: )r<   r  s   &r&   "_raise_for_unsupported_schema_typer    s    .vh788r(   c                ^    V ^8  d   QhR\         R\        \        P                  ,          RR/# )r   r  r   r!   N)r   r	   r   r"   )r%   s   "r&   r'   r'     s4     Q QQ!+";";<Q	Qr(   c                     V'       dP   VP                   '       g<   V P                  R 4      '       g   V P                  R4      '       d   \        R4      hR# R# R# )additionalPropertiesadditional_propertiesz8additionalProperties is not supported in the Gemini API.N)r/   rQ   r<   )r  r   s   &&r&   '_raise_for_unsupported_mldev_propertiesr    sM     ooo
**+
,
,ZZ/00 O
PP 1  r(   order_propertiesTc          
          V ^8  d   QhR\         P                  R\        \        P                  ,          R\        \         P                  ,          R\
        RR/# )r   r  r   defsr  r!   N)r   rK   r	   r   r"   rD   )r%   s   "r&   r'   r'     sd     TH THTH[../TH 7%%
&TH
 TH 
THr(   c                 aaa V P                  R4      R8X  d   V R \        V S4       R F!  w  rEV P                  VR4      ;pf   K  W`V&   K#  	  Sf;   V P                  R	/ 4      oSP                  4        F  w  rx\	        VSSSR
7       K  	  \        V 4       V P                  RR4      ;p	e/   V P                  SV	P                  R4      R,          ,          4       R VVV3R llp
V P                  R4      ;pe   V Uu. uF
  q! V4      NK  	  upV R&   R# V P                  R4      p\        V\        4      '       d   VP                  p\        V\        4      '       d   VP                  4       pV P                  R4      pVe   VR8X  d   V.V R&   V R M\        R4      hVR8X  d   V P                  R4      ;pev   \        VP                  4       4       F  w  rV
! V4      W&   K  	  \        VP                  4       4      ^8  d,   S'       d$   RV 9  d   \        VP!                  4       4      V R&   V P                  R4      ;pe&   \        V\"        4      '       d   V
! V4      V R&   R# R# R# VR8X  dU   V P                  R4      ;pe   V
! V4      V R&   V P                  R4      ;pe   V Uu. uF  pV
! V4      NK  	  upV R&   R# R# R# u upi u upi )a  Updates the schema and each sub-schema inplace to be API-compatible.

- Inlines the $defs.

Example of a schema before and after (with mldev):
  Before:

  `schema`

  {
      'items': {
          '$ref': '#/$defs/CountryInfo'
      },
      'title': 'Placeholder',
      'type': 'array'
  }


  `defs`

  {
    'CountryInfo': {
      'properties': {
        'continent': {
            'title': 'Continent',
            'type': 'string'
        },
        'gdp': {
            'title': 'Gdp',
            'type': 'integer'}
        },
      }
      'required':['continent', 'gdp'],
      'title': 'CountryInfo',
      'type': 'object'
    }
  }

  After:

  `schema`
   {
      'items': {
        'properties': {
          'continent': {
            'title': 'Continent',
            'type': 'string'
          },
          'gdp': {
            'title': 'Gdp',
            'type': 'integer'
          },
        }
        'required':['continent', 'gdp'],
        'title': 'CountryInfo',
        'type': 'object'
      },
      'type': 'array'
  }
titlePlaceholderLiteralEnumr  r  prefixItemsproperty_orderingpropertyOrderingNz$defsr  $refdefs/c                X    V ^8  d   QhR\         P                  R\         P                  /# )r   
sub_schemar!   r  )r%   s   "r&   r'   $process_schema.<locals>.__annotate__  s&      7-- '2D2D r(   c                   < V P                  RR4      ;pe    SVP                  R4      R,          ,          p \        V SSSR7       V # )z@Returns the processed `sub_schema`, resolving its '$ref' if any.r$  Nr%  r#  )popr=   process_schema)r'  refr   r  r  s   & r&   _recurse process_schema.<locals>._recurse  sF    ~~fd++8		'*2./j:vt>NOr(   r   constSTRINGenumzLiteral values must be strings.OBJECT
propertiesARRAYr
  ))r  r  )any_ofr  )prefix_itemsr   )r!  r"  r*  )rQ   r  r+  r
  r,  r  rp   r=   r   r   valuer#   upperr<   rL   r	  keysrm   )r  r   r  r  	from_nameto_namer8  _r'  r-  r.  r6  schema_typer0  r4  name
additionalr
  prefixesprefixs   &ffd                r&   r,  r,    s   F ZZ44w)&&9
i It,,9Wo 
\::gr"D 
fd5E	 & V
 ZZ%%c2
MM$syy)"-./  

7##f0>DEf
x
+fEF7O


6"+T""##KS!!##%K **W
%
hwfVn
/899Hjj..
;":#3#3#56
$#J/
 7 j 
!A
% .&*:??+<&="#jj!788
E 
J	%	%)1*)=%& 
& F
 gG$$1 fWoJJ}--:>FGhFx/hGf] ; E FL Hs   K0Kc                z    V ^8  d   QhR\         R\        \        P                  ,          R\        P
                  /# )r   r2  r   r!   )r   r	   r   r"   r   Schema)r%   s   "r&   r'   r'   -  s3     2 2
2$[%>%>?2
\\2r(   c           	      l  a R pV  Fu  p\        VP                  \        4      '       d   RpK'  \        VP                  \        4      '       d   KI  \	        RVP
                   R\        VP                  4       24      h	  V oV'       dC   V  Uu. uF  p\        VP                  4      NK  	  pp\        V P                  V\        R7      pVo ! V3R lR\        P                  4      pVP                  4       p\        Wq4       VR,          R,          p\        P                  P                  V4      # u upi )	FTzEnum member z( value must be a string or integer, got )r   c                   0   <a  ] tR tRt o V V3R ltRtV tR# )"_process_enum.<locals>.PlaceholderiA  c                &   < V ^8  d   Qh/ SZ;R&   # r   placeholderr   )r%   __classdict__enum_to_processs   "r&   r'   /_process_enum.<locals>.Placeholder.__annotate__A  s        r(   r   Nr   
__module____qualname____firstlineno____annotate_func____static_attributes____classdictcell__)rK  rL  s   @r&   PlaceholderrG  A        r(   rU  r4  rJ  )r   r8  r$   r#   r   r?  r   r   r   r   	BaseModelmodel_json_schemar,  r   rD  r   )	r2  r   is_integer_enummemberstr_membersstr_enumrU  enum_schemarL  s	   &&      @r&   _process_enumr^  -  s     /f&,,$$oc** &6<< !# 	  /37843v||$4K8DMM;S9HO!H&& ! --/+%L)-8+		$	$[	11 9s   D1c                    V ^8  d   QhR\         \        P                  \        3,          R\        \
        P                  ,          /# r   r  r!   )r   r   SchemaUnionDictr   r   r   rK   )r%   s   "r&   r'   r'   J  s7      %'',-w!!"r(   c                    \        V \        4      ;'       d5    \        ;QJ d    R V  4       F  '       d   K   R# 	  R# ! R V  4       4      # )zEVerifies the schema is of type dict[str, Any] for mypy type checking.c              3   B   "   T F  p\        V\        4      x  K  	  R # 5ir   )r   r#   )r   r  s   & r&   r   (_is_type_dict_str_any.<locals>.<genexpr>N  s      *&,sjcfs   FT)r   rm   r   r  s   &r&   _is_type_dict_str_anyre  J  sR     
FD	! 
 
cc *&,*cc c c *&,* ' r(   c                    V ^8  d   QhR\         \        P                  ,          R\        \        P
                  \        3,          R\         \        P                  ,          /# r   r   r  r!   )r	   r   r"   r   r   ra  r   rD  )r%   s   "r&   r'   r'   S  sJ     -9 -9[../-9%'',--9 ell-9r(   c                   a S'       g   R # \        S\        4      '       d=   \        S4      '       d,   \        SV 4       \        P
                  P                  S4      # \        S\        4      '       d   \        SV 4      # \        S\        P
                  4      '       dt   \        S4      \        \        P
                  ! 4       4      8X  d   \        S4       SP                  RR7      p\        W 4       \        P
                  P                  V4      # \        S\        4      '       gq   \        S\        4      '       d[   \        S\        P                   4      '       d;   SP#                  4       p\        W 4       \        P
                  P                  V4      # \        S\        4      '       gL   \        S\        4      '       g6   \        S\$        4      '       g    \&        P(                  ! S4      \*        9   dg    ! V3R lR\        P                   4      pVP#                  4       p\        W 4       VR,          R,          p\        P
                  P                  V4      # \-        RS 24      h)NT)exclude_unsetc                   0   <a  ] tR tRt o V V3R ltRtV tR# )t_schema.<locals>.Placeholderix  c                &   < V ^8  d   Qh/ SZ;R&   # rI  r   )r%   rK  r  s   "r&   r'   *t_schema.<locals>.Placeholder.__annotate__x  s      r(   r   NrN  )rK  r  s   @r&   rU  rk  x  rV  r(   rU  r4  rJ  r  )r   rm   re  r,  r   rD  r   r   r^  r   r  
model_dumpr   r   
issubclassr   rW  rX  VersionedUnionTypetyping
get_origin_UNION_TYPESr<   )r   r  r  rU  s   &f  r&   t_schemart  S  s    
"7"?"?66"<<&&v..!!((VU\\**F|tELLN++ )0T2F6"<<&&v..
 V\
*
*
VT
"
"
VX//
0
0%%'F6"<<&&v..&&	FD	!	!	F.	/	/			6	"l	2h((  **,F6"L!-0F<<&&v...vh788r(   c                    V ^8  d   QhR\         \        P                  \        3,          R\        \        P
                  ,          /# r`  )r   r   SpeechConfigUnionDictr   r	   SpeechConfig)r%   s   "r&   r'   r'     s;     E E%--s23Ee  !Er(   c                    V '       g   R # \        V \        P                  4      '       d   V # \        V \        4      '       dB   \        P                  ! \        P
                  ! \        P                  ! V R7      R7      R7      # \        V \        4      '       d    \        P                  P                  V 4      # \        R\        V 4       24      h)N)
voice_name)prebuilt_voice_config)voice_configzUnsupported speechConfig type: )r   r   rw  r   r#   VoiceConfigPrebuiltVoiceConfigrm   r   r<   r   r  s   &r&   t_speech_configr~    s     
VU//00M&&"'";";v"N
 
 ,,V444T&\NCDDr(   c                n    V ^8  d   QhR\         P                  R\        \         P                  ,          /# r`  )r   SpeechConfigOrDictr	   rw  )r%   s   "r&   r'   r'     s-      $$e  !r(   c                     \        V \        P                  4      '       d   T p\        V \        4      '       d    \        P                  P                  V 4      pXP                  e   \        R4      hV# )Nz<multi_speaker_voice_config is not supported in the live API.)r   r   rw  r   rm   r   multi_speaker_voice_configr<   )r  speech_configs   & r&   t_live_speech_configr    sc     VU//00M&&55f=M--9
F  
r(   c          	          V ^8  d   QhR\         P                  R\        R\        \        \
        P                  \        3,          ,          /# rg  )r   r"   r   r	   r   r   r   )r%   s   "r&   r'   r'     s<      %%/2eEJJO$%r(   c                    V'       g   R # \         P                  ! V4      '       g   \         P                  ! V4      '       d7   \        P                  ! \        P
                  P                  WR7      .R7      # \        e"   \        V\        4      '       d   \        V4      # \        V\        4      '       d    \        P                  P                  V4      # V# )N)r   callablefunction_declarations)inspect
isfunctionismethodr   r   FunctionDeclarationfrom_callableMcpToolr   r   r   rm   r   )r   r  s   &&r&   t_toolr    s     
7#3#3F#;#;::%%33 4 
  vw??f%%&$::$$V,,Mr(   c                    V ^8  d   QhR\         P                  R\        \        ,          R\        \        P
                  ,          /# rg  )r   r"   rL   r   r   r   )r%   s   "r&   r'   r'     s7      %%/3Cy	%**r(   c                 r   V'       g   . # \         P                  ! . R 7      p. pV Fj  p\        W4      pVf   K  VP                  '       d4   VP                  e&   V;P                  VP                  ,          un        KY  VP	                  V4       Kl  	  VP                  '       d   VP	                  V4       V# )r  )r   r   r  r  r   )r   r  function_tooltoolstooltransformed_tools   &&    r&   t_toolsr    s     
I**26-
%df+#

0
0
011=++22	
+ 	%&  (((	LL	,r(   c                P    V ^8  d   QhR\         P                  R\        R\        /# r   r   r?  r!   r6   )r%   s   "r&   r'   r'     s,     N N+";"; N3 N3 Nr(   c                     \        WR R7      # )cachedContents)r    )r3   )r   r?  s   &&r&   t_cached_content_namer    s    	<L	MMr(   c                x    V ^8  d   QhR\         P                  R\        P                  R\        P                  /# r   r   srcr!   )r   r"   r   BatchJobSourceUnionDictBatchJobSource)r%   s   "r&   r'   r'     s8     /1 /1%%/1		&	&/1 /1r(   c                    \        V\        4      '       d   \        P                  ! R/ VB p\	        V\        P                  4      '       d   \        VP                  R JVP                  R J.4      p\        VP                  R JVP                  R J.4      pV P                  '       d   V'       g   V^8w  d   \        R4      h V# V'       g   V^8w  d   \        R4      hV# \        V\        4      '       d   \        P                  ! VR7      # \        V\        4      '       d   VP                  R4      '       d   \        P                  ! RV.R7      # VP                  R4      '       d   \        P                  ! RVR	7      # VP                  R
4      '       d   \        P                  ! VR7      # \        RV 24      h)NzeExactly one of `gcs_uri` or `bigquery_uri` must be set, other sources are not supported in Vertex AI.Exactly one of `inlined_requests`, `file_name`, `inlined_embed_content_requests`, or `embed_content_file_name` must be set, other sources are not supported in Gemini API.)inlined_requestsgs://jsonlr%   r   bq://bigqueryr%   bigquery_urifiles/)	file_namezUnsupported source: r   )r   rm   r   r  r   sumr   r  r  r  r/   r<   rL   r#   r-   )r   r  vertex_sourcesmldev_sourcess   &&  r&   t_batch_job_sourcer    s    T



%
%CS%..//	D	 #"2"2$">?N D(T! M 	.A-6
 	
 . J 
=A-J
 	

 J#t55#s
~~g!!%  
	 	 !!  
	!	!!!  	)#/00r(   c                x    V ^8  d   QhR\         P                  R\        P                  R\        P                  /# r  )r   r"   r   EmbeddingsBatchJobSourceOrDictEmbeddingsBatchJobSource)r%   s   "r&   r'   r'   
  s8     > >%%>		-	-> ##>r(   c                 :   \        V\        4      '       d   \        P                  ! R/ VB p\	        V\        P                  4      '       d:   \        VP                  R JVP                  R J.4      pV^8w  d   \        R4      hV# \        R\        V4       24      h)Nr  zUnsupported source type: r   )
r   rm   r   r  r   r  r  r  r<   r   )r   r  r  s   && r&   t_embedding_batch_job_sourcer  
  s     T

(
(
/3
/CS%8899D(T! M H 
 J
0c<
==r(   c                z    V ^8  d   QhR\         \        \        P                  3,          R\        P                  /# r   destr!   )r   r#   r   BatchJobDestinationOrDictBatchJobDestination)r%   s   "r&   r'   r'   !  s2     9 9
U444
59
9r(   c                    \        V \        4      '       d   \        P                  ! R/ V B p V # \        V \        4      '       dm   V P                  R 4      '       d   \        P                  ! RV R7      # V P                  R4      '       d   \        P                  ! RV R7      # \        RV  24      h\        V \        P                  4      '       d   V # \        RV  24      h)r  r  r  r  r  r  zUnsupported destination: r   )r   rm   r   r  r#   r-   r<   r   )r  s   &r&   t_batch_job_destinationr  !  s     d$$,t,DK$w&&  
	!	!&& 
 24&9::tU6677K
07
88r(   c                t    V ^8  d   QhR\         \        \        3,          R\         \        \        3,          /# r  )rm   r#   r   )r%   s   "r&   r'   r'   :  s*      tCH~ $sCx. r(   c                     V P                  R / 4      P                  R . 4      pV'       g   V # V F=  pVP                  R/ 4      pV'       g   K  RV9   g   K(  V P                  R 4      V R&    V # 	  V # )inlinedResponsesrJ   	embeddinginlinedEmbedContentResponses)rQ   r+  )r  inline_responsesrJ   inner_responses   &   r&   t_recv_batch_job_destinationr  :  sz    XX0"599" 
K"h\\*b1Nn$-1XX6H-Id)*	+ # 
+r(   c                P    V ^8  d   QhR\         P                  R\        R\        /# r  r6   )r%   s   "r&   r'   r'   K  s'     9 9[66 9c 9c 9r(   c                 j   V P                   '       gF   R p\        P                  ! W!4      '       d   VP                  R4      R,          # \	        RV R24      hRp\        P                  ! W14      '       d   VP                  R4      R,          # VP                  4       '       d   V# \	        RV R24      h)zbatches/[^/]+$r*   zInvalid batch job name: .z:^projects/[^/]+/locations/[^/]+/batchPredictionJobs/[^/]+$r*  )r/   rematchr=   r<   isdigit)r   r?  mldev_patternvertex_patterns   &&  r&   t_batch_job_namer  K  s    	%M	xx$$ZZ_R  1$q9::P.XXn##::c?2||~~K
/vQ7
88r(   c                0    V ^8  d   QhR\         R\         /# )r   stater!   )r#   )r%   s   "r&   r'   r'   ]  s      s s r(   c                     V R 8X  d   R# V R8X  d   R# V R8X  d   R# V R8X  d   R# V R8X  d   R	# V R
8X  d   R# V R8X  d   R# V # )BATCH_STATE_UNSPECIFIEDJOB_STATE_UNSPECIFIEDBATCH_STATE_PENDINGJOB_STATE_PENDINGBATCH_STATE_RUNNINGJOB_STATE_RUNNINGBATCH_STATE_SUCCEEDEDJOB_STATE_SUCCEEDEDBATCH_STATE_FAILEDJOB_STATE_FAILEDBATCH_STATE_CANCELLEDJOB_STATE_CANCELLEDBATCH_STATE_EXPIREDJOB_STATE_EXPIREDr   )r  s   &r&   t_job_stater  ]  s[    
''"%%%%'' $$'' %%Lr(   g      ?g      4@g      @g      ?c                d    V ^8  d   QhR\         P                  R\        P                  R\        /# )r   rB   structr!   )r   r"   r   rK   r   )r%   s   "r&   r'   r'   v  s0      ))3:3E3Er(   c                    VP                  R 4      ;p'       d   RV9   d   TpRp\        pVP                  R4      R8w  dl   V\        8  d   \        RV RV 24      hV P	                  RV/ R7      p\
        P                  ! V4       WD,          p\        V\        ,          \        4      pK  VP                  R	4      ;p'       d   \        RV R
V RV 24      hVP                  R4      # V# )r?  z/operations/g        doneTz
Operation z timed out.
GET)http_methodpathrequest_dicterrorz failed with error: z.
rJ   )
rQ   !LRO_POLLING_INITIAL_DELAY_SECONDSLRO_POLLING_TIMEOUT_SECONDSRuntimeErrorrequesttimesleepminLRO_POLLING_MULTIPLIER!LRO_POLLING_MAXIMUM_DELAY_SECONDS)rB   r  r?  	operationtotal_secondsdelay_secondsr  s   &&     r&   t_resolve_operationr  v  s     jj  d n&<$*IM5M
--
4
'	4	4Zv]9+FGG$$$R % i jj$m
0
0
+m g&&u&tf0s9+
F  ==$$Mr(   c                    V ^8  d   QhR\         \        \        \        P                  \        P
                  \        P                  3,          ,          R\        /# )r   r?  r!   )r	   r   r#   r   r   VideoGeneratedVideo)r%   s   "r&   r'   r'     s=      
5ejj%++u7K7KKL
Mr(   c                    \        V \        P                  4      '       d   V P                  p Mt\        V \        P                  4      '       d   V P
                  p MG\        V \        P                  4      '       d(   V P                  e   V P                  P
                  p MR p V f   \        R4      h\        V \        4      '       g   \        R\        V 4       R24      hV P                  R4      '       dU   V P                  R4      ^,          p\        P                  ! RV4      pVf   \        RV  24      hVP!                  ^ 4      p V # V P                  R4      '       d   V P                  R4      ^,          p V # )NzFile name is required.z"Could not convert object of type `z` to a file name.zhttps://r  z	[a-z0-9]+z&Could not extract file name from URI: )r   r   r   r?  r  r   r  videor<   r   r#   r   r-   r=   r  r  group)r?  suffixr  s   &  r&   t_file_namer    s,    T5::&&99DtU[[))88DtU1122zzZZ^^dd	\
-
..	D#		

,T$ZL8IJ  
__Z  ZZ!!$FHH[&)E}?vFGG;;q>D 
+ x  ::h"D	+r(   c                f    V ^8  d   QhR\         R\        \        P                  \         3,          /# )r   statusr!   )r#   r   r   JobState)r%   s   "r&   r'   r'     s(       ennc.A(B r(   c                 x   V R 8X  d   \         P                  P                  # V R8X  d   \         P                  P                  # V R8X  d   \         P                  P                  # V R8X  d   \         P                  P
                  # \         P                   F!  p\        VP                  4      V 8X  g   K  Vu # 	  V # )STATE_UNSPECIFIEDCREATINGACTIVEFAILED)r   r  r  r  r  r  r#   r8  )r   r  s   & r&   t_tuning_job_statusr    s    "">>///>>+++>>--->>***	U[[	V	#   Mr(   c                X    V ^8  d   QhR\         P                  R\         P                  /# )r   r   r!   )r   ContentOrDictr   )r%   s   "r&   r'   r'     s$      e11 emm r(   c                     \        V \        4      '       d    \        P                  P	                  V 4      # \        V \        P                  4      '       d   V # \        R \        V 4       R24      h)Could not convert input (type "z") to `types.Content`)r   rm   r   r   r   r   r<   r   )r   s   &r&   t_content_strictr    sX    ==''00w..N

)$w-8MN r(   c                    V ^8  d   QhR\         \        \        P                  ,          \        P                  3,          R\        \        P
                  ,          /# r   )r   r
   r   r	  rL   r   )r%   s   "r&   r'   r'     s@     ( (HU00153F3FFG(	%--(r(   c                     \        V \        4      '       d   V  Uu. uF  p\        V4      NK  	  up# \        V 4      .# u upi r   )r   r
   r  )r   r   s   & r&   t_contents_strictr    s?     (##5=>X'W%X>>X&'' ?r   c                    V ^8  d   QhR\         \        \        \        P                  ,          \        P                  3,          ,          R\
        R\        P                  /# )r   turnsturn_completer!   )r	   r   r
   r   r	  rD   LiveClientContent)r%   s   "r&   r'   r'     sQ      hu**+U-@-@@A 	
 r(   c                     V f   \         P                  ! VR7      #  \         P                  ! \        V R7      VR7      #   \         d   p\	        R\        T 4       R24      ThR p?ii ; i)N)r  )r   )r  r  r  z") to `types.LiveClientContent`)r   r  r  	Exceptionr<   r   )r  r  es   && r&   t_client_contentr    sv     ]""??	""/#  
 

)$u+ 7$ 	$ s   !? A(
A##A(c                    V ^8  d   QhR\         \        P                  \        \        P                  ,          3,          R\        P                  /# )r   inputr!   )r   r   r}   r
   LiveClientToolResponse)r%   s   "r&   r'   r'     sE      $$--.	0
 !!r(   c                     V '       g   \        R V  24      h \        P                  ! \        V R7      R7      #   \         d   p\        R\        T 4       R24      ThRp?ii ; i)z#A tool response is required, got: 
)r   r  z$") to `types.LiveClientToolResponse`N)r<   r   r  r   r  r   )r  r  s   & r&   t_tool_responser    ss     

;E7C
DD''/5I  
 

)$u+ 7) 	) s    9 A"AA"c                    V ^8  d   QhR\         \        P                  ,          R\         \        \        \
        3,          ,          /# )r   metricsr!   )rL   r   MetricSubclassrm   r#   r   )r%   s   "r&   r'   r'     s8     C C%&&'C	$sCx.Cr(   c                L   . pV  EF~  p\        V\        4      '       d!    \        P                  P	                  V4      p\        V\        P                  4      '       d+   VP                  4       pRR.VR&   VP                  V4       K  / pRR.VR&   \        VR.4      P                  4       pVR8X  d   / VR&   MVR8X  d   / VR&   MVP                  R	4      '       d   VP                  R
R4      pRV/VR&   Mz\        VR4      '       d[   VP                  '       dI   RVP                  /p\        VR.4      pV'       d   WR&   \        VR.4      p	V	'       d   RV	/VR&   WtR&   M\        RV 24      hVP                  V4       EK  	  V#   \
        P                   d     ELci ; i)a  Prepares the metric payload for the evaluation request.

Args:
    request_dict: The dictionary containing the request details.
    resolved_metrics: A list of resolved metric objects.

Returns:
    The updated request dictionary with the prepared metric payload.
AVERAGESTANDARD_DEVIATIONaggregation_metricsr?  r   exact_match_specr   	bleu_specrouger=  rb   
rouge_typer   prompt_templatemetric_prompt_templatejudge_model_system_instructionsystem_instructionreturn_raw_outputcustom_output_format_configpointwise_metric_specz0Unsupported metric type or invalid metric name: )r   rm   r   UnifiedMetricr   r   r   rn  r   getvru   r-   replacehasattrr(  r<   )
r  metrics_payloadmetricunified_metric_payloadmetric_payload_itemmetric_namer'  pointwise_specr+  r,  s
   &         r&   	t_metricsr9    s    O	FD	!	!	&&55f=& 
FE//	0	0171B1B1D 9
45 	56,.

4/0
 &*002k		%24./& +-K(!!'** ((b1
-9:,FL)6,--&2H2H2H2F4J4JK!56
 1C-
. ()
 !#4;.6
7 8F34A+O
 	
 01i j a '' 	
	s   F

F#"F#c                0    V ^8  d   QhR\         R\        /# )r   r5   r!   )r#   rD   )r%   s   "r&   r'   r'   I  s      3 4 r(   c                 @    R V 9   ;'       d    V R8g  ;'       g    RV 9   # )geminizgemini-embedding-001maasr   )r5   s   &r&   t_is_vertex_embed_content_modelr>  I  s0     %;;E%;;  	5	r(   c                    V ^8  d   Qh/ ^ \         9   d   \        P                  ;R&   ^\         9   d   \        P                  ;R&   # )r   McpClientSessionr  )__conditional_annotations__rq  Type)r%   s   "r&   r'   r'      s8     ( (T &%FKK%U )V 6;;W )r(   )   
   r   )NT)mrA  __doc__base64collections.abcr   r   r2  r   r   r  rq   loggingr  sysr  r   builtin_typesrq  r   r   r   r	   r
   r   
_mcp_utilsr   r   r   r0  r   TYPE_CHECKINGr   r   r   rb   r   	getLoggerrR   version_info	UnionTyperp  rs  r   _UnionGenericAliastyping_extensionsmcpr   r@  	mcp.typesr   r  r   metric_name_sdk_api_mapr
  metric_name_api_sdk_mapr3   r@   rH   rW   rZ   rz   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r,  r^  re  rt  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r9  r>  r'   )kvrA  s   00@r&   <module>rX     s    )  -   	  	 
    E E * . $	    			7	8w$..,, 7 78,00,,,)	3'"%%'5) #
J+ 
 -D,I,I,KL,KDA14,KL Z
 '(Zz4>";& 54AAC<& EMM5#4#4e6I6IIJ*8 4iX8v9
QTH
 "TH THn2:-9`E& *2N/1d>.92"9$& %( !$( !#  <D (*(CLU( 
 G Ms   $J* J<*J98J9