
    Mih                    v4   S SK r S SKrS SKJrJrJrJrJrJr  S SK	J
r
  SSKJr  SSKJr  SSKJr  SSKJr  SS	KJr  SS
KJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJrJr  \R>                  " S5      r S\SS4S jr!S\SS4S jr"S\SS4S jr#  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S jjr'  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S jjr(  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S jjr)  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S jjr*  SS\S\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4
S jjr+  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S  jjr,  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S! jjr-  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S" jjr.  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S# jjr/  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S$ jjr0  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S% jjr1  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S& jjr2  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S' jjr3  SS\S\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4
S( jjr4  SS\S\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4
S) jjr5  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S* jjr6  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S+ jjr7  SS\S\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4
S, jjr8  SS\S\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4
S- jjr9  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S. jjr:  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S/ jjr;  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S0 jjr<  SS\S\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4
S1 jjr=  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S2 jjr>  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S3 jjr?  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S4 jjr@  SS\S\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4
S5 jjrA  SS\S\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4
S6 jjrB  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S7 jjrC  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S8 jjrD  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S9 jjrE  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S: jjrF  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S; jjrG  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S< jjrH  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S= jjrI  SS\S\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4
S> jjrJ  SS\S\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4
S? jjrK  SS\S\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4
S@ jjrL  SS\S\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4
SA jjrM  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4SB jjrN  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4SC jjrO  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4SD jjrP  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4SE jjrQ  SS\S\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4
SF jjrR  SS\S\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4
SG jjrS  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4SH jjrT  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4SI jjrU  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4SJ jjrV  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4SK jjrW  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4SL jjrX  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4SM jjrY  SS\S\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4
SN jjrZ  SS\S\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4
SO jjr[  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4SP jjr\  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4SQ jjr]  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4SR jjr^  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4SS jjr_  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4ST jjr`  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4SU jjra  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4SV jjrb  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4SW jjrc  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4SX jjrd  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4SY jjre  SS\S\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4
SZ jjrf  SS\S\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4
S[ jjrg  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S\ jjrh  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S] jjri  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S^ jjrj  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S_ jjrk  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S` jjrl  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4Sa jjrm  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4Sb jjrn  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4Sc jjro  SS\S\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4
Sd jjrp  SS\S\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4
Se jjrq  SS\S\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4
Sf jjrr  SS\S\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4
Sg jjrs  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4Sh jjrt  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4Si jjru  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4Sj jjrv  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4Sk jjrw  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4Sl jjrx  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4Sm jjry  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4Sn jjrz  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4So jjr{  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4Sp jjr|  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4Sq jjr}  SS\S\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4
Sr jjr~  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4Ss jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4St jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4Su jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4Sv jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4Sw jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4Sx jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4Sy jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4Sz jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S{ jjr  SS\S\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4
S| jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S} jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S~ jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S jjr  SS\S\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4
S jjr  SS\S\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4
S jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S jjr  SS\S\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4
S jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S jjr  SS\\$\%\4   \&4   S\\$\%\4      S\\\$\%\4   \&4      S\$\%\4   4S jjr " S S\GRB                  5      r " S S\GRB                  5      rg)    N)AnyAsyncIterator	AwaitableIteratorOptionalUnion)	urlencode   )_api_module)_base_transformers)_common)_extra_utils)
_mcp_utils)_transformers)errors)types)BaseApiClient)get_value_by_path)set_value_by_path)
AsyncPagerPagerzgoogle_genai.models
enum_valuereturnc                 @    U [        S/5      ;   a  [        U  S35      eg )N	ALLOW_ALL+ enum value is not supported in Gemini API.set
ValueErrorr   s    m/var/www/eduai.edurigo.com/storigo/production/storigo_env/lib/python3.13/site-packages/google/genai/models.py(_PersonGeneration_to_mldev_enum_validater"   '   s)    3}%%

|#NO
PP &    c                 @    U [        S/5      ;   a  [        U  S35      eg )N
BLOCK_NONEr   r   r    s    r!   )_SafetyFilterLevel_to_mldev_enum_validater&   ,   s)    3~&&

|#NO
PP 'r#   c                 @    U [        S/5      ;   a  [        U  S35      eg )NSTYLEr   r   r    s    r!   4_VideoGenerationReferenceType_to_mldev_enum_validater)   1   s*     3y>!

|#NO
PP "r#   from_objectparent_objectroot_objectc                    0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        S5      e[        U S/5      b  [        S5      e[        U S/5      b  [        S5      e[        U S	/5      b  [        S
5      e[        U S/5      b  [        S5      e[        U S/5      b  [        S5      eU$ )Napi_keyapiKeyapi_key_configz8api_key_config parameter is not supported in Gemini API.	auth_typez3auth_type parameter is not supported in Gemini API.google_service_account_configzGgoogle_service_account_config parameter is not supported in Gemini API.http_basic_auth_configz@http_basic_auth_config parameter is not supported in Gemini API.oauth_configz6oauth_config parameter is not supported in Gemini API.oidc_configz5oidc_config parameter is not supported in Gemini API.getvsetvr   r*   r+   r,   	to_objects       r!   _AuthConfig_to_mldevr;   8   s    
 !)	+	{#/XJ[9+ >?	+()*6
O
PP	+}%1
J
KK	+789E
	 
 
+012>
J  
+'(4
M
NN	+'3
L
MM	r#   c                     0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        S5      e[        U S/5      b  [        US/[        U S/5      5        U$ )Ndatadisplay_name6display_name parameter is not supported in Gemini API.	mime_typemimeTyper6   r9   s       r!   _Blob_to_mldevrB   [   sw    
 !)	+x ,VHd;9:	+'(4
M
NN	+}%1ZL${[M"BC	r#   c           
      T   0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US	/[        U S/5      5        [        U S
/5      b  [        US/[        U S
/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b)  [        US/[        U S/5       Vs/ s H  oDPM     sn5        [        U S/5      b  [        US/[        U S/5      5        U$ s  snf )NcontentcitationMetadatacitation_metadata
tokenCounttoken_countfinishReasonfinish_reasongroundingMetadatagrounding_metadataavgLogprobsavg_logprobsindexlogprobsResultlogprobs_resultsafetyRatingssafety_ratingsurlContextMetadataurl_context_metadata)r7   r8   _CitationMetadata_from_mldevr*   r+   r,   r:   items        r!   _Candidate_from_mldevrY   m   s   
 !)	+	{#/YKkI;!?@	+*+,8	$123Y	
 
+~&2]OT+~%FG	+'(4_%tK.9I'JK	++,-9	[./0 
+'3^$d;&HI	+y!-WItK';<	+()*6&'k<L;M)NO	+()5	{_,=>?>$>? 
+,-.:	 [/01 
 	@s   *F%c                     0 n[        U S/5      b)  [        US/[        U S/5       Vs/ s H  oDPM     sn5        U$ s  snf )NcitationSources	citationsr7   r8   rW   s        r!   rV   rV      sW    
 !)	+)*+7	{->,?@A@$@A 
 	Bs   <
api_clientc                 :   0 n[        US/5      b/  [        USS/[        R                  " U [        US/5      5      5        [        US/5      bH  [        US/[        R                  " [        US/5      5       Vs/ s H  n[        XTU5      PM     sn5        U$ s  snf )Nmodel_urlcontents)r7   r8   tt_model
t_contents_Content_to_vertexr^   r*   r+   r,   r:   rX   s         r!   "_ComputeTokensParameters_to_vertexrh      s     !)	+y!-				*d;	:; 
+
|$0	 T+
|%DE	
E t<E	
 
	
s   9Bc                     0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b)  [        US/[        U S/5       Vs/ s H  oDPM     sn5        U$ s  snf )NsdkHttpResponsesdk_http_response
tokensInfotokens_infor]   rW   s        r!   "_ComputeTokensResponse_from_vertexrn      s    
 !)	+)*+7'(${=N<O*P 
+~&2	{\N;<;$;< 
 	=s   A#c                     0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )N	truncatedrH   r]   r9   s       r!   '_ContentEmbeddingStatistics_from_vertexrq      s[    
 !)	+}%1[M4k]#CD	+'3]OT+%GH	r#   c           
          0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b#  [        US/[        [        U S/5      X25      5        U$ )Nvalues
statistics)r7   r8   rq   r9   s       r!   _ContentEmbedding_from_vertexru      sl    
 !)	+z".XJ[8* =>	+~&2	/|n-y	
 
r#   c                     0 n[        U S/5      b4  [        US/[        U S/5       Vs/ s H  n[        XCU5      PM     sn5        [        U S/5      b  [        US/[        U S/5      5        U$ s  snf Npartsrole)r7   r8   _Part_to_mldevrW   s        r!   _Content_to_mldevr{   
  s    
 !)	+y!-		 [7)4	
4 4K84	
 
+x ,VHd;9:		
   A.c                     0 n[        U S/5      b4  [        US/[        U S/5       Vs/ s H  n[        XCU5      PM     sn5        [        U S/5      b  [        US/[        U S/5      5        U$ s  snf rw   )r7   r8   _Part_to_vertexrW   s        r!   rf   rf      s    
 !)	+y!-		 [7)4	
4 D[94	
 
+x ,VHd;9:		
r|   c                     0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )Ncontrol_typecontrolType enable_control_image_computationcomputeControlr]   r9   s       r!   !_ControlReferenceConfig_to_vertexr   6  si    
 !)	+'(4]OT+7G%HI	+:;<H	[=>? 
r#   c                     0 n[        U S/5      b  [        S5      e[        U S/5      b  [        S5      e[        U S/5      b  [        S5      eU$ )Nsystem_instructionz<system_instruction parameter is not supported in Gemini API.toolsz/tools parameter is not supported in Gemini API.generation_configz;generation_config parameter is not supported in Gemini API.)r7   r   r9   s       r!   _CountTokensConfig_to_mldevr   I  sp    
 !)	+,-.:
F  
+y!-
F
GG	++,-9
E  
r#   c                    0 n[        U S/5      b8  [        US/[        [        R                  " [        U S/5      5      UU5      5        [        U S/5      b4  [        US/[        U S/5       Vs/ s H  n[        XCU5      PM     sn5        [        U S/5      b#  [        US/[        [        U S/5      X25      5        U$ s  snf )Nr   systemInstructionr   r   generationConfig)r7   r8   rf   rc   	t_content_Tool_to_vertex_GenerationConfig_to_vertexrW   s        r!   _CountTokensConfig_to_vertexr   `  s    
 !)	+,-.:	KK[+?*@AB	
 
+y!-		 [7)4	
4 D[94	
 
++,-9	#234i	
 
	
s   .B>c                    0 n[        US/5      b/  [        USS/[        R                  " U [        US/5      5      5        [        US/5      bH  [        US/[        R                  " [        US/5      5       Vs/ s H  n[        XTU5      PM     sn5        [        US/5      b  [        [        US/5      XC5        U$ s  snf Nr`   ra   rb   config)r7   r8   rc   rd   re   r{   r   rg   s         r!   _CountTokensParameters_to_mldevr     s     !)	+y!-				*d;	:; 
+
|$0	 T+
|%DE	
E d{;E	
 
+z".[8*%y 
	
   9B=c                    0 n[        US/5      b/  [        USS/[        R                  " U [        US/5      5      5        [        US/5      bH  [        US/[        R                  " [        US/5      5       Vs/ s H  n[        XTU5      PM     sn5        [        US/5      b  [        [        US/5      XC5        U$ s  snf r   )r7   r8   rc   rd   re   rf   r   rg   s         r!    _CountTokensParameters_to_vertexr     s     !)	+y!-				*d;	:; 
+
|$0	 T+
|%DE	
E t<E	
 
+z". [8*%y 
	
r   c                     0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )Nrj   rk   totalTokenstotal_tokenscachedContentTokenCountcached_content_token_countr]   r9   s       r!   _CountTokensResponse_from_mldevr     s    
 !)	+)*+7'(${=N<O*P 
+'3^$d;&HI	+123?	%&[456 
r#   c                     0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )Nrj   rk   r   r   r]   r9   s       r!    _CountTokensResponse_from_vertexr     sg    
 !)	+)*+7'(${=N<O*P 
+'3^$d;&HI	r#   c                     0 n[        US/5      b/  [        USS/[        R                  " U [        US/5      5      5        U$ Nr`   ra   namer7   r8   rc   rd   r^   r*   r+   r,   r:   s        r!   _DeleteModelParameters_to_mldevr     J     !)	+y!-				*d;	:; 
r#   c                     0 n[        US/5      b/  [        USS/[        R                  " U [        US/5      5      5        U$ r   r   r   s        r!    _DeleteModelParameters_to_vertexr     r   r#   c                 X    0 n[        U S/5      b  [        US/[        U S/5      5        U$ Nrj   rk   r]   r9   s       r!   _DeleteModelResponse_from_mldevr     @    
 !)	+)*+7'(${=N<O*P 
r#   c                 X    0 n[        U S/5      b  [        US/[        U S/5      5        U$ r   r]   r9   s       r!    _DeleteModelResponse_from_vertexr   !  r   r#   c                 X   0 n[        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS	/[        U S/5      5        [        U S
/5      b  [        USS/[        U S
/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        U/ SQ[        U S/5      5        [        U S/5      b  [        U/ SQ[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        U/ S Q[        U S/5      5        U$ )!Noutput_gcs_uri
parameters
storageUrinegative_promptnegativePromptnumber_of_imagessampleCountaspect_ratioaspectRatioguidance_scaleguidanceScaleseedsafety_filter_levelsafetySettingperson_generationpersonGenerationinclude_safety_attributesincludeSafetyAttributesinclude_rai_reasonincludeRaiReasonlanguageoutput_mime_typer   outputOptionsrA   output_compression_qualityr   r   compressionQualityadd_watermarkaddWatermarklabels	edit_modeeditMode
base_steps)r   
editConfig	baseStepsr]   r9   s       r!   _EditImageConfig_to_vertexr   /  sO   
 !)	+()*6	|$[+,- 
+)*+7	'([,-. 
+*+,8	}%[-./ 
+'(4	}%[>*+ 
+()*6	'[+,- 
+x ,v.[6(0KL	+-./;	'[012 
++,-9	)*[./0 
+345A	01[678 
+,-.:	)*[/01 
+
|$0	z"[:,' 
+*+,83[-./ 
+456B=[789 
+()5	~&[?+, 
+z".
Dxj$AB	+}%1	z"[;-( 
+~&21[<.) 
r#   c                    0 n[        US/5      b/  [        USS/[        R                  " U [        US/5      5      5        [        US/5      b  [        USS/[        US/5      5        [        US/5      b5  [        USS/[        US/5       Vs/ s H  n[	        XTU5      PM     sn5        [        US/5      b  [        [        US/5      XC5        U$ s  snf )Nr`   ra   promptinstances[0]reference_imagesreferenceImagesr   )r7   r8   rc   rd   _ReferenceImageAPI_to_vertexr   rg   s         r!   _EditImageParameters_to_vertexr     s     !)	+y!-				*d;	:; 
+z".^X.[8*0MN	+*+,8	*+ [+=*>?	
? )+F?	
 
+z".[8*%y 
	
s   Cc                     0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b4  [        US/[        U S/5       Vs/ s H  n[        XCU5      PM     sn5        U$ s  snf Nrj   rk   predictionsgenerated_imagesr7   r8   _GeneratedImage_from_vertexrW   s        r!   _EditImageResponse_from_vertexr         
 !)	+)*+7'(${=N<O*P 
+'3	 [=/:	
: (E:	
 
	
   A.c                    0 n[        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        S5      e[        U S	/5      b  [        S
5      e[        U S/5      b  [        S5      e[        U S/5      b  [        S5      eU$ )N	task_type
requests[]taskTypetitleoutput_dimensionalityoutputDimensionalityr@   z3mime_type parameter is not supported in Gemini API.auto_truncatez7auto_truncate parameter is not supported in Gemini API.document_ocrz6document_ocr parameter is not supported in Gemini API.audio_track_extractionz@audio_track_extraction parameter is not supported in Gemini API.r6   r9   s       r!   _EmbedContentConfig_to_mldevr     s   
 !)	+}%1	z"[;-( 
+y!-w/kG91MN	+/01=	-.[234 
+}%1
J
KK	+()5
N
OO	+'(4
M
NN	+012>
J  
r#   c                    0 n[        US/5      nUc  SnUS:X  a)  [        U S/5      b  [        USS/[        U S/5      5        O.US:X  a(  [        U S/5      b  [        USS/[        U S/5      5        [        US/5      nUc  SnUS:X  a)  [        U S/5      b  [        USS/[        U S/5      5        O.US:X  a(  [        U S/5      b  [        USS/[        U S/5      5        [        US/5      nUc  SnUS:X  a)  [        U S	/5      b  [        US
S/[        U S	/5      5        O.US:X  a(  [        U S	/5      b  [        USS/[        U S	/5      5        [        US/5      nUc  SnUS:X  a(  [        U S/5      b  [        USS/[        U S/5      5        [        US/5      nUc  SnUS:X  a)  [        U S/5      b  [        US
S/[        U S/5      5        O.US:X  a(  [        U S/5      b  [        USS/[        U S/5      5        [        US/5      nUc  SnUS:X  a(  [        U S/5      b  [        USS/[        U S/5      5        [        US/5      nUc  SnUS:X  a(  [        U S/5      b  [        USS/[        U S/5      5        U$ )Nembedding_api_typePREDICTr   instances[]EMBED_CONTENTembedContentConfigr   r   r   r   r   r@   rA   r   autoTruncater   documentOcrr   audioTrackExtractionr]   )r*   r+   r,   r:   discriminators        r!   _EmbedContentConfig_to_vertexr     sK   
 !){%9$:;-MiK+'3

+
&
{[M
*
 'K+'3


,
{[M
* {%9$:;-MiK'#/

-14gY3O 'K'#/


)
{WI
& {%9$:;-MiK123?

/
0
{45
6
 'K123?

!7
8
{45
6 {%9$:;-MiK+'3

*
%
{[M
* {%9$:;-MiK/*+7


(
{_-
.
 'K/*+7


0
{_-
. {%9$:;-Mo%K.)*6


/
{^,
- {%9$:;-Mo%K234@

!7
8
{56
7 
r#   c                 D   0 n[        US/5      b/  [        USS/[        R                  " U [        US/5      5      5        [        US/5      b@  [        USS/[        R                  " U [        US/5      5       Vs/ s H  nUPM     sn5        [        US/5      b+  [        [        R                  " [        US/5      5      XC5        [        US/5      b  [        [        US/5      XC5        [        USS/[        R                  " U [        US/5      5      5        U$ s  snf )Nr`   ra   rb   r   rD   r   )r7   r8   rc   rd   t_contents_for_embedr{   r   r   rg   s         r!   '_EmbedContentParametersPrivate_to_mldevr   }  s0    !)	+y!-				*d;	:; 
+
|$0	y! ..Dzl;	
 	
	 
+	{#/	Dyk23Y 
+z". [8*%y Wii
Dwi89
 
/	
s   ;Dc                 `   0 n[        US/5      b/  [        USS/[        R                  " U [        US/5      5      5        [        US/5      nUc  SnUS:X  aN  [        US/5      b@  [        USS/[        R                  " U [        US/5      5       Vs/ s H  nUPM     sn5        [        US/5      nUc  SnUS:X  aF  [        US/5      b8  [        US/[        [        R                  " [        US/5      5      UU5      5        [        US	/5      b  [        [        US	/5      XC5        U$ s  snf )
Nr`   ra   r   r   rb   r   rD   r   r   )r7   r8   rc   rd   r   rf   r   r   )r^   r*   r+   r,   r:   r   rX   s          r!   (_EmbedContentParametersPrivate_to_vertexr     s^    !)	+y!-				*d;	:; {%9$:;-MiK*&2

)
$ 00d;=$ 	 {%9$:;-Mo%K)%1

+
kk${YK89 
+z".![8*%y 
9s   D+c                    0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b)  [        US/[        U S/5       Vs/ s H  oDPM     sn5        [        U S/5      b  [        US/[        U S/5      5        U$ s  snf )Nrj   rk   
embeddingsmetadatar]   rW   s        r!    _EmbedContentResponse_from_mldevr    s    
 !)	+)*+7'(${=N<O*P 
+~&2	{\N;<;$;< 
+
|$0ZL${ZL"AB	 	=s   B
c                 @   0 n[        U S/5      b  [        US/[        U S/5      5        [        U SS/5      b5  [        US/[        U SS/5       Vs/ s H  n[        XCU5      PM     sn5        [        U S/5      b  [        US/[        U S/5      5        [        US/5      S:X  as  [        U S/5      n[        U S	/5      n[        U S
/5      nU(       aE  0 nU(       a  UR                  S5      (       a  US   US'   U(       a  XxS
'   XS'   [        US/U/5        U$ s  snf )Nrj   rk   zpredictions[]r   r  r   r   	embeddingusageMetadatarp   promptTokenCountrH   rt   )r7   r8   ru   get)	r*   r+   r,   r:   rX   r  usage_metadatarp   statss	            r!   !_EmbedContentResponse_from_vertexr
    sL   
 !)	+)*+7'(${=N<O*P 
+67C	 [?L*IJ	
J *$;GJ	
 
+
|$0ZL${ZL"AB	+,-./A[;-0I+'89N[;-0Ie	N../ABB-.@Am	&k %
9|nyk2	-	
s   Dc                     0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )Nendpointr   deployedModelIddeployed_model_idr]   r9   s       r!   _Endpoint_from_vertexr    sf    
 !)	+
|$0VHd;=>	+)*+7'(${=N<O*P 
r#   c                     0 n[        U S/5      b  [        S5      e[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )Nr>   r?   file_urifileUrir@   rA   )r7   r   r8   r9   s       r!   _FileData_to_mldevr  /  sw    
 !)	+'(4
M
NN	+
|$0YKkJ<!@A	+}%1ZL${[M"BC	r#   c                 X   0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        S5      e[        U S/5      b  [        S5      eU$ )Nidargsr   partial_argsz6partial_args parameter is not supported in Gemini API.will_continuez7will_continue parameter is not supported in Gemini API.r6   r9   s       r!   _FunctionCall_to_mldevr  A  s    
 !)	+v*TFDtf56	+x ,VHd;9:	+x ,VHd;9:	+'(4
M
NN	+()5
N
OO	r#   c                     0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        S5      eU$ )Nallowed_function_namesallowedFunctionNamesmodestream_function_call_argumentszHstream_function_call_arguments parameter is not supported in Gemini API.r6   r9   s       r!   _FunctionCallingConfig_to_mldevr  Y  s    
 !)	+012>	 [345 
+x ,VHd;9:	+89:F
	 
 
r#   c                    0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S	/5      b  [        S
5      eU$ )Ndescriptionr   r   parameters_json_schemaparametersJsonSchemaresponseresponse_json_schemaresponseJsonSchemabehaviorzHbehavior parameter is not supported in Gemini Enterprise Agent Platform.r6   r9   s       r!   _FunctionDeclaration_to_vertexr(  r  s.   
 !)	+'3]OT+%GH	+x ,VHd;9:	+~&2\ND|n$EF	+012>	 [345 
+
|$0ZL${ZL"AB	+./0<	[123 
+
|$0
	 
 
r#   c                 
   0 n[        US/5      b8  [        US/[        [        R                  " [        US/5      5      UU5      5        [        US/5      b  [        US/[        US/5      5        [        US/5      b  [        US/[        US/5      5        [        US/5      b  [        US/[        US/5      5        [        US/5      b  [        US	/[        US/5      5        [        US
/5      b  [        US/[        US
/5      5        [        US/5      b  [        US/[        US/5      5        [        US/5      b  [        US/[        US/5      5        [        US/5      b  [        US/[        US/5      5        [        US/5      b  [        US/[        US/5      5        [        US/5      b  [        US/[        US/5      5        [        US/5      b  [        US/[        US/5      5        [        US/5      b  [        US/[        US/5      5        [        US/5      b.  [        US/[        R
                  " U [        US/5      5      5        [        US/5      b  [        US/[        US/5      5        [        US/5      b  [        S5      e[        US/5      b  [        S5      e[        US /5      b4  [        US!/[        US /5       Vs/ s H  n[        XTU5      PM     sn5        [        US"/5      b]  [        US"/[        R                  " U [        US"/5      5       Vs/ s H#  n[        [        R                  " X5      XC5      PM%     sn5        [        US#/5      b#  [        US$/[        [        US#/5      XC5      5        [        US%/5      b  [        S&5      e[        US'/5      b.  [        US(/[        R                  " U [        US'/5      5      5        [        US)/5      b  [        US*/[        US)/5      5        [        US+/5      b  [        US,/[        US+/5      5        [        US-/5      b-  [        US./[        R                  " [        US-/5      5      5        [        US//5      b  [        S05      e[        US1/5      b  [        US2/[        US1/5      5        [        US3/5      b#  [        US4/[        [        US3/5      XC5      5        [        US5/5      b  [        US6/[        US5/5      5        [        US7/5      b  [        S85      e[        US9/5      b  [        US:/[        US9/5      5        U$ s  snf s  snf );Nr   r   temperaturetop_ptopPtop_ktopKcandidate_countcandidateCountmax_output_tokensmaxOutputTokensstop_sequencesstopSequencesresponse_logprobsresponseLogprobslogprobspresence_penaltypresencePenaltyfrequency_penaltyfrequencyPenaltyr   response_mime_typeresponseMimeTyperesponse_schemaresponseSchemar%  r&  routing_configz8routing_config parameter is not supported in Gemini API.model_selection_configz@model_selection_config parameter is not supported in Gemini API.safety_settingssafetySettingsr   tool_config
toolConfigr   0labels parameter is not supported in Gemini API.cached_contentcachedContentresponse_modalitiesresponseModalitiesmedia_resolutionmediaResolutionspeech_configspeechConfigaudio_timestampz9audio_timestamp parameter is not supported in Gemini API.thinking_configthinkingConfigimage_configimageConfigenable_enhanced_civic_answersenableEnhancedCivicAnswersmodel_armor_configz<model_armor_config parameter is not supported in Gemini API.service_tierserviceTier)r7   r8   r{   rc   r   t_schemar   _SafetySetting_to_mldevt_tools_Tool_to_mldevt_tool_ToolConfig_to_mldevt_cached_content_namet_speech_config_ImageConfig_to_mldevrg   s         r!   _GenerateContentConfig_to_mldevrb    s    !)	+,-.:	KK[+?*@AB	
 
+'3]OT+%GH	+y!-VHd;	:;	+y!-VHd;	:;	+)*+7%&[;L:M(NO	++,-9%&[;N:O(P 
+()*6_%tK:J9K'LM	++,-9	[./0 
+
|$0ZL${ZL"AB	+*+,8%&[;M:N(O 
++,-9	[./0 
+x ,VHd;9:	+,-.:	[/01 
+)*+7		

:tK2C1DEF 
+./0<	[123 
+()*6
O
PP	+012>
J  
+)*+7	 [+<*=>	
> $D[A>	
 
+y!-		 		*d;	.JK	
K 188J5yNK	
 
+'3	}o.		
 
+z".
G
HH	+()*6		[+;*<=	
 
+-./;	[012 
+*+,8%&[;M:N(O 
+()5		${_,=>? 
+)*+7
C  
+)*+7%&[;L:M(NO	+'(4	~./	
 
+789E	%&[:;< 
+,-.:
F  
+'(4kN;K)LM	q	
	
s   U.*Uc                    0 n[        US/5      b8  [        US/[        [        R                  " [        US/5      5      UU5      5        [        US/5      b  [        US/[        US/5      5        [        US/5      b  [        US/[        US/5      5        [        US/5      b  [        US/[        US/5      5        [        US/5      b  [        US	/[        US/5      5        [        US
/5      b  [        US/[        US
/5      5        [        US/5      b  [        US/[        US/5      5        [        US/5      b  [        US/[        US/5      5        [        US/5      b  [        US/[        US/5      5        [        US/5      b  [        US/[        US/5      5        [        US/5      b  [        US/[        US/5      5        [        US/5      b  [        US/[        US/5      5        [        US/5      b  [        US/[        US/5      5        [        US/5      b.  [        US/[        R
                  " U [        US/5      5      5        [        US/5      b  [        US/[        US/5      5        [        US/5      b  [        US/[        US/5      5        [        US/5      b  [        US/[        US/5      5        [        US /5      b)  [        US!/[        US /5       Vs/ s H  oUPM     sn5        [        US"/5      b]  [        US"/[        R                  " U [        US"/5      5       Vs/ s H#  n[        [        R                  " X5      XC5      PM%     sn5        [        US#/5      b#  [        US$/[        [        US#/5      XC5      5        [        US%/5      b  [        US%/[        US%/5      5        [        US&/5      b.  [        US'/[        R                  " U [        US&/5      5      5        [        US(/5      b  [        US)/[        US(/5      5        [        US*/5      b  [        US+/[        US*/5      5        [        US,/5      b8  [        US-/[        [        R                  " [        US,/5      5      UU5      5        [        US./5      b  [        US//[        US./5      5        [        US0/5      b  [        US1/[        US0/5      5        [        US2/5      b#  [        US3/[        [        US2/5      XC5      5        [        US4/5      b  [        S55      e[        US6/5      b  [        US7/[        US6/5      5        [        US8/5      b  [        US9/[        US8/5      5        U$ s  snf s  snf ):Nr   r   r*  r+  r,  r-  r.  r/  r0  r1  r2  r3  r4  r5  r6  r7  r8  r9  r:  r;  r   r<  r=  r>  r?  r%  r&  r@  routingConfigrA  modelConfigrB  rC  r   rD  rE  r   rG  rH  rI  rJ  rK  rL  rM  rN  rO  audioTimestamprP  rQ  rR  rS  rT  ]enable_enhanced_civic_answers parameter is not supported in Gemini Enterprise Agent Platform.rV  modelArmorConfigrW  rX  )r7   r8   rf   rc   r   rY  r[  r   r]  _ToolConfig_to_vertexr_  _SpeechConfig_to_vertexr`  _ImageConfig_to_vertexr   rg   s         r!    _GenerateContentConfig_to_vertexrl  W  s<    !)	+,-.:	KK[+?*@AB	
 
+'3]OT+%GH	+y!-VHd;	:;	+y!-VHd;	:;	+)*+7%&[;L:M(NO	++,-9%&[;N:O(P 
+()*6_%tK:J9K'LM	++,-9	[./0 
+
|$0ZL${ZL"AB	+*+,8%&[;M:N(O 
++,-9	[./0 
+x ,VHd;9:	+,-.:	[/01 
+)*+7		

:tK2C1DEF 
+./0<	[123 
+()*6_%tK:J9K'LM	+012>	[345 
+)*+7	{->,?@A@$@A 
+y!-		 		*d;	.JK	
K AHHZ6	OK	
 
+'3	}o.		
 
+z".
Dxj$AB	+()*6		[+;*<=	
 
+-./;	[012 
+*+,8%&[;M:N(O 
+()5	d;0ABC	
 
+)*+7%&[;L:M(NO	+)*+7%&[;L:M(NO	+'(4	~./	
 
+789E
	& 
 
+,-.:	[/01 
+'(4kN;K)LM	q 	B	
s   3V ?*Vc                    0 n[        US/5      b/  [        USS/[        R                  " U [        US/5      5      5        [        US/5      bH  [        US/[        R                  " [        US/5      5       Vs/ s H  n[        XTU5      PM     sn5        [        US/5      b$  [        US/[        U [        US/5      XC5      5        U$ s  snf Nr`   ra   rb   r   r   )r7   r8   rc   rd   re   r{   rb  rg   s         r!   #_GenerateContentParameters_to_mldevro    s     !)	+y!-				*d;	:; 
+
|$0	 T+
|%DE	
E d{;E	
 
+z".	'[8*5y	
 
	
   9C
c                    0 n[        US/5      b/  [        USS/[        R                  " U [        US/5      5      5        [        US/5      bH  [        US/[        R                  " [        US/5      5       Vs/ s H  n[        XTU5      PM     sn5        [        US/5      b$  [        US/[        U [        US/5      XC5      5        U$ s  snf rn  )r7   r8   rc   rd   re   rf   rl  rg   s         r!   $_GenerateContentParameters_to_vertexrr  9  s     !)	+y!-				*d;	:; 
+
|$0	 T+
|%DE	
E t<E	
 
+z".	([8*5y	
 
	
rp  c                 l   0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b4  [        US/[        U S/5       Vs/ s H  n[        XCU5      PM     sn5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US	/[        U S/5      5        [        U S
/5      b  [        US/[        U S
/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ s  snf )Nrj   rk   
candidatesmodelVersionmodel_versionpromptFeedbackprompt_feedback
responseIdresponse_idr  r  modelStatusmodel_status)r7   r8   rY   rW   s        r!   #_GenerateContentResponse_from_mldevr}  ]  s_   
 !)	+)*+7'(${=N<O*P 
+~&2	 [<.9	
9 "$;?9	
 
+'(4_%tK.9I'JK	+()*6&'k<L;M)NO	+~&2]OT+~%FG	+()5%&[?:K(LM	+'3^$d;&HI	+	
s   D1c                 V   0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b)  [        US/[        U S/5       Vs/ s H  oDPM     sn5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US	/[        U S/5      5        [        U S
/5      b  [        US/[        U S
/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ s  snf )Nrj   rk   rt  
createTimecreate_timeru  rv  rw  rx  ry  rz  r  r  r]   rW   s        r!   $_GenerateContentResponse_from_vertexr    sN   
 !)	+)*+7'(${=N<O*P 
+~&2	{\N;<;$;< 
+~&2]OT+~%FG	+'(4_%tK.9I'JK	+()*6&'k<L;M)NO	+~&2]OT+~%FG	+()5%&[?:K(LM	% 	=s   D&c                    0 n[        U S/5      b  [        S5      e[        U S/5      b  [        S5      e[        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS	/[        U S/5      5        [        U S
/5      b  [        USS/[        U S
/5      5        [        U S/5      b  [        S5      e[        U S/5      b0  [        [        U S/5      5        [        USS/[        U S/5      5        [        U S/5      b0  [	        [        U S/5      5        [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        U/ SQ[        U S/5      5        [        U S/5      b  [        U/ SQ[        U S/5      5        [        U S/5      b  [        S5      e[        U S/5      b  [        S5      e[        U S/5      b  [        USS /[        U S/5      5        [        U S!/5      b  [        S"5      eU$ )#Nr   8output_gcs_uri parameter is not supported in Gemini API.r   z9negative_prompt parameter is not supported in Gemini API.r   r   r   r   r   r   r   r   .seed parameter is not supported in Gemini API.r   r   r   r   r   r   r   r   r   r   r   r   r   r   z7add_watermark parameter is not supported in Gemini API.r   rF  
image_sizesampleImageSizeenhance_promptz8enhance_prompt parameter is not supported in Gemini API.)r7   r   r8   r&   r"   r9   s       r!   _GenerateImagesConfig_to_mldevr    s   
 !)	+()*6
O
PP	+)*+7
C  
+*+,8	}%[-./ 
+'(4	}%[>*+ 
+()*6	'[+,- 
+x ,
E
FF	+-./;-[012 		'[012 
++,-9,[./0 		)*[./0 
+345A	01[678 
+,-.:	)*[/01 
+
|$0	z"[:,' 
+*+,83[-./ 
+456B=[789 
+()5
N
OO	+z".
G
HH	+~&2	()[<.) 
+()*6
O
PP	r#   c                 X   0 n[        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS	/[        U S/5      5        [        U S
/5      b  [        USS/[        U S
/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        U/ SQ[        U S/5      5        [        U S/5      b  [        U/ SQ[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS /[        U S/5      5        U$ )!Nr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  enhancePromptr]   r9   s       r!   _GenerateImagesConfig_to_vertexr    sY   
 !)	+()*6	|$[+,- 
+)*+7	'([,-. 
+*+,8	}%[-./ 
+'(4	}%[>*+ 
+()*6	'[+,- 
+x ,v.[6(0KL	+-./;	'[012 
++,-9	)*[./0 
+345A	01[678 
+,-.:	)*[/01 
+
|$0	z"[:,' 
+*+,83[-./ 
+456B=[789 
+()5	~&[?+, 
+z".
Dxj$AB	+~&2	()[<.) 
+()*6	'[+,- 
r#   c                    0 n[        US/5      b/  [        USS/[        R                  " U [        US/5      5      5        [        US/5      b  [        USS/[        US/5      5        [        US/5      b  [	        [        US/5      XC5        U$ Nr`   ra   r   r   r   )r7   r8   rc   rd   r  r   s        r!   "_GenerateImagesParameters_to_mldevr    s     !)	+y!-				*d;	:; 
+z".^X.[8*0MN	+z"."[8*%y 
r#   c                    0 n[        US/5      b/  [        USS/[        R                  " U [        US/5      5      5        [        US/5      b  [        USS/[        US/5      5        [        US/5      b  [	        [        US/5      XC5        U$ r  )r7   r8   rc   rd   r  r   s        r!   #_GenerateImagesParameters_to_vertexr    s     !)	+y!-				*d;	:; 
+z".^X.[8*0MN	+z".#[8*%y 
r#   c                 J   0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b4  [        US/[        U S/5       Vs/ s H  n[        XCU5      PM     sn5        [        U S/5      b$  [        US/[        [        U S/5      UU5      5        U$ s  snf Nrj   rk   r   r   positivePromptSafetyAttributes!positive_prompt_safety_attributes)r7   r8   _GeneratedImage_from_mldev_SafetyAttributes_from_mldevrW   s        r!   "_GenerateImagesResponse_from_mldevr    s    
 !)	+)*+7'(${=N<O*P 
+'3	 [=/:	
: 'tD:	
 
+89:F	,-$?@A	
 
#	
   B c                 J   0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b4  [        US/[        U S/5       Vs/ s H  n[        XCU5      PM     sn5        [        U S/5      b$  [        US/[        [        U S/5      UU5      5        U$ s  snf r  )r7   r8   r   _SafetyAttributes_from_vertexrW   s        r!   #_GenerateImagesResponse_from_vertexr    s    
 !)	+)*+7'(${=N<O*P 
+'3	 [=/:	
: (E:	
 
+89:F	,-%?@A	
 
#	
r  c                 >   0 n[        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        S5      e[        U S/5      b  [        S5      e[        U S/5      b  [        USS	/[        U S/5      5        [        U S
/5      b  [        S5      e[        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        S5      e[        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        S5      e[        U S/5      b$  [        USS/[        [        U S/5      X25      5        [        U S/5      b5  [        USS/[        U S/5       Vs/ s H  n[	        XCU5      PM     sn5        [        U S/5      b  [        S5      e[        U S /5      b  [        S!5      e[        U S"/5      b  [        S#5      e[        U S$/5      b  [        US%/[        U S$/5      5        [        U S&/5      b  [        S'5      eU$ s  snf )(Nnumber_of_videosr   r   r   r  fpsz-fps parameter is not supported in Gemini API.duration_secondsdurationSecondsr   r  r   r   
resolutionr   r   pubsub_topicz6pubsub_topic parameter is not supported in Gemini API.r   r   r  r  generate_audioz8generate_audio parameter is not supported in Gemini API.
last_framer   	lastFramer   r   maskz.mask parameter is not supported in Gemini API.compression_qualityz=compression_quality parameter is not supported in Gemini API.r   rF  webhook_configwebhookConfigresize_modez5resize_mode parameter is not supported in Gemini API.)r7   r8   r   _Image_to_mldev'_VideoGenerationReferenceImage_to_mldevrW   s        r!   _GenerateVideosConfig_to_mldevr  
  sF   
 !)	+*+,8	}%[-./ 
+()*6
O
PP	+w+
D
EE	+*+,8	()[-./ 
+x ,
E
FF	+'(4	}%[>*+ 
+~&2	|$[<.) 
++,-9	)*[./0 
+'(4
M
NN	+)*+7	'([,-. 
+()*6	'[+,- 
+()*6
O
PP	+~&2	%|n-y	
 
+*+,8	*+
 [+=*>?		
 @ 4 @		
	 
+x ,
E
FF	+-./;
G  
+z".
G
HH	+()*6(${=M<N*O 
+'3
L
MM	7	
s   0Jc                 B   0 n[        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S	/5      b  [        USS	/[        U S	/5      5        [        U S
/5      b  [        USS/[        U S
/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b$  [        USS/[        [        U S/5      X25      5        [        U S/5      b5  [        USS/[        U S/5       Vs/ s H  n[        XCU5      PM     sn5        [        U S/5      b$  [        USS/[	        [        U S/5      X25      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S /5      b  [        S!5      e[        U S"/5      b  [        USS#/[        U S"/5      5        U$ s  snf )$Nr  r   r   r   r   r  r  r  r   r   r   r  r   r   r  pubsubTopicr   r   r  r  r  generateAudior  r   r  r   r   r  r  r   r   r  zNwebhook_config parameter is not supported in Gemini Enterprise Agent Platform.r  
resizeMode)r7   r8   _Image_to_vertex(_VideoGenerationReferenceImage_to_vertex_VideoGenerationMask_to_vertexr   rW   s        r!   _GenerateVideosConfig_to_vertexr  |  s   
 !)	+*+,8	}%[-./ 
+()*6	|$[+,- 
+w+u-tK%/IJ	+*+,8	()[-./ 
+x ,v.[6(0KL	+'(4	}%[>*+ 
+~&2	|$[<.) 
++,-9	)*[./0 
+'(4	}%[>*+ 
+)*+7	'([,-. 
+()*6	'[+,- 
+()*6	'[+,- 
+~&2	%|n-y	
 
+*+,8	*+
 [+=*>?		
 @ 5 @		
	 
+x ,	 &vh'	
 
+-./;	+,[012 
+z".
Dxj$AB	+()*6
	 
 
+'3	|$[=/* 
Q	
s   ;Lc                    0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U SS/5      b%  [        US/[        [        U SS/5      UU5      5        [        U SS/5      b%  [        US/[        [        U SS/5      UU5      5        U$ )Nr   r  doneerrorr$  generateVideoResponseresult)r7   r8   "_GenerateVideosResponse_from_mldevr9   s       r!   #_GenerateVideosOperation_from_mldevr  	  s-   
 !)	+x ,VHd;9:	+
|$0ZL${ZL"AB	+x ,VHd;9:	+y!-WItK';<	+
$;<=I	*z+BCD	
 
+
$;<=I	
*z+BCD	
 
r#   c           
         0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S/5      b#  [        US/[        [        U S/5      X25      5        U$ )Nr   r  r  r  r$  r  )r7   r8   #_GenerateVideosResponse_from_vertexr9   s       r!   $_GenerateVideosOperation_from_vertexr  2	  s   
 !)	+x ,VHd;9:	+
|$0ZL${ZL"AB	+x ,VHd;9:	+y!-WItK';<	+
|$0	+zl+Y	
 
+
|$0	
+zl+Y	
 
r#   c                 0   0 n[        US/5      b/  [        USS/[        R                  " U [        US/5      5      5        [        US/5      b  [        USS/[        US/5      5        [        US/5      b$  [        USS/[	        [        US/5      XC5      5        [        US/5      b$  [        USS/[        [        US/5      XC5      5        [        US/5      b  [        [        US/5      XC5        [        US/5      b  [        [        US/5      XC5        U$ 	Nr`   ra   r   r   imagevideosourcer   )r7   r8   rc   rd   r  _Video_to_mldev_GenerateVideosSource_to_mldevr  r   s        r!   "_GenerateVideosParameters_to_mldevr  Y	  s/    !)	+y!-				*d;	:; 
+z".^X.[8*0MN	+y!-	![7)4iM 
+y!-	![7)4iM 
+z"."[8*%y 
+z"."[8*%y 
r#   c                 0   0 n[        US/5      b/  [        USS/[        R                  " U [        US/5      5      5        [        US/5      b  [        USS/[        US/5      5        [        US/5      b$  [        USS/[	        [        US/5      XC5      5        [        US/5      b$  [        USS/[        [        US/5      XC5      5        [        US/5      b  [        [        US/5      XC5        [        US/5      b  [        [        US/5      XC5        U$ r  )r7   r8   rc   rd   r  _Video_to_vertex_GenerateVideosSource_to_vertexr  r   s        r!   #_GenerateVideosParameters_to_vertexr  	  s/    !)	+y!-				*d;	:; 
+z".^X.[8*0MN	+y!-	!kG95yN 
+y!-	!kG95yN 
+z".#[8*%y 
+z".#[8*%y 
r#   c                 4   0 n[        U S/5      b4  [        US/[        U S/5       Vs/ s H  n[        XCU5      PM     sn5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ s  snf )NgeneratedSamplesgenerated_videosraiMediaFilteredCountrai_media_filtered_countraiMediaFilteredReasonsrai_media_filtered_reasons)r7   r8   _GeneratedVideo_from_mldevrW   s        r!   r  r  	  s    
 !)	+*+,8	 [+=*>?	
? 'tD?	
 
+/01=	#$[234 
+123?	%&[456 
)	
   Bc                 4   0 n[        U S/5      b4  [        US/[        U S/5       Vs/ s H  n[        XCU5      PM     sn5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ s  snf )Nvideosr  r  r  r  r  )r7   r8   _GeneratedVideo_from_vertexrW   s        r!   r  r  	  s    
 !)	+z".	 [8*5	
5 (E5	
 
+/01=	#$[234 
+123?	%&[456 
)	
r  c           
      "   0 n[        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b$  [        USS/[        [        U S/5      X25      5        [        U S/5      b$  [        USS/[        [        U S/5      X25      5        U$ Nr   r   r  r  )r7   r8   r  r  r9   s       r!   r  r  	  s    
 !)	+z".14hZ3P 
+y!-	![7)4iM 
+y!-	![7)4iM 
r#   c           
      "   0 n[        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b$  [        USS/[        [        U S/5      X25      5        [        U S/5      b$  [        USS/[        [        U S/5      X25      5        U$ r  )r7   r8   r  r  r9   s       r!   r  r  
  s    
 !)	+z".14hZ3P 
+y!-	!kG95yN 
+y!-	!kG95yN 
r#   c           
          0 n[        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S/5      b)  [        US/[        U S/5       Vs/ s H  oDPM     sn5        U$ s  snf )N_selfr  r   )r7   r8   _Image_from_vertexrW   s        r!   _GeneratedImageMask_from_vertexr  +
  s    
 !)	+y!-	wi()	
 
+z".H:kH:1NO1N1NO 
  Ps   A-c           
         0 n[        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b#  [        US/[        [        U S/5      X25      5        U$ )Nr  r  raiFilteredReasonrai_filtered_reasonsafety_attributes)r7   r8   _Image_from_mldevr  r9   s       r!   r  r  B
  s    
 !)	+y!-		${WI6	O 
++,-9	[./0 
+y!-	$wi()	
 
r#   c           
      j   0 n[        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S/5      b  [        US/[        U S/5      5        U$ )Nr  r  r  r  r  r   enhanced_prompt)r7   r8   r  r  r9   s       r!   r   r   b
  s    
 !)	+y!-		wi()	
 
++,-9	[./0 
+y!-	%wi()	
 
+z".&'kH:)FG	r#   c           
      l    0 n[        U S/5      b#  [        US/[        [        U S/5      X25      5        U$ )Nr  )r7   r8   _Video_from_mldevr9   s       r!   r  r  
  sC    
 !)	+y!-		${WI6	O 
r#   c           
      l    0 n[        U S/5      b#  [        US/[        [        U S/5      X25      5        U$ )Nr  r  )r7   r8   _Video_from_vertexr9   s       r!   r  r  
  sF    
 !)	+y!-		wi()	
 
r#   c           
         0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S	/5      b  [        US
/[        U S	/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b#  [        US /[        [        U S/5      X25      5        [        U S!/5      b  [        US"/[        U S!/5      5        [        U S#/5      b  [        US#/[        U S#/5      5        [        U S$/5      b  [        US%/[        U S$/5      5        [        U S&/5      b  [        US'/[        U S&/5      5        [        U S(/5      b  [        US)/[        U S(/5      5        [        U S*/5      b  [        S+5      eU$ ),NrA  re  r%  r&  rO  rf  r/  r0  enable_affective_dialogenableAffectiveDialogr:  r;  r7  r1  r2  rK  rL  r8  r9  r5  r6  r<  r=  rI  rJ  r>  r?  r@  rd  r   rM  rN  r3  r4  r*  rP  rQ  r-  r.  r+  r,  rT  rg  )r7   r8   rj  r   r9   s       r!   r   r   
  s"   
 !)	+012>	[345 
+./0<	[123 
+)*+7%&[;L:M(NO	+)*+7%&[;L:M(NO	+123?	 ![456 
++,-9	[./0 
+
|$0ZL${ZL"AB	++,-9%&[;N:O(P 
+*+,8%&[;M:N(O 
+*+,8%&[;M:N(O 
++,-9	[./0 
+,-.:	[/01 
+-./;	[012 
+)*+7%&[;L:M(NO	+()*6_%tK:J9K'LM	+x ,VHd;9:	+()5	/0)	
 
+()*6_%tK:J9K'LM	+'3]OT+%GH	+)*+7%&[;L:M(NO	+y!-VHd;	:;	+y!-VHd;	:;	+789E
	& 
 
r#   c                     0 n[        US/5      b/  [        USS/[        R                  " U [        US/5      5      5        U$ r   r   r   s        r!   _GetModelParameters_to_mldevr  "  r   r#   c                     0 n[        US/5      b/  [        USS/[        R                  " U [        US/5      5      5        U$ r   r   r   s        r!   _GetModelParameters_to_vertexr  3  r   r#   c           
          0 n[        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S/5      b  [        US/[        U S/5      5        U$ )Nauth_config
authConfigenable_widgetenableWidget)r7   r8   r;   r9   s       r!   _GoogleMaps_to_mldevr  D  so    
 !)	+'3	}o.		
 
+()5^$d;8I&JK	r#   c                 
   0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        S5      e[        U S/5      b  [        S5      e[        U S/5      b  [        US/[        U S/5      5        U$ )	Nsearch_typessearchTypesblocking_confidencez=blocking_confidence parameter is not supported in Gemini API.exclude_domainsz9exclude_domains parameter is not supported in Gemini API.time_range_filtertimeRangeFilterr6   r9   s       r!   _GoogleSearch_to_mldevr  Y  s    
 !)	+'(4]OT+7G%HI	+-./;
G  
+)*+7
C  
++,-9%&[;N:O(P 
r#   c                    0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        S5      e[        U S/5      b  [        S5      e[        U S	/5      b  [        S
5      e[        U S/5      b  [        S5      e[        U S/5      b  [        S5      eU$ )Nr   r   r  	imageSizer   z;person_generation parameter is not supported in Gemini API.prominent_peoplez:prominent_people parameter is not supported in Gemini API.r   z:output_mime_type parameter is not supported in Gemini API.r   zDoutput_compression_quality parameter is not supported in Gemini API.image_output_optionsz>image_output_options parameter is not supported in Gemini API.r6   r9   s       r!   ra  ra  t  s   
 !)	+'(4]OT+7G%HI	+~&2[M4l^#DE	++,-9
E  
+*+,8
D  
+*+,8
D  
+456B
N  
+./0<
H  
r#   c                 0   0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S	/5      b  [        US
S/[        U S	/5      5        [        U S/5      b  [        US
S/[        U S/5      5        [        U S/5      b  [        US
/[        U S/5      5        U$ )Nr   r   r  r   r   r   r  prominentPeopler   imageOutputOptionsrA   r   r   r  r]   r9   s       r!   rk  rk    s[   
 !)	+'(4]OT+7G%HI	+~&2[M4l^#DE	++,-9	[./0 
+*+,8%&[;M:N(O 
+*+,8	z*[-./ 
+456B	34[789 
+./0<	[123 
r#   c           
          0 n[        U S/5      b-  [        US/[        R                  " [        U S/5      5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )NbytesBase64Encodedimage_bytesrA   r@   r7   r8   base_tt_bytesr9   s       r!   r  r    so    
 !)	+,-.:	tK*>)?@A 
+
|$0[M4j\#BC	r#   c           
         0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b-  [        US/[        R                  " [        U S/5      5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )NgcsUrigcs_urir  r  rA   r@   r	  r9   s       r!   r  r    s    
 !)	+z".YKkH:!>?	+,-.:	tK*>)?@A 
+
|$0[M4j\#BC	r#   c           
          0 n[        U S/5      b  [        S5      e[        U S/5      b-  [        US/[        R                  " [        U S/5      5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )Nr  z1gcs_uri parameter is not supported in Gemini API.r  r  r@   rA   )r7   r   r8   r
  r  r9   s       r!   r  r    s    
 !)	+	{#/
H
II	+'3	tK-9: 
+}%1ZL${[M"BC	r#   c           
         0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b-  [        US/[        R                  " [        U S/5      5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )Nr  r  r  r  r@   rA   r	  r9   s       r!   r  r    s    
 !)	+	{#/XJ[9+ >?	+'3	tK-9: 
+}%1ZL${[M"BC	r#   c                 t   0 n[        US/5      b  [        USS/[        US/5      5        [        US/5      b  [        USS/[        US/5      5        [        US/5      b  [        USS/[        US/5      5        [        US/5      b/  [        USS	/[        R                  " U [        US/5      5      5        U$ 
N	page_size_querypageSize
page_token	pageTokenfilter
query_basera   
models_urlr7   r8   rc   t_models_urlr   s        r!   _ListModelsConfig_to_mldevr  "       !)	+}%1*-tK+/O 
+~&2	;[<.) 
+z".8,d;
.KL	+~&2		z4l^#DE 
r#   c                 t   0 n[        US/5      b  [        USS/[        US/5      5        [        US/5      b  [        USS/[        US/5      5        [        US/5      b  [        USS/[        US/5      5        [        US/5      b/  [        USS	/[        R                  " U [        US/5      5      5        U$ r  r  r   s        r!   _ListModelsConfig_to_vertexr   C  r  r#   c                 V    0 n[        US/5      b  [        U [        US/5      XC5        U$ Nr   )r7   r  r   s        r!   _ListModelsParameters_to_mldevr#  d  s8     !)	+z".Dxj19 
r#   c                 V    0 n[        US/5      b  [        U [        US/5      XC5        U$ r"  )r7   r   r   s        r!   _ListModelsParameters_to_vertexr%  s  s8     !)	+z".Dxj19 
r#   c                 \   0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      bH  [        US/[        R                  " [        U S/5      5       Vs/ s H  n[	        XCU5      PM     sn5        U$ s  snf Nrj   rk   nextPageTokennext_page_tokenr  models)r7   r8   rc   t_extract_models_Model_from_mldevrW   s        r!   _ListModelsResponse_from_mldevr-    s    
 !)	+)*+7'(${=N<O*P 
+()5&'kO;L)MN	+y!-	
 **4gY+GH	
H d{;H	
 
	
   
B)c                 \   0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      bH  [        US/[        R                  " [        U S/5      5       Vs/ s H  n[	        XCU5      PM     sn5        U$ s  snf r'  )r7   r8   rc   r+  _Model_from_vertexrW   s        r!   _ListModelsResponse_from_vertexr1    s    
 !)	+)*+7'(${=N<O*P 
+()5&'kO;L)MN	+y!-	
 **4gY+GH	
H t<H	
 
	
r.  c                     0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )N	mask_modemaskModesegmentation_classesmaskClassesmask_dilationdilationr]   r9   s       r!   _MaskReferenceConfig_to_vertexr9    s    
 !)	+}%1ZL${[M"BC	+./0<M?D7M6N$O 
+()5ZL${_4E"FG	r#   c                     0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US	/[        U S/5      5        [        U S
/5      b  [        US/[        U S
/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )Nr   displayNamer>   r!  versionr  tuned_model_infoinputTokenLimitinput_token_limitoutputTokenLimitoutput_token_limitsupportedGenerationMethodssupported_actionsr*  maxTemperaturemax_temperaturer,  r+  r.  r-  thinkingr]   r9   s       r!   r,  r,    s)   
 !)	+x ,VHd;9:	+'3^$d;&HI	+'3]OT+%GH	+	{#/YKkI;!?@	+y!-'(${WI*FG	+)*+7'(${=N<O*P 
+*+,8	[-./ 
+456B	[789 
+'3]OT+%GH	+()*6&'k<L;M)NO	+x ,WItK&:;	+x ,WItK&:;	+
|$0ZL${ZL"AB	r#   c                 F   0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b4  [        US/[        U S/5       Vs/ s H  n[        XCU5      PM     sn5        [        U S	/5      b  [        US	/[        U S	/5      5        [        U S
/5      b#  [        US/[        [        U S
/5      X25      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b)  [        US/[        U S/5       Vs/ s H  oDPM     sn5        U$ s  snf s  snf )Nr   r;  r>   r!  	versionIdr<  deployedModels	endpointsr   r  r=  defaultCheckpointIddefault_checkpoint_idcheckpoints)r7   r8   r  _TunedModelInfo_from_vertexrW   s        r!   r0  r0    s   
 !)	+x ,VHd;9:	+'3^$d;&HI	+'3]OT+%GH	+}%1YKkK=!AB	+()*6	 [+;*<=	
= "$;?=	
 
+z".XJ[8* =>	+y!-	#wi()	
 
+-./;	 ![012 
+'3	{]O<=<$<= 
A	
: 	>s   FFc                     0 n[        U S/5      b4  [        US/[        U S/5       Vs/ s H  n[        XCU5      PM     sn5        U$ s  snf )Nspeaker_voice_configsspeakerVoiceConfigs)r7   r8   _SpeakerVoiceConfig_to_vertexrW   s        r!   "_MultiSpeakerVoiceConfig_to_vertexrS  ?  sg    
 !)	+/01=	 [+B*CD	
D *$;GD	
 
	
   Ac           
         0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S	/5      b#  [        US
/[        [        U S	/5      X25      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b#  [        US/[	        [        U S/5      X25      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )NrK  rL  code_execution_resultcodeExecutionResultexecutable_codeexecutableCode	file_datafileDatafunction_callfunctionCallfunction_responsefunctionResponseinline_data
inlineDatatextthoughtthought_signaturethoughtSignaturevideo_metadatavideoMetadata	tool_calltoolCalltool_responsetoolResponsepart_metadatapartMetadata)r7   r8   r  r  rB   r9   s       r!   rz   rz   R  s   
 !)	+*+,8%&[;M:N(O 
+/01=	[234 
+)*+7%&[;L:M(NO	+}%1	{m,i	
 
+()5	/0)	
 
++,-9	[./0 
+'3	}o.		
 
+x ,VHd;9:	+	{#/YKkI;!?@	++,-9	[./0 
+()*6_%tK:J9K'LM	+}%1ZL${[M"BC	+()5^$d;8I&JK	+()5^$d;8I&JK	r#   c                    0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S	/5      b  [        US
/[        U S	/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        S5      e[        U S/5      b  [        S5      e[        U S/5      b  [        S5      eU$ )NrK  rL  rV  rW  rX  rY  rZ  r[  r\  r]  r^  r_  r`  ra  rb  rc  rd  re  rf  rg  rh  zItool_call parameter is not supported in Gemini Enterprise Agent Platform.rj  zMtool_response parameter is not supported in Gemini Enterprise Agent Platform.rl  zMpart_metadata parameter is not supported in Gemini Enterprise Agent Platform.r6   r9   s       r!   r~   r~     sY   
 !)	+*+,8%&[;M:N(O 
+/01=	[234 
+)*+7%&[;L:M(NO	+}%1ZL${[M"BC	+()5^$d;8I&JK	++,-9	[./0 
+'3\ND}o$FG	+x ,VHd;9:	+	{#/YKkI;!?@	++,-9	[./0 
+()*6_%tK:J9K'LM	+}%1
	 
 
+()5
	 
 
+()5
	 
 
r#   c           
      l    0 n[        U S/5      b#  [        US/[        [        U S/5      X25      5        U$ )Nproduct_imager  r7   r8   r  r9   s       r!   _ProductImage_to_vertexrr    sH    
 !)	+()5		/0)	
 
r#   c                 x   0 n[        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S	/5      b  [        USS
/[        U S	/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        U/ SQ[        U S/5      5        [        U S/5      b  [        U/ SQ[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )Nr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r   r]   r9   s       r!   _RecontextImageConfig_to_vertexrt    s#   
 !)	+*+,8	}%[-./ 
+~&2	{#[<.) 
+()*6	|$[+,- 
+x ,v.[6(0KL	+-./;	'[012 
++,-9	)*[./0 
+()5	~&[?+, 
+*+,83[-./ 
+456B=[789 
+()*6	'[+,- 
+z".
Dxj$AB	r#   c                    0 n[        US/5      b/  [        USS/[        R                  " U [        US/5      5      5        [        US/5      b  [	        [        US/5      XC5        [        US/5      b  [        [        US/5      XC5        U$ Nr`   ra   r  r   )r7   r8   rc   rd   _RecontextImageSource_to_vertexrt  r   s        r!   #_RecontextImageParameters_to_vertexrx  P  s     !)	+y!-				*d;	:; 
+z".#[8*%y 
+z".#[8*%y 
r#   c                     0 n[        U S/5      b4  [        US/[        U S/5       Vs/ s H  n[        XCU5      PM     sn5        U$ s  snf )Nr   r   r   rW   s        r!   #_RecontextImageResponse_from_vertexrz  k  sc    
 !)	+'3	 [=/:	
: (E:	
 
	
rT  c                 N   0 n[        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b$  [        U/ SQ[        [        U S/5      X25      5        [        U S/5      b5  [        USS/[        U S/5       Vs/ s H  n[        XCU5      PM     sn5        U$ s  snf )Nr   r   person_image)r   personImager  product_imagesproductImages)r7   r8   r  rr  rW   s        r!   rw  rw  ~  s    
 !)	+z".14hZ3P 
+'(40~./	
 
+()*6	) [+;*<=	
= $D[A=	
 
	
s   B"c           
      h   0 n[        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S	/5      b#  [        US
/[	        [        U S	/5      X25      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )Nreference_imagereferenceImagereference_idreferenceIdreference_typereferenceTypemask_image_configmaskImageConfigcontrol_image_configcontrolImageConfigstyle_image_configstyleImageConfigsubject_image_configsubjectImageConfig)r7   r8   r  r9  r   r9   s       r!   r   r     sz   
 !)	+)*+7	012I	
 
+'(4]OT+7G%HI	+()*6_%tK:J9K'LM	++,-9	&234i	
 
+./0<	)567	
 
+,-.:	[/01 
+./0<	[123 
r#   c                 
   0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        S5      e[        U S/5      b  [        S5      eU$ )	Nr@   rA   voice_sample_audiovoiceSampleAudioconsent_audiozMconsent_audio parameter is not supported in Gemini Enterprise Agent Platform.voice_consent_signaturezWvoice_consent_signature parameter is not supported in Gemini Enterprise Agent Platform.r6   r9   s       r!    _ReplicatedVoiceConfig_to_vertexr    s    
 !)	+}%1ZL${[M"BC	+,-.:	[/01 
+()5
	 
 
+123?
	& 
 
r#   c           	          0 n[        U SS/5      b  [        US/[        U SS/5      5        [        U SS/5      b  [        US/[        U SS/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ NsafetyAttributes
categoriesscorescontentTypecontent_typer]   r9   s       r!   r  r        
 !)	+*L9:F	[-|<= 
+*H56BH:tK2Dh1OP 
+'3^$d;&HI	r#   c           	          0 n[        U SS/5      b  [        US/[        U SS/5      5        [        U SS/5      b  [        US/[        U SS/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ r  r]   r9   s       r!   r  r    r  r#   c                     0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        S5      e[        U S/5      b  [        US/[        U S/5      5        U$ )Ncategorymethodz0method parameter is not supported in Gemini API.	thresholdr6   r9   s       r!   rZ  rZ  &  sv    
 !)	+
|$0ZL${ZL"AB	+z".
G
HH	+}%1[M4k]#CD	r#   c           
      l    0 n[        U S/5      b#  [        US/[        [        U S/5      X25      5        U$ )Nr  rq  r9   s       r!   _ScribbleImage_to_vertexr  8  sC    
 !)	+y!-		kG95yN 
r#   c                    0 n[        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S	/5      b  [        USS
/[        U S	/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )Nr  r   max_predictionsmaxPredictionsconfidence_thresholdconfidenceThresholdr7  maskDilationbinary_color_thresholdbinaryColorThresholdr   r]   r9   s       r!   _SegmentImageConfig_to_vertexr  H  s/   
 !)	+x ,v.[6(0KL	+)*+7	'([,-. 
+./0<	,-[123 
+()5	~&[?+, 
+012>	-.[345 
+z".
Dxj$AB	r#   c                    0 n[        US/5      b/  [        USS/[        R                  " U [        US/5      5      5        [        US/5      b  [	        [        US/5      XC5        [        US/5      b  [        [        US/5      XC5        U$ rv  )r7   r8   rc   rd   _SegmentImageSource_to_vertexr  r   s        r!   !_SegmentImageParameters_to_vertexr  t  s     !)	+y!-				*d;	:; 
+z".![8*%y 
+z".![8*%y 
r#   c                     0 n[        U S/5      b4  [        US/[        U S/5       Vs/ s H  n[        XCU5      PM     sn5        U$ s  snf )Nr   generated_masks)r7   r8   r  rW   s        r!   !_SegmentImageResponse_from_vertexr    sc    
 !)	+'3	 [=/:	
: ,D[I:	
 
	
rT  c           
      "   0 n[        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b$  [        USS/[        [        U S/5      X25      5        [        U S/5      b$  [        USS/[        [        U S/5      X25      5        U$ )Nr   r   r  scribble_imagescribble)r7   r8   r  r  r9   s       r!   r  r    s    
 !)	+z".14hZ3P 
+y!-	!kG95yN 
+()*6	$ /019	
 
r#   c           
          0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b#  [        US/[        [        U S/5      X25      5        U$ )Nspeakervoice_configvoiceConfig)r7   r8   _VoiceConfig_to_vertexr9   s       r!   rR  rR    sn    
 !)	+	{#/YKkI;!?@	+'(4	~./	
 
r#   c           
         0 n[        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b$  [        US/[        [        U S/5      UU5      5        U$ )Nr  r  language_codelanguageCodemulti_speaker_voice_configmultiSpeakerVoiceConfig)r7   r8   r  rS  r9   s       r!   rj  rj    s    
 !)	+'(4	~./	
 
+()5^$d;8I&JK	+456B	"#*;<=	
 
r#   c           
      
   0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b$  [        US/[        [        U S/5      UU5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )Nretrieval_configretrievalConfigfunction_calling_configfunctionCallingConfig$include_server_side_tool_invocations includeServerSideToolInvocations)r7   r8   r  r9   s       r!   r^  r^    s    
 !)	+*+,8%&[;M:N(O 
+123?	 !'89:	
 
+>?@L	+,[ABC 
r#   c                     0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        S5      eU$ )Nr  r  r  r  r  zdinclude_server_side_tool_invocations parameter is not supported in Gemini Enterprise Agent Platform.r6   r9   s       r!   ri  ri    s    
 !)	+*+,8%&[;M:N(O 
+123?	 ![456 
+>?@L
	- 
 
r#   c           
         0 n[        U S/5      b  [        S5      e[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S	/5      b#  [        US
/[	        [        U S	/5      X25      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        S5      e[        U S/5      b)  [        US/[        U S/5       Vs/ s H  oDPM     sn5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        S5      e[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b)  [        US/[        U S/5       Vs/ s H  oDPM     sn5        U$ s  snf s  snf )N	retrievalz3retrieval parameter is not supported in Gemini API.computer_usecomputerUsefile_search
fileSearchgoogle_searchgoogleSearchgoogle_maps
googleMapscode_executioncodeExecutionenterprise_web_searchz?enterprise_web_search parameter is not supported in Gemini API.function_declarationsfunctionDeclarationsgoogle_search_retrievalgoogleSearchRetrievalparallel_ai_searchz<parallel_ai_search parameter is not supported in Gemini API.url_context
urlContextmcp_servers
mcpServers)r7   r   r8   r  r  rW   s        r!   r\  r\  0  s>   
 !)	+}%1
J
KK	+'(4]OT+7G%HI	+'3\ND}o$FG	+()5	/0)	
 
+'3	}o.		
 
+()*6_%tK:J9K'LM	+/01=
I  
+/01=	 {-D,EFGF$FG 
+123?	 ![456 
+,-.:
F  
+'3\ND}o$FG	+'3	{]O<=<$<= 
3 	H, 	>s   1G#G(c                    0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        S5      e[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US	/[        U S/5      5        [        U S
/5      b  [        US/[        U S
/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b4  [        US/[        U S/5       Vs/ s H  n[        XCU5      PM     sn5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        S5      eU$ s  snf )Nr  r  r  r  zKfile_search parameter is not supported in Gemini Enterprise Agent Platform.r  r  r  r  r  r  r  enterpriseWebSearchr  r  r  r  r  parallelAiSearchr  r  r  zKmcp_servers parameter is not supported in Gemini Enterprise Agent Platform.)r7   r8   r   r(  rW   s        r!   r   r   y  s1   
 !)	+}%1[M4k]#CD	+'(4]OT+7G%HI	+'3
	 
 
+()5^$d;8I&JK	+'3\ND}o$FG	+()*6_%tK:J9K'LM	+/01=	[234 
+/01=	  [+B*CD	
D +4KHD	
 
+123?	 ![456 
+,-.:	[/01 
+'3\ND}o$FG	+'3
	 
 
;	
s   +Gc           	          0 n[        U SS/5       b  [        US/[        U SS/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )Nr   z&google-vertex-llm-tuning-base-model-id
base_modelr  r  
updateTimeupdate_timer]   r9   s       r!   rN  rN    s    
 !)
;#KLM 		[8%MNO 
+~&2]OT+~%FG	+~&2]OT+~%FG	r#   c                     0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ Nr>   r;  r!  rL  rK  r]   r9   s       r!   _UpdateModelConfig_to_mldevr        
 !)	+'(4kN;K)LM	+'3kM?)KL	+/01=	[234 
r#   c                     0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ r  r]   r9   s       r!   _UpdateModelConfig_to_vertexr    r  r#   c                     0 n[        US/5      b/  [        USS/[        R                  " U [        US/5      5      5        [        US/5      b  [	        [        US/5      XC5        U$ )Nr`   ra   r   r   )r7   r8   rc   rd   r  r   s        r!   _UpdateModelParameters_to_mldevr    sq     !)	+y!-				*d;	:; 
+z".[8*%y 
r#   c                     0 n[        US/5      b/  [        USS/[        R                  " U [        US/5      5      5        [        US/5      b  [	        [        US/5      XC5        U$ )Nr`   ra   r   )r7   r8   rc   rd   r  r   s        r!    _UpdateModelParameters_to_vertexr    sq     !)	+y!-				*d;	:; 
+z". [8*%y 
r#   c                 x   0 n[        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS	/[        U S/5      5        [        U S
/5      b  [        U/ SQ[        U S
/5      5        [        U S/5      b  [        U/ SQ[        U S/5      5        [        U S/5      b  [        U/ SQ[        U S/5      5        [        U S/5      b  [        U/ SQ[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        U$ )Nr   r   r   r   r   r   r   r   r   r   r   r   r   enhance_input_image)r   upscaleConfigenhanceInputImageimage_preservation_factor)r   r  imagePreservationFactorr   r   r   r  r]   r9   s       r!    _UpscaleImageAPIConfig_to_vertexr  2  s    
 !)	+()*6	|$[+,- 
+-./;	'[012 
++,-9	)*[./0 
+,-.:	)*[/01 
+*+,83[-./ 
+456B=[789 
+-./;<[012 
+345AB[678 
+z".
Dxj$AB	+*+,8	}%[-./ 
+x ,v.[6(0KL	r#   c                    0 n[        US/5      b/  [        USS/[        R                  " U [        US/5      5      5        [        US/5      b$  [        USS/[	        [        US/5      XC5      5        [        US/5      b  [        U/ SQ[        US/5      5        [        US/5      b  [        [        US/5      XC5        U$ )Nr`   ra   r  r   upscale_factor)r   r  upscaleFactorr   )r7   r8   rc   rd   r  r  r   s        r!   $_UpscaleImageAPIParameters_to_vertexr    s     !)	+y!-				*d;	:; 
+y!-	!kG95yN 
+()*68[+,- 
+z".$[8*%y 
r#   c                     0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b4  [        US/[        U S/5       Vs/ s H  n[        XCU5      PM     sn5        U$ s  snf r   r   rW   s        r!   !_UpscaleImageResponse_from_vertexr    r   r   c           
          0 n[        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S/5      b  [        US/[        U S/5      5        U$ )Nr  r  r3  r4  rq  r9   s       r!   r  r    si    
 !)	+y!-		kG95yN 
+}%1ZL${[M"BC	r#   c           
          0 n[        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S/5      b/  [        [        U S/5      5        [        US/[        U S/5      5        U$ Nr  r  r  )r7   r8   r  r)   r9   s       r!   r  r    s    
 !)	+y!-		[7)4iM 
+()*68[+,- 	_%tK:J9K'LM	r#   c           
          0 n[        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S/5      b  [        US/[        U S/5      5        U$ r  rq  r9   s       r!   r  r    sn    
 !)	+y!-		kG95yN 
+()*6_%tK:J9K'LM	r#   c           
         0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b-  [        US/[        R                  " [        U S/5      5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )NuriencodedVideovideo_bytesencodingr@   r	  r9   s       r!   r  r    s    
 !)	+w+UGT+w78	+'(4	tK.)9:; 
+
|$0[M4j\#BC	r#   c           
         0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b-  [        US/[        R                  " [        U S/5      5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )Nr  r  r  r  rA   r@   r	  r9   s       r!   r  r    s    
 !)	+z".UGT+z:;	+,-.:	tK*>)?@A 
+
|$0[M4j\#BC	r#   c           
         0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b-  [        US/[        R                  " [        U S/5      5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )Nr  r  r  r@   r  r	  r9   s       r!   r  r  %  s    
 !)	+w+UGT+w78	+'3	tK-9: 
+}%1ZL${[M"BC	r#   c           
         0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b-  [        US/[        R                  " [        U S/5      5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )Nr  r  r  r  r@   rA   r	  r9   s       r!   r  r  ;  s    
 !)	+w+XJ[5' :;	+'3	tK-9: 
+}%1ZL${[M"BC	r#   c           
          0 n[        U S/5      b$  [        US/[        [        U S/5      UU5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )Nreplicated_voice_configreplicatedVoiceConfigprebuilt_voice_configprebuiltVoiceConfig)r7   r8   r  r9   s       r!   r  r  Q  s    
 !)	+123?	 !(89:	
 
+/01=	[234 
r#   c                   X
   \ rS rSrSS.S\S\\R                  \R                  4   S\	\R                     S\R                  4S jjrSS.S\S\\R                  \R                  4   S\	\R                     S\\R                     4S	 jjrSSSSS
.S\S\	\\R                  \R                  4      S\	\\R                  \R                   4      S\	\R"                     S\	\R$                     S\R&                  4S jjrSS.S\S\S\	\R*                     S\R,                  4S jjrSS.S\S\S\\R2                     S\	\R4                     S\R6                  4
S jjrSS.S\S\R:                  S\S\	\R<                     S\R>                  4
S jjr SS.S\S\RB                  S\	\RD                     S\RF                  4S jjr$SS.S\S\RJ                  S\	\RL                     S\RN                  4S jjr(SS.S\S\	\RR                     S\RT                  4S jjr+SS.S\	\RX                     S\RZ                  4S jjr.SS.S\S\	\R^                     S\RT                  4S jjr0SS.S\S\	\Rb                     S\Rd                  4S jjr3SS.S\S\\R                  \R                  4   S\	\Rh                     S\Rj                  4S jjr6SS.S\S\\R                  \R                  4   S\	\Rn                     S\Rp                  4S jjr9SSSSSS.S\S\	\   S\	\R:                     S\	\Rt                     S\	\Rv                     S\	\Rx                     S\Rz                  4S  jjr>SS.S\S\\R                  \R                  4   S\	\R$                     S\R&                  4S! jjr?SS.S\S\R                  S\	\R                     S\R                  4S" jjr@SS.S\S\R                  S\	\R                     S\\R                     4S# jjrASS.S\S\S\	\R*                     S\R,                  4S$ jjrBSS.S\S\S\\R2                     S\	\R4                     S\R6                  4
S% jjrCSS.S\S\R:                  S\S\	\R                     S\R>                  4
S& jjrESSSSSS.S\S\	\   S\	\R:                     S\	\Rt                     S\	\Rv                     S\	\Rx                     S\Rz                  4S' jjrFSS.S\	\RX                     S\G\RT                     4S( jjrS)rHg)*Modelsil  Nr   r`   rb   r   r   c                   [         R                  " UUUS9nU R                  R                  (       aE  [	        U R                  US U5      nUR                  S5      nU(       a  SR                  U5      nOGSnOD[        U R                  US U5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       a  U S[        U5       3nUR                  SS 5        S n	UR                  b-  UR                  R                  b  UR                  R                  n	[        R                  " U5      n[        R                  " U5      nU R                  R                  SXuU	5      n
UbC  [!        USS 5      (       a1  [         R"                  " U
S	9nU R                  R%                  U5        U$ U
R&                  (       d  0 O[(        R*                  " U
R&                  5      nU R                  R                  (       a  [-        US U5      nU R                  R                  (       d  [/        US U5      n[         R"                  R1                  U[!        USS 5      (       aG  S[!        UR                  S
S 5      [!        UR                  SS 5      [!        UR                  SS 5      S.0O0 S9n[         R2                  " U
R4                  S9Ul        U R                  R%                  U5        U$ Nr`   rb   r   ra   z{model}:generateContentr  ?r   postshould_return_http_response)rk   r>  r%  include_all_fieldsr>  r%  r  r$  kwargsheaders)r   _GenerateContentParameters_api_clientvertexairr  r  
format_mapro  r	   popr   http_optionsr   convert_to_dictencode_unserializable_typesrequestgetattrGenerateContentResponse_verify_responsebodyjsonloadsr  r}  _from_responseHttpResponser  rk   selfr`   rb   r   parameter_modelrequest_dictrequest_url_dictpathquery_paramsr!  r$  return_valueresponse_dicts                r!   _generate_contentModels._generate_contentn  s    66O   9


OT?l &))&1	(334DE(8


OT?l &))&1	(334DE(##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''LH g-t  22XNl
''5&mmBHMM1JM  :
m $$9
m 00?? ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! @ L$ &+%7%7  &L" 	%%l3r#   c             #     #    [         R                  " UUUS9nU R                  R                  (       aE  [	        U R                  US U5      nUR                  S5      nU(       a  SR                  U5      nOGSnOD[        U R                  US U5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       a  U S[        U5       3nUR                  SS 5        S n	UR                  b-  UR                  R                  b  UR                  R                  n	[        R                  " U5      n[        R                  " U5      nUb  [        USS 5      (       a  [!        S5      eU R                  R#                  S	XuU	5       GH@  n
U
R$                  (       d  0 O[&        R(                  " U
R$                  5      nU R                  R                  (       a  [+        US U5      nU R                  R                  (       d  [-        US U5      n[         R.                  R1                  U[        USS 5      (       aG  S[        UR                  S
S 5      [        UR                  SS 5      [        UR                  SS 5      S.0O0 S9n[         R2                  " U
R4                  S9Ul        U R                  R9                  U5        Uv   GMC     g 7f)Nr  ra   %{model}:streamGenerateContent?alt=sser  r  r   r  FAccessing the raw HTTP response is not supported in streaming methods.r  r>  r%  r  r  r  r  )r   r  r  r  rr  r  r  ro  r	   r   r   r!  r   r"  r#  r%  r   request_streamedr(  r)  r*  r  r}  r&  r+  r,  r  rk   r'  r.  r`   rb   r   r/  r0  r1  r2  r3  r!  r$  r5  r4  s                r!   _generate_content_streamModels._generate_content_stream  s     66O   9


OT?l &))&1	6AA
 78


OT?l &))&1	6AA
 7##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DLg-t   
 $$55L !)b4::hmm3Lm				"	"<4
 &&;4
 22AA  _h55 %,%,,.?& +2%,,.Dd+ )0%,,.BD)
 ! B l$ (-'9'9""(l$ ''5Ms   K K"rb   rD   r   r   rD   r   c                   [         R                  " UUUUUS9nU R                  R                  (       an  [	        U R                  USU5      nUR                  S5      n[        R                  " UR                  5      (       a  SOSn	U(       a  U	R                  U5      n
OGU	n
OD[        U R                  USU5      nUR                  S5      nU(       a  SR                  U5      n
OSn
UR                  S5      nU(       a  U
 S[        U5       3n
UR                  S	S5        SnUR                  b-  UR                  R                  b  UR                  R                  n[        R                   " U5      n[        R"                  " U5      nU R                  R%                  S
XU5      nUR&                  (       d  0 O[(        R*                  " UR&                  5      nU R                  R                  (       a  [-        USU5      nU R                  R                  (       d  [/        USU5      n[         R0                  R3                  U[5        US	S5      (       aG  S	[5        UR                  SS5      [5        UR                  SS5      [5        UR                  SS5      S.0O0 S9n[         R6                  " UR8                  S9Ul        U R                  R=                  U5        U$ )a  Calculates embeddings for the given contents. Only text is supported.

Args:
  model (str): The model to use.
  contents (list[Content]): The contents to embed.
  config (EmbedContentConfig): Optional configuration for embeddings.

Usage:

.. code-block:: python

  embeddings = client.models.embed_content(
      model= 'text-embedding-004',
      contents=[
          'What is your name?',
          'What is your favorite color?',
      ],
      config={
          'output_dimensionality': 64
      },
  )
r`   rb   rD   r   r   Nra   {model}:embedContent{model}:predict{model}:batchEmbedContentsr  r  r   r  r>  r%  r  r  r  r  )r   _EmbedContentParametersPrivater  r  r   r  rc   t_is_vertex_embed_content_modelr`   r  r   r	   r   r   r!  r   r"  r#  r$  r(  r)  r*  r
  r  EmbedContentResponser+  r%  r,  r  rk   r'  r.  r`   rb   rD   r   r   r/  r0  r1  endpoint_urlr2  r3  r!  r$  r5  r4  s                   r!   _embed_contentModels._embed_content3  s   H ::-O   =


OT?l &))&1/0/P/PQ`QfQf/g/g+m~l	&&'78<


OT?l &))&1	+667GH+##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''LH 'mmBHMM1JM  7
m $$6
m --<< ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! = L$ &+%7%7  &L" 	%%l3r#   r   c                h   [         R                  " UUUS9nU R                  R                  (       aE  [	        U R                  USU5      nUR                  S5      nU(       a  SR                  U5      nOGSnOD[        U R                  USU5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       a  U S[        U5       3nUR                  SS5        Sn	UR                  b-  UR                  R                  b  UR                  R                  n	[        R                  " U5      n[        R                  " U5      nU R                  R                  SXuU	5      n
U
R                   (       d  0 O["        R$                  " U
R                   5      nU R                  R                  (       a  ['        USU5      nU R                  R                  (       d  [)        USU5      n[         R*                  R-                  U[/        USS5      (       aG  S[/        UR                  S	S5      [/        UR                  S
S5      [/        UR                  SS5      S.0O0 S9n[         R0                  " U
R2                  S9Ul        U R                  R7                  U5        U$ )z%Private method for generating images.r`   r   r   Nra   rC  r  r  r   r  r>  r%  r  r  r  r  )r   _GenerateImagesParametersr  r  r  r  r  r  r	   r   r   r!  r   r"  r#  r$  r(  r)  r*  r  r  GenerateImagesResponser+  r%  r,  r  rk   r'  r.  r`   r   r   r/  r0  r1  r2  r3  r!  r$  r5  r4  s                r!   _generate_imagesModels._generate_images  s    55O   8


OT?l &))&1	 ++,<= 7


OT?l &))&1	 ++,<= ##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''LH 'mmBHMM1JM  9
m $$8
m //>> ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! ? L$ &+%7%7  &L" 	%%l3r#   r   c                   [         R                  " UUUUS9nU R                  R                  (       d  [	        S5      e[        U R                  USU5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      n	U	(       a  U S[        U	5       3nUR                  SS5        Sn
UR                  b-  UR                  R                  b  UR                  R                  n
[        R                  " U5      n[        R                  " U5      nU R                  R                  S	XU
5      nUR                   (       d  0 O["        R$                  " UR                   5      nU R                  R                  (       a  ['        USU5      n[         R(                  R+                  U[-        USS5      (       aG  S[-        UR                  S
S5      [-        UR                  SS5      [-        UR                  SS5      S.0O0 S9n[         R.                  " UR0                  S9Ul        U R                  R5                  U5        U$ )z$Private method for editing an image.r`   r   r   r   mThis method is only supported in the Gemini Enterprise Agent Platform (previously known as Vertex AI) client.Nra   rC  r  r  r   r  r>  r%  r  r  r  r  )r   _EditImageParametersr  r  r   r   r  r  r	   r   r   r!  r   r"  r#  r$  r(  r)  r*  r   EditImageResponser+  r%  r,  r  rk   r'  r.  r`   r   r   r   r/  r0  r1  r2  r3  r!  r$  r5  r4  s                 r!   _edit_imageModels._edit_image  s5    00)	O $$> 
 4


OT?l &))&1	 ++,<= ##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''LH 'mmBHMM1JM  4
m **99 ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! : L$ &+%7%7  &L" 	%%l3r#   r  r  c                   [         R                  " UUUUS9nU R                  R                  (       d  [	        S5      e[        U R                  USU5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      n	U	(       a  U S[        U	5       3nUR                  SS5        Sn
UR                  b-  UR                  R                  b  UR                  R                  n
[        R                  " U5      n[        R                  " U5      nU R                  R                  S	XU
5      nUR                   (       d  0 O["        R$                  " UR                   5      nU R                  R                  (       a  ['        USU5      n[         R(                  R+                  U[-        USS5      (       aG  S[-        UR                  S
S5      [-        UR                  SS5      [-        UR                  SS5      S.0O0 S9n[         R.                  " UR0                  S9Ul        U R                  R5                  U5        U$ )z&Private method for upscaling an image.r`   r  r  r   rU  Nra   rC  r  r  r   r  r>  r%  r  r  r  r  )r   _UpscaleImageAPIParametersr  r  r   r  r  r  r	   r   r   r!  r   r"  r#  r$  r(  r)  r*  r  UpscaleImageResponser+  r%  r,  r  rk   r'  r.  r`   r  r  r   r/  r0  r1  r2  r3  r!  r$  r5  r4  s                 r!   _upscale_imageModels._upscale_image[  s5    66%	O $$> 
 :


OT?l &))&1	 ++,<= ##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''LH 'mmBHMM1JM  7
m --<< ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! = L$ &+%7%7  &L" 	%%l3r#   r  c                ^   [         R                  " UUUS9nU R                  R                  (       d  [	        S5      e[        U R                  USU5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       a  U S[        U5       3nUR                  SS5        Sn	UR                  b-  UR                  R                  b  UR                  R                  n	[        R                  " U5      n[        R                  " U5      nU R                  R                  S	XuU	5      n
U
R                   (       d  0 O["        R$                  " U
R                   5      nU R                  R                  (       a  ['        USU5      n[         R(                  R+                  U[-        USS5      (       aG  S[-        UR                  S
S5      [-        UR                  SS5      [-        UR                  SS5      S.0O0 S9nU R                  R/                  U5        U$ )a  Recontextualizes an image.

There is one type of recontextualization currently supported:
1) Virtual Try-On: Generate images of persons modeling fashion products.

Args:
  model (str): The model to use.
  source (RecontextImageSource): An object containing the source inputs
    (prompt, person_image, product_images) for image recontext. prompt is
    behind an allowlist. person_image is required. product_images is
    required. Only one product image is supported currently.
  config (RecontextImageConfig): Configuration for recontextualization.

Usage:

  ```
  virtual_try_on_response = client.models.recontext_image(
      model="virtual-try-on-001",
      source=types.RecontextImageSource(
          person_image=types.Image.from_file(IMAGE1_FILE_PATH),
          product_images=[types.ProductImage.from_file(IMAGE2_FILE_PATH)],
      ),
      config=types.RecontextImageConfig(
          number_of_images=1,
      ),
  )
  image = virtual_try_on_response.generated_images[0].image
  ```
r`   r  r   rU  Nra   rC  r  r  r   r  r>  r%  r  r  r  )r   _RecontextImageParametersr  r  r   rx  r  r  r	   r   r   r!  r   r"  r#  r$  r(  r)  r*  rz  RecontextImageResponser+  r%  r'  r.  r`   r  r   r/  r0  r1  r2  r3  r!  r$  r5  r4  s                r!   recontext_imageModels.recontext_image  s   J 55O $$> 
 9


OT?l &))&1	 ++,<= ##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''LH 'mmBHMM1JM  9
m //>> ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! ? L& 	%%l3r#   c                ^   [         R                  " UUUS9nU R                  R                  (       d  [	        S5      e[        U R                  USU5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       a  U S[        U5       3nUR                  SS5        Sn	UR                  b-  UR                  R                  b  UR                  R                  n	[        R                  " U5      n[        R                  " U5      nU R                  R                  S	XuU	5      n
U
R                   (       d  0 O["        R$                  " U
R                   5      nU R                  R                  (       a  ['        USU5      n[         R(                  R+                  U[-        USS5      (       aG  S[-        UR                  S
S5      [-        UR                  SS5      [-        UR                  SS5      S.0O0 S9nU R                  R/                  U5        U$ )a  Segments an image, creating a mask of a specified area.

Args:
  model (str): The model to use.
  source (SegmentImageSource): An object containing the source inputs
    (prompt, image, scribble_image) for image segmentation. The prompt is
    required for prompt mode and semantic mode, disallowed for other modes.
    scribble_image is required for the interactive mode, disallowed for
    other modes.
  config (SegmentImageConfig): Configuration for segmentation.

Usage:

  ```
  response = client.models.segment_image(
      model="image-segmentation-001",
      source=types.SegmentImageSource(
          image=types.Image.from_file(IMAGE_FILE_PATH),
      ),
  )

  mask_image = response.generated_masks[0].mask
  ```
rc  rU  Nra   rC  r  r  r   r  r>  r%  r  r  r  )r   _SegmentImageParametersr  r  r   r  r  r  r	   r   r   r!  r   r"  r#  r$  r(  r)  r*  r  SegmentImageResponser+  r%  r'  rf  s                r!   segment_imageModels.segment_image  s   @ 33O $$> 
 7


OT?l &))&1	 ++,<= ##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''LH 'mmBHMM1JM  7
m --<< ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! = L& 	%%l3r#   c                    [         R                  " UUS9nU R                  R                  (       aE  [	        U R                  US U5      nUR                  S5      nU(       a  SR                  U5      nOGSnOD[        U R                  US U5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       a  U S[        U5       3nUR                  SS 5        S nUR                  b-  UR                  R                  b  UR                  R                  n[        R                  " U5      n[        R                  " U5      nU R                  R                  SXdU5      n	U	R                   (       d  0 O["        R$                  " U	R                   5      n
U R                  R                  (       a  ['        U
S U5      n
U R                  R                  (       d  [)        U
S U5      n
[         R*                  R-                  U
[/        USS 5      (       aG  S[/        UR                  SS 5      [/        UR                  S	S 5      [/        UR                  S
S 5      S.0O0 S9nU R                  R1                  U5        U$ Nr`   r   ra   {name}r  r  r   r  r>  r%  r  r  r  )r   _GetModelParametersr  r  r  r  r  r  r	   r   r   r!  r   r"  r#  r$  r(  r)  r*  r0  r,  Modelr+  r%  r'  r.  r`   r   r/  r0  r1  r2  r3  r!  r$  r5  r4  s               r!   r  
Models.get  sS    //O   2


OT?l &))&1	""#341


OT?l &))&1	""#34##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''t<PH&mmBHMM1JM  (oNm$$'t_Mm;;-- ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! . L& 	%%l3r#   c                    [         R                  " US9nU R                  R                  (       aE  [	        U R                  US U5      nUR                  S5      nU(       a  SR                  U5      nOGSnOD[        U R                  US U5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       aG  UR                  S5      (       a1  UR                  S5      nU SU 3nU(       a  US[        U5       3-  nOU(       a  U S[        U5       3nUR                  S	S 5        S nUR                  b-  UR                  R                  b  UR                  R                  n[        R                  " U5      n[        R                  " U5      nU R                  R                  S
XSU5      n	U	R                   (       d  0 O["        R$                  " U	R                   5      n
U R                  R                  (       a  ['        U
S U5      n
U R                  R                  (       d  [)        U
S U5      n
[         R*                  R-                  U
[/        US	S 5      (       aG  S	[/        UR                  SS 5      [/        UR                  SS 5      [/        UR                  SS 5      S.0O0 S9n[         R0                  " U	R2                  S9Ul        U R                  R7                  U5        U$ Nr  ra   z{models_url}r  r  z?filter=&r  r   r  r>  r%  r  r  r  r  )r   _ListModelsParametersr  r  r%  r  r  r#  r   r	   r   r!  r   r"  r#  r$  r(  r)  r*  r1  r-  ListModelsResponser+  r%  r,  r  rk   r'  r.  r   r/  r0  r1  r2  r3  query_param_filterr!  r$  r5  r4  s               r!   _listModels._list  s    11O   4


OT?l &))&1	(()9:3


OT?l &))&1	(()9:##H-L((22'++H5vX012d	!Il+,--	vQy./0dXt$04L*""//;$++88l**<8L66|DL''t<PH&mmBHMM1JM  5
m $$4
m ++:: ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! ; L$ &+%7%7  &L" 	%%l3r#   c                    [         R                  " UUS9nU R                  R                  (       aE  [	        U R                  US U5      nUR                  S5      nU(       a  SR                  U5      nOGSnOD[        U R                  US U5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       a  U S[        U5       3nUR                  SS 5        S nUR                  b-  UR                  R                  b  UR                  R                  n[        R                  " U5      n[        R                  " U5      nU R                  R                  SXdU5      n	U	R                   (       d  0 O["        R$                  " U	R                   5      n
U R                  R                  (       a  ['        U
S U5      n
U R                  R                  (       d  [)        U
S U5      n
[         R*                  R-                  U
[/        USS 5      (       aG  S[/        UR                  S	S 5      [/        UR                  S
S 5      [/        UR                  SS 5      S.0O0 S9nU R                  R1                  U5        U$ Nrp  ra   z{model}rq  r  r  r   patchr>  r%  r  r  r  )r   _UpdateModelParametersr  r  r  r  r  r  r	   r   r   r!  r   r"  r#  r$  r(  r)  r*  r0  r,  rs  r+  r%  r'  rt  s               r!   updateModels.update$  sX    22O   5


OT?l &))&1	##$454


OT?l &))&1	""#34##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''\H 'mmBHMM1JM  (oNm$$'t_Mm;;-- ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! . L& 	%%l3r#   c                f   [         R                  " UUS9nU R                  R                  (       aE  [	        U R                  US U5      nUR                  S5      nU(       a  SR                  U5      nOGSnOD[        U R                  US U5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       a  U S[        U5       3nUR                  SS 5        S nUR                  b-  UR                  R                  b  UR                  R                  n[        R                  " U5      n[        R                  " U5      nU R                  R                  SXdU5      n	U	R                   (       d  0 O["        R$                  " U	R                   5      n
U R                  R                  (       a  ['        U
S U5      n
U R                  R                  (       d  [)        U
S U5      n
[         R*                  R-                  U
[/        USS 5      (       aG  S[/        UR                  SS 5      [/        UR                  S	S 5      [/        UR                  S
S 5      S.0O0 S9n[         R0                  " U	R2                  S9Ul        U R                  R7                  U5        U$ Nrp  ra   rq  r  r  r   deleter>  r%  r  r  r  r  )r   _DeleteModelParametersr  r  r   r  r  r   r	   r   r   r!  r   r"  r#  r$  r(  r)  r*  r   r   DeleteModelResponser+  r%  r,  r  rk   r'  rt  s               r!   r  Models.deleteu  s    22O   5


OT?l &))&1	""#344


OT?l &))&1	""#34##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''$lH 'mmBHMM1JM  6
m $$5
m ,,;; ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! < L$ &+%7%7  &L" 	%%l3r#   c                h   [         R                  " UUUS9nU R                  R                  (       aE  [	        U R                  USU5      nUR                  S5      nU(       a  SR                  U5      nOGSnOD[        U R                  USU5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       a  U S[        U5       3nUR                  SS5        Sn	UR                  b-  UR                  R                  b  UR                  R                  n	[        R                  " U5      n[        R                  " U5      nU R                  R                  SXuU	5      n
U
R                   (       d  0 O["        R$                  " U
R                   5      nU R                  R                  (       a  ['        USU5      nU R                  R                  (       d  [)        USU5      n[         R*                  R-                  U[/        USS5      (       aG  S[/        UR                  S	S5      [/        UR                  S
S5      [/        UR                  SS5      S.0O0 S9n[         R0                  " U
R2                  S9Ul        U R                  R7                  U5        U$ )a   Counts the number of tokens in the given content.

Multimodal input is supported for Gemini models.

Args:
  model (str): The model to use for counting tokens.
  contents (list[types.Content]): The content to count tokens for.
  config (CountTokensConfig): The configuration for counting tokens.

Usage:

.. code-block:: python

  response = client.models.count_tokens(
      model='gemini-2.0-flash',
      contents='What is your name?',
  )
  print(response)
  # total_tokens=5 cached_content_token_count=None
r  Nra   {model}:countTokensr  r  r   r  r>  r%  r  r  r  r  )r   _CountTokensParametersr  r  r   r  r  r   r	   r   r   r!  r   r"  r#  r$  r(  r)  r*  r   r   CountTokensResponser+  r%  r,  r  rk   r'  r<  s                r!   count_tokensModels.count_tokens  s   8 22O   5


OT?l &))&1	$//0@A$4


OT?l &))&1	$//0@A$##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''LH 'mmBHMM1JM  6
m $$5
m ,,;; ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! < L$ &+%7%7  &L" 	%%l3r#   c                   [         R                  " UUUS9nU R                  R                  (       d  [	        S5      e[        U R                  USU5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       a  U S[        U5       3nUR                  SS5        Sn	UR                  b-  UR                  R                  b  UR                  R                  n	[        R                  " U5      n[        R                  " U5      nU R                  R                  S	XuU	5      n
U
R                   (       d  0 O["        R$                  " U
R                   5      nU R                  R                  (       a  ['        USU5      n[         R(                  R+                  U[-        USS5      (       aG  S[-        UR                  S
S5      [-        UR                  SS5      [-        UR                  SS5      S.0O0 S9n[         R.                  " U
R0                  S9Ul        U R                  R5                  U5        U$ )a>  Given a list of contents, returns a corresponding TokensInfo containing the

list of tokens and list of token ids.

This method is not supported by the Gemini Developer API.

Args:
  model (str): The model to use.
  contents (list[shared.Content]): The content to compute tokens for.

Usage:

.. code-block:: python

  response = client.models.compute_tokens(
      model='gemini-2.0-flash',
      contents='What is your name?',
  )
  print(response)
  # tokens_info=[TokensInfo(role='user', token_ids=['1841', ...],
  # tokens=[b'What', b' is', b' your', b' name', b'?'])]
r  rU  Nra   {model}:computeTokensr  r  r   r  r>  r%  r  r  r  r  )r   _ComputeTokensParametersr  r  r   rh   r  r  r	   r   r   r!  r   r"  r#  r$  r(  r)  r*  rn   ComputeTokensResponser+  r%  r,  r  rk   r'  r<  s                r!   compute_tokensModels.compute_tokens:  s2   < 44O $$> 
 8


OT?l &))&1	&112BC&##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''LH 'mmBHMM1JM  8
m ..== ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! > L$ &+%7%7  &L" 	%%l3r#   r   r  r  r  r   r  c                (   [         R                  " UUUUUUS9nU R                  R                  (       aE  [	        U R                  USU5      nUR                  S5      n	U	(       a  SR                  U	5      n
OGSn
OD[        U R                  USU5      nUR                  S5      n	U	(       a  SR                  U	5      n
OSn
UR                  S5      nU(       a  U
 S[        U5       3n
UR                  SS5        SnUR                  b-  UR                  R                  b  UR                  R                  n[        R                  " U5      n[        R                  " U5      nU R                  R                  SXU5      nUR                   (       d  0 O["        R$                  " UR                   5      nU R                  R                  (       a  ['        USU5      nU R                  R                  (       d  [)        USU5      n[         R*                  R-                  U[/        USS5      (       aG  S[/        UR                  S	S5      [/        UR                  S
S5      [/        UR                  SS5      S.0O0 S9nU R                  R1                  U5        U$ )z%Private method for generating videos.r`   r   r  r  r  r   Nra   {model}:predictLongRunningr  r  r   r  r>  r%  r  r  r  )r   _GenerateVideosParametersr  r  r  r  r  r  r	   r   r   r!  r   r"  r#  r$  r(  r)  r*  r  r  GenerateVideosOperationr+  r%  r'  r.  r`   r   r  r  r  r   r/  r0  r1  r2  r3  r!  r$  r5  r4  s                   r!   _generate_videosModels._generate_videos  sq    55O   8


OT?l &))&1	+667GH+7


OT?l &))&1	+667GH+##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''LH 'mmBHMM1JM  :
m $$9
m 00?? ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! @ L& 	%%l3r#   c                   U R                   R                  (       d,  SU;   a  [        R                  " U5      nU R	                  XUS9$ [        R
                  " U5      (       a^  [        R                  " U5      n[        U5      S:  a  [        S5      eU R	                  USUS   [        R                  R                  US9$ U R	                  USU[        R                  R                  US9$ )	a=  Calculates embeddings for the given contents.

Args:
  model (str): The model to use.
  contents (list[Content]): The contents to embed.
  config (EmbedContentConfig): Optional configuration for embeddings.

Usage:

.. code-block:: python

  embeddings = client.models.embed_content(
      model= 'text-embedding-004',
      contents=[
          'What is your name?',
          'What is your favorite color?',
      ],
      config={
          'output_dimensionality': 64
      },
  )

  multimodal_embeddings = client.models.embed_content(
      model='gemini-embedding-2-preview',
      contents=[
          types.Part.from_uri(
              file_uri='gs://generativeai-downloads/images/scones.jpg',
              mime_type='image/jpeg',
          ),
      ],
      config={
          'output_dimensionality': 64
      },
  )
gemini-embedding-2r  r
   HThe embedContent API for this model only supports one content at a time.Nr   rA  )r`   rD   rb   r   r   r  r  rc   re   rJ  rF  lenr   r   EmbeddingApiTyper   r   r.  r`   rb   r   normalized_contentss        r!   embed_contentModels.embed_content   s    T $$		&<<)  u OO((//LL2	 	!A	%
 	
   %a("33AA !     "33;; !  r#   c                P   [         R                  " U5      n[         R                  " U5      nU(       aL  UR                  (       a;  [        R
                  " UR                  5      (       a  [        R                  " S5      e[         R                  " U5      (       a  U R                  XUS9$ U(       a  Sn[        U[        R                  5      (       a'  UR                  (       a  [        UR                  5      nO9[        U[        5      (       a$  UR                  S/ 5      nU(       a  [        U5      n[        U5      U:w  a5  SR!                  [#        [$        U5      5      n[&        R)                  SU5        U R                  XUS9$ [         R*                  " U5      n	[&        R-                  SU	 S35        / n
[        R.                  " 5       nSnU	S:  Ga  US	-  nU R                  XUS9n[         R0                  " U5      nU(       d  GOwU(       d  GOnUR2                  (       aF  UR2                  S   R4                  (       a(  UR2                  S   R4                  R6                  (       d  GO[         R8                  " X5      nU(       d  O[&        R-                  S
U S35        U	S	-  n	U	S:X  a  [&        R-                  S5        UR2                  S   R4                  n[        R:                  " SUS9n[<        R>                  " U5      nU
(       d  U
RA                  U5        [        U[B        5      (       a"  URE                  U5        URE                  U5        U
RE                  U5        U
RE                  U5        U	S:  a  GM  [         RF                  " U5      (       a
  Ub  U
Ul$        U$ )aM  Makes an API request to generate content using a model.

For the `model` parameter, supported formats for Gemini Enterprise Agent
Platform API include:
- The Gemini model ID, for example: 'gemini-2.0-flash'
- The full resource name starts with 'projects/', for example:
  'projects/my-project-id/locations/us-central1/publishers/google/models/gemini-2.0-flash'
- The partial resource name with 'publishers/', for example:
  'publishers/google/models/gemini-2.0-flash' or
- `/` separated publisher and model name, for example:
  'google/gemini-2.0-flash'

For the `model` parameter, supported formats for Gemini API include:
- The Gemini model ID, for example: 'gemini-2.0-flash'
- The model name starts with 'models/', for example:
  'models/gemini-2.0-flash'
- For tuned models, the model name starts with 'tunedModels/',
  for example:
  'tunedModels/1234567890123456789'

Some models support multimodal input and output.

Built-in MCP support is an experimental feature.

Usage:

.. code-block:: python

  from google.genai import types
  from google import genai

  client = genai.Client(
      vertexai=True, project='my-project-id', location='us-central1'
  )

  response = client.models.generate_content(
    model='gemini-2.0-flash',
    contents='''What is a good name for a flower shop that specializes in
      selling bouquets of dried flowers?'''
  )
  print(response.text)
  # **Elegant & Classic:**
  # * The Dried Bloom
  # * Everlasting Florals
  # * Timeless Petals

  response = client.models.generate_content(
    model='gemini-2.0-flash',
    contents=[
      types.Part.from_text(text='What is shown in this image?'),
      types.Part.from_uri(file_uri='gs://generativeai-downloads/images/scones.jpg',
      mime_type='image/jpeg')
    ]
  )
  print(response.text)
  # The image shows a flat lay arrangement of freshly baked blueberry
  # scones.
6MCP sessions are not supported in synchronous methods.r  r   r   , Tools at indices [%s] are not compatible with automatic function calling (AFC). AFC is disabled. If AFC is intended, please include python callables in the tool list, and do not include function declaration and MCP server in the tool list.&AFC is enabled with max remote calls: .r
   AFC remote call 	 is done.8Reached max remote calls for automatic function calling.userry   rx   )%r   "find_afc_incompatible_tool_indexesparse_config_for_mcp_usager   r   has_mcp_session_usager   UnsupportedFunctionErrorshould_disable_afcr6  
isinstancer   GenerateContentConfigr  dictr  joinmapstrloggerwarningget_max_remote_calls_afcinfor&  get_function_maprt  rD   rx   get_function_response_partsContentrc   re   extendlistappendshould_append_afc_history"automatic_function_calling_history)r.  r`   rb   r   incompatible_tools_indexesparsed_configoriginal_tools_lengthr   indices_strremaining_remote_calls_afcr  r$  ifunction_mapfunc_response_partsfunc_call_contentfunc_response_contents                    r!   generate_contentModels.generate_contentF  s;   F 	77?  !;;FCM,,]-@-@AA++
B  &&}55## $   "	FE77	8	8<<"%fll"3
fd##

7B'"%e*
	'	(,A	AiiC)C DED 	
 ## $   ".!F!F" KK
01K0LAN ?A&,,.H	A
$q
(1fa'' ( h "22=Al!!$$Q'//$$Q'//55(DD
 !kk$QCy12 A% 	#q	(NO"--a088#mm# h'h/*11(;	Hd	#	#)*-.(//0AB(//0EFO %q
(R 	..}==  - 1 Or#   c             #   x	  #    [         R                  " U5      n[         R                  " U5      nU(       aL  UR                  (       a;  [        R
                  " UR                  5      (       a  [        R                  " S5      e[         R                  " U5      (       a  U R                  XUS9 Sh  vN   gU(       a  Sn[        U[        R                  5      (       a'  UR                  (       a  [        UR                  5      nO9[        U[        5      (       a$  UR                  S/ 5      nU(       a  [        U5      n[        U5      U:w  a5  SR!                  [#        [$        U5      5      n[&        R)                  SU5        U R                  XUS9 Sh  vN   g[         R*                  " U5        [         R,                  " U5      n	[&        R/                  SU	 S	35        / n
SnSnSnU	S:  Ga  US
-  nU R                  XUS9n[         R0                  " U5      nUS
:X  a  U H  nU(       d  [         R2                  " X+5      nUv   M&  UR4                  (       aF  UR4                  S   R6                  (       a(  UR4                  S   R6                  R8                  (       d    O[         R:                  " X5      nU(       a  M  [         R2                  " X+5      nUv   M     OU H?  n[         R<                  " U5      (       a  U
Ul        [         R2                  " X+5      nUv   MA     UbW  UR4                  (       aF  UR4                  S   R6                  (       a(  UR4                  S   R6                  R8                  (       d  g[         R:                  " X5      nU(       d  gU(       d  g[&        R/                  SU S35        U	S
-  n	U	S:X  a  [&        R/                  S5        Ub  UR4                  b  UR4                  S   R6                  n[        R@                  " SUS9n[B        RD                  " U5      nU
(       d  U
RG                  U5        [        U[H        5      (       a%  Ub"  URK                  U5        URK                  U5        Ub  U
RK                  U5        U
RK                  U5        U	S:  a  GM  gg GN GN"7f)aq  Makes an API request to generate content using a model and yields the model's response in chunks.

For the `model` parameter, supported formats for Gemini Enterprise Agent
Platform API include:
- The Gemini model ID, for example: 'gemini-2.0-flash'
- The full resource name starts with 'projects/', for example:
  'projects/my-project-id/locations/us-central1/publishers/google/models/gemini-2.0-flash'
- The partial resource name with 'publishers/', for example:
  'publishers/google/models/gemini-2.0-flash' or
- `/` separated publisher and model name, for example:
  'google/gemini-2.0-flash'

For the `model` parameter, supported formats for Gemini API include:
- The Gemini model ID, for example: 'gemini-2.0-flash'
- The model name starts with 'models/', for example:
  'models/gemini-2.0-flash'
- For tuned models, the model name starts with 'tunedModels/',
  for example:
  'tunedModels/1234567890123456789'

Some models support multimodal input and output.

Built-in MCP support is an experimental feature.

Usage:

.. code-block:: python

  from google.genai import types
  from google import genai

  client = genai.Client(
      vertexai=True, project='my-project-id', location='us-central1'
  )

  for chunk in client.models.generate_content_stream(
    model='gemini-2.0-flash',
    contents='''What is a good name for a flower shop that specializes in
      selling bouquets of dried flowers?'''
  ):
    print(chunk.text)
  # **Elegant & Classic:**
  # * The Dried Bloom
  # * Everlasting Florals
  # * Timeless Petals

  for chunk in client.models.generate_content_stream(
    model='gemini-2.0-flash',
    contents=[
      types.Part.from_text('What is shown in this image?'),
      types.Part.from_uri('gs://generativeai-downloads/images/scones.jpg',
      'image/jpeg')
    ]
  ):
    print(chunk.text)
  # The image shows a flat lay arrangement of freshly baked blueberry
  # scones.
r  r  Nr   r   r  z_Tools at indices [%s] are not compatible with automatic function calling. AFC will be disabled.r  r  r
   r  r  r  r  r  )&r   r  r  r   r   r  r   r  r  r=  r  r   r  r  r  r  r  r  r  r  r  'raise_error_for_afc_incompatible_configr  r  r  append_chunk_contentsrt  rD   rx   r  r  r  r  rc   re   r  r  r  )r.  r`   rb   r   r  r  r  r   r  r  r  chunkr  r  r$  r  r  r  s                     r!   generate_content_streamModels.generate_content_stream  s/    F 	77?  !;;FCM,,]-@-@AA++
B  &&}55.. /    !	FE77	8	8<<"%fll"3
fd##

7B'"%e*
	'	(,A	AiiC)C DE-	

 .. /     88G!-!F!F" KK
01K0LAN ?A&E	A
$q
(1fa.. / h "22=Al	
a E#99(JHK $$''*22''*2288"."J"J# '&%;;HLhk! ( E33MBB2 4 "77H(+  M####A&..##A&..44
*FF
  kk$QCy12 A% 	#q	(NO 
	u//;!,,Q/77 %%!
 <<)1
,
3
3H
=h%%*;*G
//+
,
///
0(
,
3
34E
F*112GHU %q
(
(Q*s3   B.R:0R41C$R:R7D&R: G/R:2R:7R:c                H   U R                  UUUS9nSn/ nU(       a  UR                  (       d  U$ UR                   HM  nUR                  (       a(  UR                  R                  S:X  a  UR                  nM<  UR	                  U5        MO     [
        R                  " UUS9nU$ )a,  Generates images based on a text description and configuration.

Args:
  model (str): The model to use.
  prompt (str): A text description of the images to generate.
  config (GenerateImagesConfig): Configuration for generation.

Usage:

.. code-block:: python

  response = client.models.generate_images(
    model='imagen-3.0-generate-002',
    prompt='Man with a dog',
    config=types.GenerateImagesConfig(
        number_of_images= 1,
        include_rai_reason= True,
    )
  )
  response.generated_images[0].image.show()
  # Shows a man with a dog.
rM  NPositive Promptr   r  rQ  r   r  r  r  r   rO  	r.  r`   r   r   api_responser  r   generated_imager$  s	            r!   generate_imagesModels.generate_images  s    : (( ) L
 )-%|<<'88

+
+//<< -<,M,M)0 9 ++)*KH Or#   c                &    U R                  UUUUS9$ )a  Edits an image based on a text description and configuration.

Args:
  model (str): The model to use.
  prompt (str): A text description of the edit to apply to the image.
    reference_images (list[Union[RawReferenceImage, MaskReferenceImage,
    ControlReferenceImage, StyleReferenceImage, SubjectReferenceImage]): The
    reference images for editing.
  config (EditImageConfig): Configuration for editing.

Usage:

.. code-block:: python

  from google.genai.types import RawReferenceImage, MaskReferenceImage

  raw_ref_image = RawReferenceImage(
    reference_id=1,
    reference_image=types.Image.from_file(IMAGE_FILE_PATH),
  )

  mask_ref_image = MaskReferenceImage(
    reference_id=2,
    config=types.MaskReferenceConfig(
        mask_mode='MASK_MODE_FOREGROUND',
        mask_dilation=0.06,
    ),
  )
  response = client.models.edit_image(
    model='imagen-3.0-capability-001',
    prompt='man with dog',
    reference_images=[raw_ref_image, mask_ref_image],
    config=types.EditImageConfig(
        edit_mode= "EDIT_MODE_INPAINT_INSERTION",
        number_of_images= 1,
        include_rai_reason= True,
    )
  )
  response.generated_images[0].image.show()
  # Shows a man with a dog instead of a cat.
rT  rY  r.  r`   r   r   r   s        r!   
edit_imageModels.edit_image  s)    b )	   r#   c                n   [         R                  " UUUUS9  U=(       d    0 n[        U[         R                  5      (       a  UR	                  5       nO[        U5      n[         R                  " UR                  SS5      UR                  SS5      UR                  SS5      UR                  SS5      UR                  SS5      UR                  SS5      UR                  S	S5      UR                  S
S5      UR                  SS5      UR                  SS5      S9
nSUS'   SUS'   U R                  UUUUS9$ )a}  Makes an API request to upscale a provided image.

Args:
  model (str): The model to use.
  image (Image): The input image for upscaling.
  upscale_factor (str): The factor to upscale the image (x2 or x4).
  config (UpscaleImageConfig): Configuration for upscaling.

Usage:

.. code-block:: python

  from google.genai.types import Image

  IMAGE_FILE_PATH="my-image.png"
  response=client.models.upscale_image(
      model='imagen-3.0-generate-001',
      image=types.Image.from_file(IMAGE_FILE_PATH),
      upscale_factor='x2',
  )
  response.generated_images[0].image.show()
  # Opens my-image.png which is upscaled by a factor of 2.
r\  r!  Nr   r   r   r   r   r   r  r  r   
r!  r   r   r   r   r   r   r  r  r   upscaler  r
   r   	r   UpscaleImageParametersr  UpscaleImageConfig
model_dumpr  _UpscaleImageAPIConfigDictr  r`  r.  r`   r  r  r   
config_dct
api_configs          r!   upscale_imageModels.upscale_image  s;   B 
  %	 \rF&%2233$$&j<j11^^ND9!~~&6=&NN+@$G$..)<dC%>>*>E#(:DA#->>($$
 'NN+@$G",..'#
 ~~h-J$ #Jv%&J!"%	   r#   c          
         U(       d  U(       d  U(       a  U(       a  [        S5      e0 nU R                  R                  (       d  U(       a  [        U[        R
                  5      (       a  UR                  5       nO[        U5      nUR                  S5      (       aI  UR                  S5      (       a3  [        R
                  " UR                  S5      UR                  S5      S9nGOlU R                  R                  (       GdP  U(       GaH  [        U[        R                  5      (       a#  UR                  5       nUR                  S0 5      nOn[        U5      n[        UR                  S5      [        R
                  5      (       a5  UR                  S[        R
                  " 5       5      n	U	R                  5       nU(       a  UR                  S5      (       a{  UR                  S5      (       ae  [        R                  " UR                  S5      UR                  S5      [        R
                  " UR                  S5      UR                  S5      S9S	9nU R                  UUUUUUS
9$ )\  Generates videos based on an input (text, image, or video) and configuration.

The following use cases are supported:
1. Text to video generation.
2a. Image to video generation (additional text prompt is optional).
2b. Image to video generation with frame interpolation (specify last_frame
in config).
3. Video extension (additional text prompt is optional)

Args:
  model: The model to use.
  prompt: The text prompt for generating the videos. Optional for image to
    video and video extension use cases. This argument is deprecated, please
    use source instead.
  image: The input image for generating the videos. Optional if prompt is
    provided. This argument is deprecated, please use source instead.
  video: The input video for video extension use cases. Optional if prompt
    or image is provided. This argument is deprecated, please use source
    instead.
  source: The input source for generating the videos (prompt, image, and/or
    video)
  config: Configuration for generation.

Usage:

  ```
  operation = client.models.generate_videos(
      model="veo-2.0-generate-001",
      source=types.GenerateVideosSource(
          prompt="A neon hologram of a cat driving at top speed",
      ),
  )
  while not operation.done:
      time.sleep(10)
      operation = client.operations.get(operation)

  operation.result.generated_videos[0].video.uri
  ```
MSource and prompt/image/video are mutually exclusive. Please only use source.r  r  r@   r  r@   r  r   r  r   r  r  r  r   r  r  r  r   Videor  r  r  GenerateVideosSourcer  
r.  r`   r   r  r  r  r   	video_dct
source_dct	video_objs
             r!   generate_videosModels.generate_videosd  s   b 	%5f' 
 !#I$$	E5;;	'	'$$&	K		u		)--">">e$	k0J
 &&&6	FE66	7	7&&(
NN7B/	&\
jnnW-u{{;;#->>'5;;=#I)**,)	y}}U++	m0L0L++>>(+..)++MM%(#--4
    !  r#   c                   [         R                  " US9R                  =(       d    [         R                  " 5       nUR                  c  SUl        U R
                  R                  (       a@  UR                  5       nUR                  (       d  UR                  nU(       a  US-   OSUl        [        SU R                  U R                  US9U5      $ )a  Makes an API request to list the available models.

If `query_base` is set to True in the config or not set (default), the
API will return all available base models. If set to False, it will return
all tuned models.

Args:
  config (ListModelsConfigOrDict): Configuration for retrieving models.

Usage:

.. code-block:: python

  response=client.models.list(config={'page_size': 5})
  print(response.page)
  # [Model(name='projects/./locations/./models/123', display_name='my_model'

  response=client.models.list(config={'page_size': 5, 'query_base': True})
  print(response.page)
  # [Model(name='publishers/google/models/gemini-2.0-flash-exp' ...
r  T&filter=labels.tune-type:*labels.tune-type:*r*  )r   ry  r   ListModelsConfigr  r  r  copyr  r   r}  r.  r   filter_values      r!   r  Models.list  s    8 	##6299 	$!!#   f  {{}f}}  77% 	
 



&
!	 r#    )I__name__
__module____qualname____firstlineno__r  r   r   ContentListUnionContentListUnionDictr   GenerateContentConfigOrDictr&  r6  r   r=  ContentUnionContentUnionDictr  EmbedContentConfigOrDictrG  rJ  GenerateImagesConfigOrDictrO  rQ  r  _ReferenceImageAPIOrDictEditImageConfigOrDictrW  rY  ImageOrDict_UpscaleImageAPIConfigOrDictr^  r`  RecontextImageSourceOrDictRecontextImageConfigOrDictre  rg  SegmentImageSourceOrDictSegmentImageConfigOrDictrk  rl  GetModelConfigOrDictrs  r  ListModelsConfigOrDictrz  r}  UpdateModelConfigOrDictr  DeleteModelConfigOrDictr  r  CountTokensConfigOrDictr  r  ComputeTokensConfigOrDictr  r  VideoOrDictGenerateVideosSourceOrDictGenerateVideosConfigOrDictr  r  r  r  r  r  r  UpscaleImageConfigOrDictr  r  r   __static_attributes__r  r#   r!   r  r  l  s*    =A^ ^ e,,e.H.HHI	^
 u889^ $$^J =Ac c e,,e.H.HHI	c
 u889c --.cV  =A9=w w 
&&(B(BB
C	w 
""E$:$::
;w #5#9#9:w u556w !!w| <@Y Y 	Y
 u778Y ##YB 7;R R 	R
 U;;<R u223R Rt >BR R 	R
 R u99:R !!Rr <@j j ..	j
 u778j ##jb :>e e ,,	e
 u556e !!eP KOJJ#+E,F,F#GJ{{JZ AET < <=TTt 9=	O O u445	O
 {{Oj 9=	U U u445	U
   Ux 9=l l e,,e.H.HHI	l
 u445l   lf ;?e e e,,e.H.HHI	e
 u667e ""eV #+/+/;?;?] ] sm	]
 e''(] e''(] u778] u778] $$]H :>D D e,,e.H.HHI	D
 u556D !!DV =A` ` **	`
 u889` $$`N =AAI AI **	AI
 u889AI --.AIP <@5 5 	5
 u7785 ##5z 7;6 6 	6
 U;;<6 u2236 6| :>H H 	H
 H u556H !!H\ #+/+/;?;?[ [ sm	[
 e''([ e''([ u778[ u778[ $$[@ 8<0 u3340 U[[	0 0r#   r  c                   
   \ rS rSrSS.S\S\\R                  \R                  4   S\	\R                     S\R                  4S jjrSS.S\S\\R                  \R                  4   S\	\R                     S\\\R                        4S	 jjrSSSSS
.S\S\	\\R                  \R                  4      S\	\\R                   \R"                  4      S\	\R$                     S\	\R&                     S\R(                  4S jjrSS.S\S\S\	\R,                     S\R.                  4S jjrSS.S\S\S\\R4                     S\	\R6                     S\R8                  4
S jjrSS.S\S\R<                  S\S\	\R>                     S\R@                  4
S jjr!SS.S\S\RD                  S\	\RF                     S\RH                  4S jjr%SS.S\S\RL                  S\	\RN                     S\RP                  4S jjr)SS.S\S\	\RT                     S\RV                  4S jjr,SS.S\	\RZ                     S\R\                  4S jjr/SS.S\S\	\R`                     S\RV                  4S jjr1SS.S\S\	\Rd                     S\Rf                  4S jjr4SS.S\S\\R                  \R                  4   S\	\Rj                     S\Rl                  4S jjr7SS.S\S\\R                  \R                  4   S\	\Rp                     S\Rr                  4S jjr:SSSSSS.S\S\	\   S\	\R<                     S\	\Rv                     S\	\Rx                     S\	\Rz                     S\R|                  4S  jjr?SS.S\S\\R                  \R                  4   S\	\R                     S\R                  4S! jjr@SS.S\S\\R                  \R                  4   S\	\R                     S\\R                     4S" jjrASS.S\S\S\\R4                     S\	\R6                     S\R8                  4
S# jjrBSS.S\	\RZ                     S\C\RV                     4S$ jjrSS.S\S\S\	\R,                     S\R.                  4S% jjrDSS.S\S\R<                  S\S\	\R                     S\R@                  4
S& jjrFSSSSSS.S\S\	\   S\	\R<                     S\	\Rv                     S\	\Rx                     S\	\Rz                     S\R|                  4S' jjrGSS.S\S\\R                  \R                  4   S\	\R&                     S\R(                  4S( jjrHS)rIg)*AsyncModelsi  Nr  r`   rb   r   r   c                  #    [         R                  " UUUS9nU R                  R                  (       aE  [	        U R                  US U5      nUR                  S5      nU(       a  SR                  U5      nOGSnOD[        U R                  US U5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       a  U S[        U5       3nUR                  SS 5        S n	UR                  b-  UR                  R                  b  UR                  R                  n	[        R                  " U5      n[        R                  " U5      nU R                  R                  SXuU	5      I S h  vN n
UbC  [!        USS 5      (       a1  [         R"                  " U
S	9nU R                  R%                  U5        U$ U
R&                  (       d  0 O[(        R*                  " U
R&                  5      nU R                  R                  (       a  [-        US U5      nU R                  R                  (       d  [/        US U5      n[         R"                  R1                  U[!        USS 5      (       aG  S[!        UR                  S
S 5      [!        UR                  SS 5      [!        UR                  SS 5      S.0O0 S9n[         R2                  " U
R4                  S9Ul        U R                  R%                  U5        U$  GN7fr  )r   r  r  r  rr  r  r  ro  r	   r   r   r!  r   r"  r#  async_requestr%  r&  r'  r(  r)  r*  r  r}  r+  r,  r  rk   r-  s                r!   r6  AsyncModels._generate_content  s     66O   9


OT?l &))&1	(334DE(8


OT?l &))&1	(334DE(##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33L H g-t  22XNl
''5&mmBHMM1JM  :
m $$9
m 00?? ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! @ L$ &+%7%7  &L" 	%%l3[s   E=L?L FLc                t  ^ ^
^#    [         R                  " UUUS9m
T R                  R                  (       aE  [	        T R                  T
S T
5      nUR                  S5      nU(       a  SR                  U5      nOGSnOD[        T R                  T
S T
5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       a  U S[        U5       3nUR                  SS 5        S nT
R                  b-  T
R                  R                  b  T
R                  R                  n[        R                  " U5      n[        R                  " U5      nUb  [        USS 5      (       a  [!        S5      eT R                  R#                  S	XdU5      I S h  vN mU
UU 4S
 jn	U	" 5       $  N7f)Nr  ra   r9  r  r  r   r  r:  r  c                   >#    T  S h  vN n U R                   (       d  0 O[        R                  " U R                   5      nTR                  R                  (       a  [        US T5      nTR                  R                  (       d  [        US T5      n[        R                  R                  U[        TSS 5      (       aG  S[        TR                  SS 5      [        TR                  SS 5      [        TR                  SS 5      S.0O0 S9n[        R                  " U R                  S9Ul        TR                  R                  U5        U7v   GMI   GNE
 g 7f)Nr   r>  r%  r  r  r  r  )r(  r)  r*  r  r  r  r}  r   r&  r+  r%  r   r,  r  rk   r'  )r$  r5  r4  r/  response_streamr.  s      r!   async_generator=AsyncModels._generate_content_stream.<locals>.async_generator  s:    + $"*--TZZ5N$$>T?- ((=T?- 44CC" $77 '.'..0A4( -4'..0F- +2'..0Dd+
 ! D 
$ */););$$*
& 	)),7I$Os&   EEEEEEEE)r   r  r  r  rr  r  r  ro  r	   r   r   r!  r   r"  r#  r%  r   async_request_streamed)r.  r`   rb   r   r0  r1  r2  r3  r!  r6  r/  r5  s   `         @@r!   r=  $AsyncModels._generate_content_streamV  s     66O   9


OT?l &))&1	6AA
 78


OT?l &))&1	6AA
 7##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DLg-t   
 !,,CCL O%N Ws   FF8"F6#F8r?  rD   r   c                  #    [         R                  " UUUUUS9nU R                  R                  (       an  [	        U R                  USU5      nUR                  S5      n[        R                  " UR                  5      (       a  SOSn	U(       a  U	R                  U5      n
OGU	n
OD[        U R                  USU5      nUR                  S5      nU(       a  SR                  U5      n
OSn
UR                  S5      nU(       a  U
 S[        U5       3n
UR                  S	S5        SnUR                  b-  UR                  R                  b  UR                  R                  n[        R                   " U5      n[        R"                  " U5      nU R                  R%                  S
XU5      I Sh  vN nUR&                  (       d  0 O[(        R*                  " UR&                  5      nU R                  R                  (       a  [-        USU5      nU R                  R                  (       d  [/        USU5      n[         R0                  R3                  U[5        US	S5      (       aG  S	[5        UR                  SS5      [5        UR                  SS5      [5        UR                  SS5      S.0O0 S9n[         R6                  " UR8                  S9Ul        U R                  R=                  U5        U$  GN?7f)a  Calculates embeddings for the given contents. Only text is supported.

Args:
  model (str): The model to use.
  contents (list[Content]): The contents to embed.
  config (EmbedContentConfig): Optional configuration for embeddings.

Usage:

.. code-block:: python

  embeddings = await client.aio.models.embed_content(
      model= 'text-embedding-004',
      contents=[
          'What is your name?',
          'What is your favorite color?',
      ],
      config={
          'output_dimensionality': 64
      },
  )
rA  Nra   rB  rC  rD  r  r  r   r  r>  r%  r  r  r  r  )r   rE  r  r  r   r  rc   rF  r`   r  r   r	   r   r   r!  r   r"  r#  r1  r(  r)  r*  r
  r  rG  r+  r%  r,  r  rk   r'  rH  s                   r!   rJ  AsyncModels._embed_content  s    H ::-O   =


OT?l &))&1/0/P/PQ`QfQf/g/g+m~l	&&'78<


OT?l &))&1	+667GH+##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33L H 'mmBHMM1JM  7
m $$6
m --<< ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! = L$ &+%7%7  &L" 	%%l3Ms   F(K,*K)+D?K,r   c                  #    [         R                  " UUUS9nU R                  R                  (       aE  [	        U R                  USU5      nUR                  S5      nU(       a  SR                  U5      nOGSnOD[        U R                  USU5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       a  U S[        U5       3nUR                  SS5        Sn	UR                  b-  UR                  R                  b  UR                  R                  n	[        R                  " U5      n[        R                  " U5      nU R                  R                  SXuU	5      I Sh  vN n
U
R                   (       d  0 O["        R$                  " U
R                   5      nU R                  R                  (       a  ['        USU5      nU R                  R                  (       d  [)        USU5      n[         R*                  R-                  U[/        USS5      (       aG  S[/        UR                  S	S5      [/        UR                  S
S5      [/        UR                  SS5      S.0O0 S9n[         R0                  " U
R2                  S9Ul        U R                  R7                  U5        U$  GN?7f)z4Private method for generating images asynchronously.rM  Nra   rC  r  r  r   r  r>  r%  r  r  r  r  )r   rN  r  r  r  r  r  r  r	   r   r   r!  r   r"  r#  r1  r(  r)  r*  r  r  rO  r+  r%  r,  r  rk   r'  rP  s                r!   rQ  AsyncModels._generate_images9  s     55O   8


OT?l &))&1	 ++,<= 7


OT?l &))&1	 ++,<= ##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33L H 'mmBHMM1JM  9
m $$8
m //>> ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! ? L$ &+%7%7  &L" 	%%l3M   E=K?J> D?Kr   c                  #    [         R                  " UUUUS9nU R                  R                  (       d  [	        S5      e[        U R                  USU5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      n	U	(       a  U S[        U	5       3nUR                  SS5        Sn
UR                  b-  UR                  R                  b  UR                  R                  n
[        R                  " U5      n[        R                  " U5      nU R                  R                  S	XU
5      I Sh  vN nUR                   (       d  0 O["        R$                  " UR                   5      nU R                  R                  (       a  ['        USU5      n[         R(                  R+                  U[-        USS5      (       aG  S[-        UR                  S
S5      [-        UR                  SS5      [-        UR                  SS5      S.0O0 S9n[         R.                  " UR0                  S9Ul        U R                  R5                  U5        U$  GN7f)z3Private method for editing an image asynchronously.rT  rU  Nra   rC  r  r  r   r  r>  r%  r  r  r  r  )r   rV  r  r  r   r   r  r  r	   r   r   r!  r   r"  r#  r1  r(  r)  r*  r   rW  r+  r%  r,  r  rk   r'  rX  s                 r!   rY  AsyncModels._edit_image  sC     00)	O $$> 
 4


OT?l &))&1	 ++,<= ##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33L H 'mmBHMM1JM  4
m **99 ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! : L$ &+%7%7  &L" 	%%l3C   EI IDI r  r  c                  #    [         R                  " UUUUS9nU R                  R                  (       d  [	        S5      e[        U R                  USU5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      n	U	(       a  U S[        U	5       3nUR                  SS5        Sn
UR                  b-  UR                  R                  b  UR                  R                  n
[        R                  " U5      n[        R                  " U5      nU R                  R                  S	XU
5      I Sh  vN nUR                   (       d  0 O["        R$                  " UR                   5      nU R                  R                  (       a  ['        USU5      n[         R(                  R+                  U[-        USS5      (       aG  S[-        UR                  S
S5      [-        UR                  SS5      [-        UR                  SS5      S.0O0 S9n[         R.                  " UR0                  S9Ul        U R                  R5                  U5        U$  GN7f)z5Private method for upscaling an image asynchronously.r\  rU  Nra   rC  r  r  r   r  r>  r%  r  r  r  r  )r   r]  r  r  r   r  r  r  r	   r   r   r!  r   r"  r#  r1  r(  r)  r*  r  r^  r+  r%  r,  r  rk   r'  r_  s                 r!   r`  AsyncModels._upscale_image  sC     66%	O $$> 
 :


OT?l &))&1	 ++,<= ##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33L H 'mmBHMM1JM  7
m --<< ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! = L$ &+%7%7  &L" 	%%l3CrA  r  c                z  #    [         R                  " UUUS9nU R                  R                  (       d  [	        S5      e[        U R                  USU5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       a  U S[        U5       3nUR                  SS5        Sn	UR                  b-  UR                  R                  b  UR                  R                  n	[        R                  " U5      n[        R                  " U5      nU R                  R                  S	XuU	5      I Sh  vN n
U
R                   (       d  0 O["        R$                  " U
R                   5      nU R                  R                  (       a  ['        USU5      n[         R(                  R+                  U[-        USS5      (       aG  S[-        UR                  S
S5      [-        UR                  SS5      [-        UR                  SS5      S.0O0 S9nU R                  R/                  U5        U$  N7f)a  Recontextualizes an image.

There is one type of recontextualization currently supported:
1) Virtual Try-On: Generate images of persons modeling fashion products.

Args:
  model (str): The model to use.
  source (RecontextImageSource): An object containing the source inputs
    (prompt, person_image, product_images) for image recontext. prompt is
    behind an allowlist. person_image is required. product_images is
    required. Only one product image is supported currently.
  config (RecontextImageConfig): Configuration for recontextualization.

Usage:

  ```
  virtual_try_on_response = await client.aio.models.recontext_image(
      model="virtual-try-on-001",
      source=types.RecontextImageSource(
          person_image=types.Image.from_file(IMAGE1_FILE_PATH),
          product_images=[types.ProductImage.from_file(IMAGE2_FILE_PATH)],
      ),
      config=types.RecontextImageConfig(
          number_of_images=1,
      ),
  )
  image = virtual_try_on_response.generated_images[0].image
  ```
rc  rU  Nra   rC  r  r  r   r  r>  r%  r  r  r  )r   rd  r  r  r   rx  r  r  r	   r   r   r!  r   r"  r#  r1  r(  r)  r*  rz  re  r+  r%  r'  rf  s                r!   rg  AsyncModels.recontext_image<  s"    J 55O $$> 
 9


OT?l &))&1	 ++,<= ##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33L H 'mmBHMM1JM  9
m //>> ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! ? L& 	%%l3?   EH;H9C4H;c                z  #    [         R                  " UUUS9nU R                  R                  (       d  [	        S5      e[        U R                  USU5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       a  U S[        U5       3nUR                  SS5        Sn	UR                  b-  UR                  R                  b  UR                  R                  n	[        R                  " U5      n[        R                  " U5      nU R                  R                  S	XuU	5      I Sh  vN n
U
R                   (       d  0 O["        R$                  " U
R                   5      nU R                  R                  (       a  ['        USU5      n[         R(                  R+                  U[-        USS5      (       aG  S[-        UR                  S
S5      [-        UR                  SS5      [-        UR                  SS5      S.0O0 S9nU R                  R/                  U5        U$  N7f)a3  Segments an image, creating a mask of a specified area.

Args:
  model (str): The model to use.
  source (SegmentImageSource): An object containing the source inputs
    (prompt, image, scribble_image) for image segmentation. The prompt is
    required for prompt mode and semantic mode, disallowed for other modes.
    scribble_image is required for the interactive mode, disallowed for
    other modes.
  config (SegmentImageConfig): Configuration for segmentation.

Usage:

  ```
  response = client.models.segment_image(
      model="image-segmentation-001",
      source=types.SegmentImageSource(
          image=types.Image.from_file(IMAGE_FILE_PATH),
      ),
      config=types.SegmentImageConfig(
          mode=types.SegmentMode.foreground,
      ),
  )

  mask_image = response.generated_masks[0].mask
  ```
rc  rU  Nra   rC  r  r  r   r  r>  r%  r  r  r  )r   rj  r  r  r   r  r  r  r	   r   r   r!  r   r"  r#  r1  r(  r)  r*  r  rk  r+  r%  r'  rf  s                r!   rl  AsyncModels.segment_image  s"    F 33O $$> 
 7


OT?l &))&1	 ++,<= ##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33L H 'mmBHMM1JM  7
m --<< ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! = L& 	%%l3?rF  c                >  #    [         R                  " UUS9nU R                  R                  (       aE  [	        U R                  US U5      nUR                  S5      nU(       a  SR                  U5      nOGSnOD[        U R                  US U5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       a  U S[        U5       3nUR                  SS 5        S nUR                  b-  UR                  R                  b  UR                  R                  n[        R                  " U5      n[        R                  " U5      nU R                  R                  SXdU5      I S h  vN n	U	R                   (       d  0 O["        R$                  " U	R                   5      n
U R                  R                  (       a  ['        U
S U5      n
U R                  R                  (       d  [)        U
S U5      n
[         R*                  R-                  U
[/        USS 5      (       aG  S[/        UR                  SS 5      [/        UR                  S	S 5      [/        UR                  S
S 5      S.0O0 S9nU R                  R1                  U5        U$  GN7fro  )r   rr  r  r  r  r  r  r  r	   r   r   r!  r   r"  r#  r1  r(  r)  r*  r0  r,  rs  r+  r%  r'  rt  s               r!   r  AsyncModels.get  sf     //O   2


OT?l &))&1	""#341


OT?l &))&1	""#34##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33t< H 'mmBHMM1JM  (oNm$$'t_Mm;;-- ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! . L& 	%%l3A   E<J>J?DJc                  #    [         R                  " US9nU R                  R                  (       aE  [	        U R                  US U5      nUR                  S5      nU(       a  SR                  U5      nOGSnOD[        U R                  US U5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       aG  UR                  S5      (       a1  UR                  S5      nU SU 3nU(       a  US[        U5       3-  nOU(       a  U S[        U5       3nUR                  S	S 5        S nUR                  b-  UR                  R                  b  UR                  R                  n[        R                  " U5      n[        R                  " U5      nU R                  R                  S
XSU5      I S h  vN n	U	R                   (       d  0 O["        R$                  " U	R                   5      n
U R                  R                  (       a  ['        U
S U5      n
U R                  R                  (       d  [)        U
S U5      n
[         R*                  R-                  U
[/        US	S 5      (       aG  S	[/        UR                  SS 5      [/        UR                  SS 5      [/        UR                  SS 5      S.0O0 S9n[         R0                  " U	R2                  S9Ul        U R                  R7                  U5        U$  GN?7frw  )r   ry  r  r  r%  r  r  r#  r   r	   r   r!  r   r"  r#  r1  r(  r)  r*  r1  r-  rz  r+  r%  r,  r  rk   r'  r{  s               r!   r}  AsyncModels._list`  s     11O   4


OT?l &))&1	(()9:3


OT?l &))&1	(()9:##H-L((22'++H5vX012d	!Il+,--	vQy./0dXt$04L*""//;$++88l**<8L66|DL%%33t< H 'mmBHMM1JM  5
m $$4
m ++:: ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! ; L$ &+%7%7  &L" 	%%l3Ms   G	LL
D?Lc                >  #    [         R                  " UUS9nU R                  R                  (       aE  [	        U R                  US U5      nUR                  S5      nU(       a  SR                  U5      nOGSnOD[        U R                  US U5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       a  U S[        U5       3nUR                  SS 5        S nUR                  b-  UR                  R                  b  UR                  R                  n[        R                  " U5      n[        R                  " U5      nU R                  R                  SXdU5      I S h  vN n	U	R                   (       d  0 O["        R$                  " U	R                   5      n
U R                  R                  (       a  ['        U
S U5      n
U R                  R                  (       d  [)        U
S U5      n
[         R*                  R-                  U
[/        USS 5      (       aG  S[/        UR                  S	S 5      [/        UR                  S
S 5      [/        UR                  SS 5      S.0O0 S9nU R                  R1                  U5        U$  GN7fr  )r   r  r  r  r  r  r  r  r	   r   r   r!  r   r"  r#  r1  r(  r)  r*  r0  r,  rs  r+  r%  r'  rt  s               r!   r  AsyncModels.update  sf     22O   5


OT?l &))&1	##$454


OT?l &))&1	""#34##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33\ H 'mmBHMM1JM  (oNm$$'t_Mm;;-- ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! . L& 	%%l3ArK  c                  #    [         R                  " UUS9nU R                  R                  (       aE  [	        U R                  US U5      nUR                  S5      nU(       a  SR                  U5      nOGSnOD[        U R                  US U5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       a  U S[        U5       3nUR                  SS 5        S nUR                  b-  UR                  R                  b  UR                  R                  n[        R                  " U5      n[        R                  " U5      nU R                  R                  SXdU5      I S h  vN n	U	R                   (       d  0 O["        R$                  " U	R                   5      n
U R                  R                  (       a  ['        U
S U5      n
U R                  R                  (       d  [)        U
S U5      n
[         R*                  R-                  U
[/        USS 5      (       aG  S[/        UR                  SS 5      [/        UR                  S	S 5      [/        UR                  S
S 5      S.0O0 S9n[         R0                  " U	R2                  S9Ul        U R                  R7                  U5        U$  GN?7fr  )r   r  r  r  r   r  r  r   r	   r   r   r!  r   r"  r#  r1  r(  r)  r*  r   r   r  r+  r%  r,  r  rk   r'  rt  s               r!   r  AsyncModels.delete	  s     22O   5


OT?l &))&1	""#344


OT?l &))&1	""#34##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33$l H 'mmBHMM1JM  6
m $$5
m ,,;; ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! < L$ &+%7%7  &L" 	%%l3Ms   E<K >J=?D?K c                  #    [         R                  " UUUS9nU R                  R                  (       aE  [	        U R                  USU5      nUR                  S5      nU(       a  SR                  U5      nOGSnOD[        U R                  USU5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       a  U S[        U5       3nUR                  SS5        Sn	UR                  b-  UR                  R                  b  UR                  R                  n	[        R                  " U5      n[        R                  " U5      nU R                  R                  SXuU	5      I Sh  vN n
U
R                   (       d  0 O["        R$                  " U
R                   5      nU R                  R                  (       a  ['        USU5      nU R                  R                  (       d  [)        USU5      n[         R*                  R-                  U[/        USS5      (       aG  S[/        UR                  S	S5      [/        UR                  S
S5      [/        UR                  SS5      S.0O0 S9n[         R0                  " U
R2                  S9Ul        U R                  R7                  U5        U$  GN?7f)a
  Counts the number of tokens in the given content.

Multimodal input is supported for Gemini models.

Args:
  model (str): The model to use for counting tokens.
  contents (list[types.Content]): The content to count tokens for.
  config (CountTokensConfig): The configuration for counting tokens.

Usage:

.. code-block:: python

  response = await client.aio.models.count_tokens(
      model='gemini-2.0-flash',
      contents='What is your name?',
  )
  print(response)
  # total_tokens=5 cached_content_token_count=None
r  Nra   r  r  r  r   r  r>  r%  r  r  r  r  )r   r  r  r  r   r  r  r   r	   r   r   r!  r   r"  r#  r1  r(  r)  r*  r   r   r  r+  r%  r,  r  rk   r'  r<  s                r!   r  AsyncModels.count_tokens`  s    8 22O   5


OT?l &))&1	$//0@A$4


OT?l &))&1	$//0@A$##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33L H 'mmBHMM1JM  6
m $$5
m ,,;; ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! < L$ &+%7%7  &L" 	%%l3Mr>  c                  #    [         R                  " UUUS9nU R                  R                  (       d  [	        S5      e[        U R                  USU5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       a  U S[        U5       3nUR                  SS5        Sn	UR                  b-  UR                  R                  b  UR                  R                  n	[        R                  " U5      n[        R                  " U5      nU R                  R                  S	XuU	5      I Sh  vN n
U
R                   (       d  0 O["        R$                  " U
R                   5      nU R                  R                  (       a  ['        USU5      n[         R(                  R+                  U[-        USS5      (       aG  S[-        UR                  S
S5      [-        UR                  SS5      [-        UR                  SS5      S.0O0 S9n[         R.                  " U
R0                  S9Ul        U R                  R5                  U5        U$  GN7f)a  Given a list of contents, returns a corresponding TokensInfo containing the

list of tokens and list of token ids.


Args:
  model (str): The model to use.
  contents (list[shared.Content]): The content to compute tokens for.

Usage:

.. code-block:: python

  response = await client.aio.models.compute_tokens(
      model='gemini-2.0-flash',
      contents='What is your name?',
  )
  print(response)
  # tokens_info=[TokensInfo(role='user', token_ids=['1841', ...],
  # tokens=[b'What', b' is', b' your', b' name', b'?'])]
r  rU  Nra   r  r  r  r   r  r>  r%  r  r  r  r  )r   r  r  r  r   rh   r  r  r	   r   r   r!  r   r"  r#  r1  r(  r)  r*  rn   r  r+  r%  r,  r  rk   r'  r<  s                r!   r  AsyncModels.compute_tokens  s@    : 44O $$> 
 8


OT?l &))&1	&112BC&##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33L H 'mmBHMM1JM  8
m ..== ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! > L$ &+%7%7  &L" 	%%l3Cs   EIIDIr  r  c                F  #    [         R                  " UUUUUUS9nU R                  R                  (       aE  [	        U R                  USU5      nUR                  S5      n	U	(       a  SR                  U	5      n
OGSn
OD[        U R                  USU5      nUR                  S5      n	U	(       a  SR                  U	5      n
OSn
UR                  S5      nU(       a  U
 S[        U5       3n
UR                  SS5        SnUR                  b-  UR                  R                  b  UR                  R                  n[        R                  " U5      n[        R                  " U5      nU R                  R                  SXU5      I Sh  vN nUR                   (       d  0 O["        R$                  " UR                   5      nU R                  R                  (       a  ['        USU5      nU R                  R                  (       d  [)        USU5      n[         R*                  R-                  U[/        USS5      (       aG  S[/        UR                  S	S5      [/        UR                  S
S5      [/        UR                  SS5      S.0O0 S9nU R                  R1                  U5        U$  GN7f)z4Private method for generating videos asynchronously.r  Nra   r  r  r  r   r  r>  r%  r  r  r  )r   r  r  r  r  r  r  r  r	   r   r   r!  r   r"  r#  r1  r(  r)  r*  r  r  r  r+  r%  r'  r  s                   r!   r  AsyncModels._generate_videos4   s     55O   8


OT?l &))&1	+667GH+7


OT?l &))&1	+667GH+##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33L H 'mmBHMM1JM  :
m $$9
m 00?? ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! @ L& 	%%l3Is   F J!JDJ!c                  #    [         R                  " U5      n[         R                  " U5      I Sh  vN u  pV[         R                  " U5      (       a  U R	                  XUS9I Sh  vN $ U(       a  Sn[        U[        R                  5      (       a'  UR                  (       a  [        UR                  5      nO9[        U[        5      (       a$  UR                  S/ 5      nU(       a  [        U5      n[        U5      U:w  a5  SR                  [        [        U5      5      n	[        R!                  SU	5        U R	                  XUS9I Sh  vN $ [         R"                  " U5      n
[        R%                  SU
 S35        / n[        R&                  " 5       nU
S:  Ga  U R	                  XUS9I Sh  vN nU
S	-  n
U
S:X  a  [        R%                  S
5        [         R(                  " XVSS9nU(       d  GOEU(       d  GO<UR*                  (       aF  UR*                  S   R,                  (       a(  UR*                  S   R,                  R.                  (       d  O[         R0                  " X5      I Sh  vN nU(       d  OUR*                  S   R,                  n[        R2                  " SUS9n[4        R6                  " U5      nU(       d  UR9                  U5        [        U[:        5      (       a"  UR=                  U5        UR=                  U5        UR=                  U5        UR=                  U5        U
S:  a  GM  [         R>                  " U5      (       a
  Ub  UUl         U$  GN- GN GN GN N7f)a  Makes an API request to generate content using a model.

Some models support multimodal input and output.

Built-in MCP support is an experimental feature.

Usage:

.. code-block:: python

  from google.genai import types
  from google import genai

  client = genai.Client(
      vertexai=True, project='my-project-id', location='us-central1'
  )

  response = await client.aio.models.generate_content(
      model='gemini-2.0-flash',
      contents='User input: I like bagels. Answer:',
      config=types.GenerateContentConfig(
          system_instruction=
            [
              'You are a helpful language translator.',
              'Your mission is to translate text in English to French.'
            ]
      ),
  )
  print(response.text)
  # J'aime les bagels.
Nr  r   r   r  r  r  r  r
   r  Tis_caller_method_asyncr  r  )!r   r  parse_config_for_mcp_sessionsr  r6  r  r   r  r   r  r  r  r  r  r  r  r  r  r  r&  r  rt  rD   rx   !get_function_response_parts_asyncr  rc   re   r  r  r  r  r  )r.  r`   rb   r   r  r  mcp_to_genai_tool_adaptersr  r   r  r  r  r$  r  r  r  r  s                    r!   r  AsyncModels.generate_content   s!    P 	77?  88@@ .M &&}55)) *    "	FE77	8	8<<"%fll"3
fd##

7B'"%e*
	'	(,A	AiiC)C DED 	
 )) *    ".!F!F" KK
01K0LAN ?A&,,.H
$q
(-- .  h !A% 	#q	(NO!22
Dl !!$$Q'//$$Q'//55>>  
 !"--a088#mm# h'h/*11(;	Hd	#	#)*-.(//0AB(//0EFQ %q
(V 	..}==  - 1 Oi 	A**sa   0M-M4M-'M"(C#M-M%A$M-0M(1B<M--M+.CM-8(M-"M-%M-(M-+M-c                D  ^ ^^#    [         R                  " U5      n[         R                  " U5      I Sh  vN u  nm[         R                  " U5      (       a'  T R	                  XUS9I Sh  vN mU4S jnU" XU5      $ U(       a  Sn[        U[        R                  5      (       a'  UR                  (       a  [        UR                  5      nO9[        U[        5      (       a$  UR                  S/ 5      nU(       a  [        U5      n[        U5      U:w  a5  SR                  [        [        U5      5      n	[        R!                  SU	5        T R	                  XUS9I Sh  vN mU4S jnU" XU5      $ [         R"                  " U5        UU 4S	 jn
U
" XU5      $  GNc GN0 N?7f)
a  Makes an API request to generate content using a model and yields the model's response in chunks.

For the `model` parameter, supported formats for Gemini Enterprise Agent
Platform API include:
- The Gemini model ID, for example: 'gemini-2.0-flash'
- The full resource name starts with 'projects/', for example:
  'projects/my-project-id/locations/us-central1/publishers/google/models/gemini-2.0-flash'
- The partial resource name with 'publishers/', for example:
  'publishers/google/models/gemini-2.0-flash' or
- `/` separated publisher and model name, for example:
  'google/gemini-2.0-flash'

For the `model` parameter, supported formats for Gemini API include:
- The Gemini model ID, for example: 'gemini-2.0-flash'
- The model name starts with 'models/', for example:
  'models/gemini-2.0-flash'
- For tuned models, the model name starts with 'tunedModels/',
  for example:
  'tunedModels/1234567890123456789'

Some models support multimodal input and output.

Built-in MCP support is an experimental feature.

Usage:

.. code-block:: python

  from google.genai import types
  from google import genai

  client = genai.Client(
      vertexai=True, project='my-project-id', location='us-central1'
  )

  async for chunk in await client.aio.models.generate_content_stream(
    model='gemini-2.0-flash',
    contents='''What is a good name for a flower shop that specializes in
      selling bouquets of dried flowers?'''
  ):
    print(chunk.text)
  # **Elegant & Classic:**
  # * The Dried Bloom
  # * Everlasting Florals
  # * Timeless Petals

  async for chunk in await client.aio.models.generate_content_stream(
    model='gemini-2.0-flash',
    contents=[
      types.Part.from_text('What is shown in this image?'),
      types.Part.from_uri('gs://generativeai-downloads/images/scones.jpg',
      'image/jpeg')
    ]
  ):
    print(chunk.text)
  # The image shows a flat lay arrangement of freshly baked blueberry
  # scones.
Nr  c                8   >#    T  S h  vN nU7v   M   N
 g 7fNr  r`   rb   r   r  r$  s       r!   base_async_generatorAAsyncModels.generate_content_stream.<locals>.base_async_generatorc!       # 	%+	8   r   r   r  r  c                8   >#    T  S h  vN nU7v   M   N
 g 7fra  r  rb  s       r!   rc  rd  !  re  rf  c                ~  >#    [         R                  " U5      n[        R                  SU S35        / nS nS nSnUS:  Gao  US-  nTR	                  XUS9I S h  vN nUS:  a  [        R                  SU S35        US-  nUS:  a  US:X  a  [        R                  S5        [         R
                  " UTS	S
9n	US:X  a  U  S h  vN nU	(       d  [         R                  " X5      nU7v   M-  UR                  (       aF  UR                  S   R                  (       a(  UR                  S   R                  R                  (       d    O[         R                  " Xi5      I S h  vN nU(       a  M  [         R                  " X5      nU7v   M  U  S h  vN n[         R                  " U5      (       a  UUl        [         R                  " X5      nU7v   MH  U	(       d  g U(       d  g Uc  GM  UR                  S   R                  n
[        R                  " SUS9n[        R                   " U5      nU(       d  UR#                  U5        [%        U[&        5      (       a%  U
b"  UR)                  U
5        UR)                  U5        U
b  UR)                  U
5        UR)                  U5        US:  a  GMn  g g  GNX GN GNW
 N GN+
 UbW  UR                  (       aF  UR                  S   R                  (       a(  UR                  S   R                  R                  (       d  g [         R                  " Xi5      I S h  vN  nGNg7f)Nr  r  r   r
   r  r  r  r  TrY  r  r  )r   r  r  r  r=  r  r  rt  rD   rx   r\  r  r  r   r  rc   re   r  r  r  r  )r`   rb   r   r  r  r  r  r  r$  r  r  r  r]  r.  s               r!   r6  <AsyncModels.generate_content_stream.<locals>.async_generator!  s    #/#H#H#P kk23M2Na
P AC( e
a&*	Q666 7 
 
 q5
++(95
6"a'"q5/14
++H $44.t
 6 & E%;;HLhk &&))!,44))!,44::$FF  "
 )('==hN & E55f==4 6 $99(JHK 
"
=
!,,Q/77 %%!
 <<)1
,
3
3H
=h%%*;*G
//+
,
///
0(
,
3
34E
F*112GHm '**
( &,X m%%%%a(00%%a(0066 BB   s   AL=J2A'L=J;J5J;
BL=!J8"	L=/L=K J=K DL=0L=5J;8L=;L==K  A5L=5L86L=)r   r  r[  r  r=  r  r   r  r   r  r  r  r  r  r  r  r  r  )r.  r`   rb   r   r  r  rc  r  r   r  r6  r]  r$  s   `          @@r!   r  #AsyncModels.generate_content_stream!  s    H 	77? 
 88@@ .M- &&}5544 5  h "%=AA!	FE77	8	8<<"%fll"3
fd##

7B'"%e*
	'	(,A	AiiC)C DED 	
 44 5  h "%=AA 88G_IB 5M::] 	A8s4   0F F5F +F,C2F F:F F F c                B   #    U R                  UUUUS9I Sh  vN $  N7f)a  Edits an image based on a text description and configuration.

Args:
  model (str): The model to use.
  prompt (str): A text description of the edit to apply to the image.
    reference_images (list[Union[RawReferenceImage, MaskReferenceImage,
    ControlReferenceImage, StyleReferenceImage, SubjectReferenceImage]): The
    reference images for editing.
  config (EditImageConfig): Configuration for editing.

Usage:

.. code-block:: python

  from google.genai.types import RawReferenceImage, MaskReferenceImage

  raw_ref_image = RawReferenceImage(
    reference_id=1,
    reference_image=types.Image.from_file(IMAGE_FILE_PATH),
  )

  mask_ref_image = MaskReferenceImage(
    reference_id=2,
    config=types.MaskReferenceConfig(
        mask_mode='MASK_MODE_FOREGROUND',
        mask_dilation=0.06,
    ),
  )
  response = await client.aio.models.edit_image(
    model='imagen-3.0-capability-001',
    prompt='man with dog',
    reference_images=[raw_ref_image, mask_ref_image],
    config=types.EditImageConfig(
        edit_mode= "EDIT_MODE_INPAINT_INSERTION",
        number_of_images= 1,
        include_rai_reason= True,
    )
  )
  response.generated_images[0].image.show()
  # Shows a man with a dog instead of a cat.
rT  Nr  r  s        r!   r  AsyncModels.edit_image!  s6     b !!)	 "    s   c                  #    [         R                  " US9R                  =(       d    [         R                  " 5       nUR                  c  SUl        U R
                  R                  (       a@  UR                  5       nUR                  (       d  UR                  nU(       a  US-   OSUl        [        SU R                  U R                  US9I Sh  vN U5      $  N	7f)a  Makes an API request to list the available models.

If `query_base` is set to True in the config or not set (default), the
API will return all available base models. If set to False, it will return
all tuned models.

Args:
  config (ListModelsConfigOrDict): Configuration for retrieving models.

Usage:

.. code-block:: python

  response = await client.aio.models.list(config={'page_size': 5})
  print(response.page)
  # [Model(name='projects/./locations/./models/123', display_name='my_model'

  response = await client.aio.models.list(
      config={'page_size': 5, 'query_base': True}
    )
  print(response.page)
  # [Model(name='publishers/google/models/gemini-2.0-flash-exp' ...
r  NTr  r	  r*  )r   ry  r   r
  r  r  r  r  r  r   r}  r  s      r!   r  AsyncModels.list$"  s     < 	##6299 	$!!#   f  {{}f}}  77% 	
 

jjj''	  	(s   CCC
Cc                d  #    U R                  UUUS9I Sh  vN nSn/ nU(       a  UR                  (       d  U$ UR                   HM  nUR                  (       a(  UR                  R                  S:X  a  UR                  nM<  UR	                  U5        MO     [
        R                  " UUS9nU$  N7f)a6  Generates images based on a text description and configuration.

Args:
  model (str): The model to use.
  prompt (str): A text description of the images to generate.
  config (GenerateImagesConfig): Configuration for generation.

Usage:

.. code-block:: python

  response = await client.aio.models.generate_images(
    model='imagen-3.0-generate-002',
    prompt='Man with a dog',
    config=types.GenerateImagesConfig(
        number_of_images= 1,
        include_rai_reason= True,
    )
  )
  response.generated_images[0].image.show()
  # Shows a man with a dog.
rM  Nr  r  r  r  s	            r!   r  AsyncModels.generate_imagesX"  s     : .. /  L
 )-%|<<'88

+
+//<< -<,M,M)0 9 ++)*KH O1s   B0B.BB0c                  #    [         R                  " UUUUS9  U=(       d    0 n[        U[         R                  5      (       a  UR	                  5       nO[        U5      n[         R                  " UR                  SS5      UR                  SS5      UR                  SS5      UR                  SS5      UR                  SS5      UR                  SS5      UR                  S	S5      UR                  S
S5      UR                  SS5      UR                  SS5      S9
nSUS'   SUS'   U R                  UUUUS9I Sh  vN $  N7f)a  Makes an API request to upscale a provided image.

Args:
  model (str): The model to use.
  image (Image): The input image for upscaling.
  upscale_factor (str): The factor to upscale the image (x2 or x4).
  config (UpscaleImageConfig): Configuration for upscaling.

Usage:

.. code-block:: python

  from google.genai.types import Image

  IMAGE_FILE_PATH="my-image.png"
  response = await client.aio.models.upscale_image(
      model='imagen-3.0-generate-001',
      image=types.Image.from_file(IMAGE_FILE_PATH),
      upscale_factor='x2',
  )
  response.generated_images[0].image.show()
  # Opens my-image.png which is upscaled by a factor of 2.
r\  r!  Nr   r   r   r   r   r   r  r  r   r  r  r  r
   r   r  r  s          r!   r  AsyncModels.upscale_image"  sH    B 
  %	 \rF&%2233$$&j<j11^^ND9!~~&6=&NN+@$G$..)<dC%>>*>E#(:DA#->>($$
 'NN+@$G",..'#
 ~~h-J$ #Jv%&J!"$$%	 %    s   D:E<E=Ec          
        #    U(       d  U(       d  U(       a  U(       a  [        S5      e0 nU R                  R                  (       d  U(       a  [        U[        R
                  5      (       a  UR                  5       nO[        U5      nUR                  S5      (       aI  UR                  S5      (       a3  [        R
                  " UR                  S5      UR                  S5      S9nGOlU R                  R                  (       GdP  U(       GaH  [        U[        R                  5      (       a#  UR                  5       nUR                  S0 5      nOn[        U5      n[        UR                  S5      [        R
                  5      (       a5  UR                  S[        R
                  " 5       5      n	U	R                  5       nU(       a  UR                  S5      (       a{  UR                  S5      (       ae  [        R                  " UR                  S5      UR                  S5      [        R
                  " UR                  S5      UR                  S5      S9S	9nU R                  UUUUUUS
9I Sh  vN $  N7f)r  r  r  r  r@   r  r  r   r  r  r  Nr  r  s
             r!   r  AsyncModels.generate_videos"  s    b 	%5f' 
 !#I$$	E5;;	'	'$$&	K		u		)--">">e$	k0J
 &&&6	FE66	7	7&&(
NN7B/	&\
jnnW-u{{;;#->>'5;;=#I)**,)	y}}U++	m0L0L++>>(+..)++MM%(#--4
 && '    s   I+I4-I2.I4c                  #    U R                   R                  (       d4  SU;   a  [        R                  " U5      nU R	                  XUS9I Sh  vN $ [        R
                  " U5      (       af  [        R                  " U5      n[        U5      S:  a  [        S5      eU R	                  UUUS   [        R                  R                  US9I Sh  vN $ U R	                  UU[        R                  R                  US9I Sh  vN $  N N8 N7f)	aQ  Calculates embeddings for the given contents.

Args:
  model (str): The model to use.
  contents (list[Content]): The contents to embed.
  config (EmbedContentConfig): Optional configuration for embeddings.

Usage:

.. code-block:: python

  embeddings = await client.aio.models.embed_content(
      model= 'text-embedding-004',
      contents=[
          'What is your name?',
          'What is your favorite color?',
      ],
      config={
          'output_dimensionality': 64
      },
  )

  multimodal_embeddings = await client.aio.models.embed_content(
      model='gemini-embedding-2-preview',
      contents=[
          types.Part.from_uri(
              file_uri='gs://generativeai-downloads/images/scones.jpg',
              mime_type='image/jpeg',
          ),
      ],
      config={
          'output_dimensionality': 64
      },
  )
r  r  Nr
   r  r   rA  )r`   rb   r   r   r  r  s        r!   r  AsyncModels.embed_content6#  s    T $$		&<<)&& '    	((//LL2	 	!A	%
 	
 &&%a("33AA '    &&"33;;	 '   %s7   ADDB DD1D D	DD	Dr  )Jr  r  r  r  r  r   r   r  r  r   r  r&  r6  r   r   r=  r  r  r  r  rG  rJ  r  rO  rQ  r  r  r  rW  rY  r  r  r^  r`  r  r   re  rg  r!  r"  rk  rl  r#  rs  r  r$  rz  r}  r%  r  r&  r  r  r'  r  r  r(  r  r  r)  r*  r+  r  r  r  r  r  r   r  r,  r  r  r  r-  r  r#   r!   r/  r/    sK    =A^ ^ e,,e.H.HHI	^
 u889^ $$^J =Ah h e,,e.H.HHI	h
 u889h u<<=>h`  =A9=w w 
&&(B(BB
C	w 
""E$:$::
;w #5#9#9:w u556w !!w| <@Y Y 	Y
 u778Y ##YB 7;R R 	R
 U;;<R u223R Rt >BR R 	R
 R u99:R !!Rr <@j j ..	j
 u778j ##jb :>h h ,,	h
 u556h !!hV KOLL#+E,F,F#GL{{L^ AEV < <=VVx 9=	O O u445	O
 {{Oj 9=	U U u445	U
   Ux 9=l l e,,e.H.HHI	l
 u445l   lf ;?d d e,,e.H.HHI	d
 u667d ""dT #+/+/;?;?] ] sm	]
 e''(] e''(] u778] u778] $$]H =A  e,,e.H.HHI	
 u889 $$L =AV; V; e,,e.H.HHI	V;
 u889V; U223V;| 7;6 6 	6
 U;;<6 u2236 6v 8<2 u3342 %++	2r <@5 5 	5
 u7785 ##5z :>H H 	H
 H u556H !!H\ #+/+/;?;?[ [ sm	[
 e''([ e''([ u778[ u778[ $$[D :>D D e,,e.H.HHI	D
 u556D !!D Dr#   r/  )NN)r)  loggingtypingr   r   r   r   r   r   urllib.parser	    r   r   r
  r   r   r   r   rc   r   r   r  r   r   r7   r   r8   pagersr   r   	getLoggerr  r"   r&   r)   r  r  objectr;   rB   rY   rV   rh   rn   rq   ru   r{   rf   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r
  r  r  r  r  r(  rb  rl  ro  rr  r}  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r   r  r  r  r  ra  rk  r  r  r  r  r  r   r#  r%  r-  r1  r9  r,  r0  rS  rz   r~   rr  rt  rx  rz  rw  r   r  r  r  rZ  r  r  r  r  r  rR  rj  r^  ri  r\  r   rN  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  
BaseModuler  r/  r  r#   r!   <module>r     s07  $   K K "  *        & . . %			0	1Q Q Q
Q# Q$ Q
QQ	Q /3;? tCH~v-. DcN+  %S#X 678  
#s(^	 J /3;?tCH~v-.DcN+ %S#X 678 
#s(^	( /3;?6tCH~v-.6DcN+6 %S#X 6786 
#s(^	6v /3;?tCH~v-.DcN+ %S#X 678 
#s(^	& /3;?	tCH~v-. DcN+ %S#X 678	
 
#s(^: /3;?tCH~v-.DcN+ %S#X 678 
#s(^	. /3;?tCH~v-.DcN+ %S#X 678 
#s(^	" /3;?tCH~v-.DcN+ %S#X 678 
#s(^	. /3;?tCH~v-.DcN+ %S#X 678 
#s(^	0 /3;?tCH~v-.DcN+ %S#X 678 
#s(^	0 /3;?tCH~v-.DcN+ %S#X 678 
#s(^	* /3;?tCH~v-.DcN+ %S#X 678 
#s(^	2 /3;?%tCH~v-.%DcN+% %S#X 678% 
#s(^	%V /3;?	tCH~v-. DcN+ %S#X 678	
 
#s(^F /3;?	tCH~v-. DcN+ %S#X 678	
 
#s(^D /3;?tCH~v-.DcN+ %S#X 678 
#s(^	4 /3;?tCH~v-.DcN+ %S#X 678 
#s(^	( /3;?	tCH~v-. DcN+ %S#X 678	
 
#s(^( /3;?	tCH~v-. DcN+ %S#X 678	
 
#s(^& /3;?tCH~v-.DcN+ %S#X 678 
#s(^	  /3;?tCH~v-.DcN+ %S#X 678 
#s(^	  /3;?vtCH~v-.vDcN+v %S#X 678v 
#s(^	vx /3;?	  tCH~v-.  DcN+  %S#X 678	 
 
#s(^ J /3;?tCH~v-.DcN+ %S#X 678 
#s(^	4 /3;?&tCH~v-.&DcN+& %S#X 678& 
#s(^	&V /3;?ntCH~v-.nDcN+n %S#X 678n 
#s(^	nh /3;?	))tCH~v-.) DcN+) %S#X 678	)
 
#s(^)^ /3;?	22tCH~v-.2 DcN+2 %S#X 678	2
 
#s(^2n /3;?tCH~v-.DcN+ %S#X 678 
#s(^	4 /3;?%tCH~v-.%DcN+% %S#X 678% 
#s(^	%T /3;?tCH~v-.DcN+ %S#X 678 
#s(^	& /3;?tCH~v-.DcN+ %S#X 678 
#s(^	( /3;?tCH~v-.DcN+ %S#X 678 
#s(^	4 /3;?tCH~v-.DcN+ %S#X 678 
#s(^	6 /3;?&tCH~v-.&DcN+& %S#X 678& 
#s(^	&X /3;?	yytCH~v-.y DcN+y %S#X 678	y
 
#s(^y~ /3;?	{{tCH~v-.{ DcN+{ %S#X 678	{
 
#s(^{B /3;?	!!tCH~v-.! DcN+! %S#X 678	!
 
#s(^!N /3;?	!!tCH~v-.! DcN+! %S#X 678	!
 
#s(^!L /3;?$tCH~v-.$DcN+$ %S#X 678$ 
#s(^	$R /3;?!tCH~v-.!DcN+! %S#X 678! 
#s(^	!L /3;?ntCH~v-.nDcN+n %S#X 678n 
#s(^	nf /3;?vtCH~v-.vDcN+v %S#X 678v 
#s(^	vx /3;?	tCH~v-. DcN+ %S#X 678	
 
#s(^8 /3;?	tCH~v-. DcN+ %S#X 678	
 
#s(^6 /3;? tCH~v-. DcN+  %S#X 678  
#s(^	 J /3;? tCH~v-. DcN+  %S#X 678  
#s(^	 J /3;?otCH~v-.oDcN+o %S#X 678o 
#s(^	oh /3;?HtCH~v-.HDcN+H %S#X 678H 
#s(^	HZ /3;?(tCH~v-.(DcN+( %S#X 678( 
#s(^	(Z /3;?$tCH~v-.$DcN+$ %S#X 678$ 
#s(^	$T /3;?	))tCH~v-.) DcN+) %S#X 678	)
 
#s(^)^ /3;?	))tCH~v-.) DcN+) %S#X 678	)
 
#s(^)\ /3;?tCH~v-.DcN+ %S#X 678 
#s(^	F /3;?tCH~v-.DcN+ %S#X 678 
#s(^	F /3;?tCH~v-.DcN+ %S#X 678 
#s(^	< /3;?tCH~v-.DcN+ %S#X 678 
#s(^	< /3;?tCH~v-.DcN+ %S#X 678 
#s(^	2 /3;?tCH~v-.DcN+ %S#X 678 
#s(^	D /3;?"tCH~v-."DcN+" %S#X 678" 
#s(^	"N /3;?tCH~v-.DcN+ %S#X 678 
#s(^	$ /3;?tCH~v-.DcN+ %S#X 678 
#s(^	( /3;?vtCH~v-.vDcN+v %S#X 678v 
#s(^	vx /3;?	tCH~v-. DcN+ %S#X 678	
 
#s(^( /3;?	tCH~v-. DcN+ %S#X 678	
 
#s(^& /3;?tCH~v-.DcN+ %S#X 678 
#s(^	. /3;?tCH~v-.DcN+ %S#X 678 
#s(^	: /3;?%tCH~v-.%DcN+% %S#X 678% 
#s(^	%T /3;?-tCH~v-.-DcN+- %S#X 678- 
#s(^	-d /3;?tCH~v-.DcN+ %S#X 678 
#s(^	, /3;?tCH~v-.DcN+ %S#X 678 
#s(^	0 /3;?tCH~v-.DcN+ %S#X 678 
#s(^	0 /3;?tCH~v-.DcN+ %S#X 678 
#s(^	2 /3;?	tCH~v-. DcN+ %S#X 678	
 
#s(^H /3;?	tCH~v-. DcN+ %S#X 678	
 
#s(^H /3;?	tCH~v-. DcN+ %S#X 678	
 
#s(^$ /3;?	tCH~v-. DcN+ %S#X 678	
 
#s(^" /3;?tCH~v-.DcN+ %S#X 678 
#s(^	: /3;?tCH~v-.DcN+ %S#X 678 
#s(^	: /3;?tCH~v-.DcN+ %S#X 678 
#s(^	, /3;?7tCH~v-.7DcN+7 %S#X 6787 
#s(^	7x /3;?6tCH~v-.6DcN+6 %S#X 6786 
#s(^	6v /3;?tCH~v-.DcN+ %S#X 678 
#s(^	* /3;?PtCH~v-.PDcN+P %S#X 678P 
#s(^	Pj /3;?GtCH~v-.GDcN+G %S#X 678G 
#s(^	GX /3;?tCH~v-.DcN+ %S#X 678 
#s(^	( /3;?LtCH~v-.LDcN+L %S#X 678L 
#s(^	Ld /3;?	tCH~v-. DcN+ %S#X 678	
 
#s(^: /3;?tCH~v-.DcN+ %S#X 678 
#s(^	* /3;?tCH~v-.DcN+ %S#X 678 
#s(^	F /3;?5tCH~v-.5DcN+5 %S#X 6785 
#s(^	5t /3;?tCH~v-.DcN+ %S#X 678 
#s(^	B /3;?tCH~v-.DcN+ %S#X 678 
#s(^	4 /3;?tCH~v-.DcN+ %S#X 678 
#s(^	4 /3;?tCH~v-.DcN+ %S#X 678 
#s(^	( /3;?tCH~v-.DcN+ %S#X 678 
#s(^	$ /3;?)tCH~v-.)DcN+) %S#X 678) 
#s(^	)^ /3;?	tCH~v-. DcN+ %S#X 678	
 
#s(^: /3;?tCH~v-.DcN+ %S#X 678 
#s(^	* /3;?tCH~v-.DcN+ %S#X 678 
#s(^	@ /3;?tCH~v-.DcN+ %S#X 678 
#s(^	. /3;?tCH~v-.DcN+ %S#X 678 
#s(^	D /3;?tCH~v-.DcN+ %S#X 678 
#s(^	D /3;?tCH~v-.DcN+ %S#X 678 
#s(^	: /3;?FtCH~v-.FDcN+F %S#X 678F 
#s(^	FV /3;?CtCH~v-.CDcN+C %S#X 678C 
#s(^	CP /3;?tCH~v-.DcN+ %S#X 678 
#s(^	6 /3;?tCH~v-.DcN+ %S#X 678 
#s(^	2 /3;?tCH~v-.DcN+ %S#X 678 
#s(^	4 /3;?	tCH~v-. DcN+ %S#X 678	
 
#s(^2 /3;?	tCH~v-. DcN+ %S#X 678	
 
#s(^0 /3;?LtCH~v-.LDcN+L %S#X 678L 
#s(^	Ld /3;?	!!tCH~v-.! DcN+! %S#X 678	!
 
#s(^!L /3;?tCH~v-.DcN+ %S#X 678 
#s(^	4 /3;?tCH~v-.DcN+ %S#X 678 
#s(^	* /3;?tCH~v-.DcN+ %S#X 678 
#s(^	0 /3;?tCH~v-.DcN+ %S#X 678 
#s(^	* /3;?tCH~v-.DcN+ %S#X 678 
#s(^	0 /3;?tCH~v-.DcN+ %S#X 678 
#s(^	0 /3;?tCH~v-.DcN+ %S#X 678 
#s(^	0 /3;?tCH~v-.DcN+ %S#X 678 
#s(^	0 /3;?tCH~v-.DcN+ %S#X 678 
#s(^	6E"[## E"PDF"+(( F"r#   