
    Gj=                    3   d dl Z d dlZd dlZd dlmZmZmZmZmZm	Z	 d dl
mZ ddlmZ ddlmZ ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZmZ  ej@                  d      Z!deddfdZ"deddfdZ#deddfdZ$	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdZ(	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdZ)	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdZ*	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdZ+	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdZ,	 	 ddede	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   f
d Z-	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd!Z.	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd"Z/	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd#Z0	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd$Z1	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd%Z2	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd&Z3	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd'Z4	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd(Z5	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd)Z6	 	 ddede	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   f
d*Z7	 	 ddede	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   f
d+Z8	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd,Z9	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd-Z:	 	 ddede	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   f
d.Z;	 	 ddede	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   f
d/Z<	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd0Z=	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd1Z>	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd2Z?	 	 ddede	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   f
d3Z@	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd4ZA	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd5ZB	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd6ZC	 	 ddede	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   f
d7ZD	 	 ddede	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   f
d8ZE	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd9ZF	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd:ZG	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd;ZH	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd<ZI	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd=ZJ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd>ZK	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd?ZL	 	 ddede	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   f
d@ZM	 	 ddede	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   f
dAZN	 	 ddede	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   f
dBZO	 	 ddede	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   f
dCZP	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdDZQ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdEZR	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdFZS	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdGZT	 	 ddede	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   f
dHZU	 	 ddede	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   f
dIZV	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdJZW	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdKZX	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdLZY	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdMZZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdNZ[	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdOZ\	 	 ddede	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   f
dPZ]	 	 ddede	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   f
dQZ^	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdRZ_	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdSZ`	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdTZa	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdUZb	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdVZc	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdWZd	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdXZe	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdYZf	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdZZg	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd[Zh	 	 ddede	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   f
d\Zi	 	 ddede	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   f
d]Zj	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd^Zk	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd_Zl	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd`Zm	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdaZn	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdbZo	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdcZp	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fddZq	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdeZr	 	 ddede	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   f
dfZs	 	 ddede	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   f
dgZt	 	 ddede	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   f
dhZu	 	 ddede	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   f
diZv	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdjZw	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdkZx	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdlZy	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdmZz	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdnZ{	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdoZ|	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdpZ}	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdqZ~	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdrZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdsZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdtZ	 	 ddede	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   f
duZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdvZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdwZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdxZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdyZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdzZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd{Z	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd|Z	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd}Z	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fd~Z	 	 ddede	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   f
dZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdZ	 	 ddede	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   f
dZ	 	 ddede	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   f
dZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdZ	 	 ddede	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   f
dZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdZ	 	 dde	e%e&ef   e'f   dee%e&ef      dee	e%e&ef   e'f      de%e&ef   fdZ G d dejJ                        Z G d dejJ                        Zy)    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                 <    | t        dg      v rt        |  d      y )N	ALLOW_ALLi enum value is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.set
ValueErrorr   s    Y/var/www/python/quitsure-support/venv/lib/python3.12/site-packages/google/genai/models.py(_PersonGeneration_to_mldev_enum_validater"   (   s2    3}%%
, < 	<  &    c                 <    | t        dg      v rt        |  d      y )N
BLOCK_NONEr   r   r    s    r!   )_SafetyFilterLevel_to_mldev_enum_validater&   0   s2    3~&&
, < 	<  'r#   c                 <    | t        dg      v rt        |  d      y )NSTYLEr   r   r    s    r!   4_VideoGenerationReferenceType_to_mldev_enum_validater)   8   s3     3y>!
, < 	<  "r#   from_objectparent_objectroot_objectc                 v   i }t        | dg      t        |dgt        | dg             t        | dg      t        d      t        | dg      t        d      t        | dg      t        d      t        | d	g      t        d
      t        | dg      t        d      t        | dg      t        d      |S )Napi_keyapiKeyapi_key_configzvapi_key_config parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.	auth_typezqauth_type parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.google_service_account_configzgoogle_service_account_config parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.http_basic_auth_configz~http_basic_auth_config parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.oauth_configztoauth_config parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.oidc_configzsoidc_config parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.getvsetvr   r*   r+   r,   	to_objects       r!   _AuthConfig_to_mldevr;   B   s   
 !)	+	{#/XJ[9+ >?	+()*6
	< 
 
+}%1
	< 
 
+789E
	M 
 
+012>
	M 
 
+'(4
	< 
 
+'3
	< 
 
r#   c                     i }t        | dg      t        |dgt        | dg             t        | dg      t        d      t        | dg      t        |dgt        | dg             |S )Ndatadisplay_nametdisplay_name parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.	mime_typemimeTyper6   r9   s       r!   _Blob_to_mldevrB   r   s    
 !)	+x ,VHd;9:	+'(4
	< 
 
+}%1ZL${[M"BC	r#   c           
      >   i }t        | dg      t        |dgt        | dg             t        | dg      $t        |dgt        t        | dg      ||             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |d	gt        | dg             t        | d
g      t        |dgt        | d
g             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      't        |dgt        | dg      D cg c]  }| c}       t        | dg      t        |dgt        | dg             |S c c}w )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      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                 |    i }t        | dg      't        |dgt        | dg      D cg c]  }| c}       |S c c}w )NcitationSources	citationsr7   r8   rW   s        r!   rV   rV      sQ    
 !)	+)*+7	{->,?@A$A 
 	Bs   	9c                     i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        d      |S )Noutcomeoutputidjid parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.r6   r9   s       r!   _CodeExecutionResult_to_vertexrc      s~    
 !)	+	{#/YKkI;!?@	+z".XJ[8* =>	+v*
	2 
 
r#   
api_clientc                 .   i }t        |dg      .t        |ddgt        j                  | t        |dg                   t        |dg      Et        |dgt        j                  t        |dg            D cg c]  }t        |||       c}       |S c c}w )Nmodel_urlcontents)r7   r8   tt_model
t_contents_Content_to_vertexrd   r*   r+   r,   r:   rX   s         r!   "_ComputeTokensParameters_to_vertexrn      s     !)	+y!-				*d;	:; 
+
|$0	 T+
|%DE	
 tY<	
 
	
s   5Bc                     i }t        | dg      t        |dgt        | dg             t        | dg      't        |dgt        | dg      D cg c]  }| c}       |S c c}w )NsdkHttpResponsesdk_http_response
tokensInfotokens_infor]   rW   s        r!   "_ComputeTokensResponse_from_vertexrt      s}    
 !)	+)*+7'(${=N<O*P 
+~&2	{\N;<$< 
 	=s   	Ac                    i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        d      |S )Nenvironmentexcluded_predefined_functionsexcludedPredefinedFunctions!enable_prompt_injection_detectionenablePromptInjectionDetectiondisabled_safety_policieszdisabled_safety_policies parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.r6   r9   s       r!   _ComputerUse_to_vertexr|     s    
 !)	+'3]OT+%GH	+789E	&'[:;< 
+;<=I	)*[>?@ 
+234@
	M 
 
r#   c                     i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             |S )N	truncatedrH   r]   r9   s       r!   '_ContentEmbeddingStatistics_from_vertexr   5  s[    
 !)	+}%1[M4k]#CD	+'3]OT+%GH	r#   c           
          i }t        | dg      t        |dgt        | dg             t        | dg      $t        |dgt        t        | dg      ||             |S )Nvalues
statistics)r7   r8   r   r9   s       r!   _ContentEmbedding_from_vertexr   D  sn    
 !)	+z".XJ[8* =>	+~&2	/|n-y+	
 
r#   c                     i }t        | dg      2t        |dgt        | dg      D cg c]  }t        |||       c}       t        | dg      t        |dgt        | dg             |S c c}w Npartsrole)r7   r8   _Part_to_mldevrW   s        r!   _Content_to_mldevr   Y  s    
 !)	+y!-		 [7)4	
 4K8	
 
+x ,VHd;9:		
   A*c                     i }t        | dg      2t        |dgt        | dg      D cg c]  }t        |||       c}       t        | dg      t        |dgt        | dg             |S c c}w r   )r7   r8   _Part_to_vertexrW   s        r!   rl   rl   o  s    
 !)	+y!-		 [7)4	
 D)[9	
 
+x ,VHd;9:		
r   c                     i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             |S )Ncontrol_typecontrolType enable_control_image_computationcomputeControlr]   r9   s       r!   !_ControlReferenceConfig_to_vertexr     si    
 !)	+'(4]OT+7G%HI	+:;<H	[=>? 
r#   c                     i }t        | dg      t        d      t        | dg      t        d      t        | dg      t        d      |S )Nsystem_instructionzzsystem_instruction parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.toolszmtools parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.generation_configzygeneration_config parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.r7   r   r9   s       r!   _CountTokensConfig_to_mldevr     s~    
 !)	+,-.:
	B 
 
+y!-
	3 
 
++,-9
	B 
 
r#   c                 |   i }t        | dg      7t        |dgt        t        j                  t        | dg            ||             t        | dg      2t        |dgt        | dg      D cg c]  }t        |||       c}       t        | dg      $t        |dgt        t        | dg      ||             |S c c}w )Nr   systemInstructionr   r   generationConfig)r7   r8   rl   ri   	t_content_Tool_to_vertex_GenerationConfig_to_vertexrW   s        r!   _CountTokensConfig_to_vertexr     s    
 !)	+,-.:	KK[+?*@AB	
 
+y!-		 [7)4	
 D)[9	
 
++,-9	#234i	
 
	
s   +B9c                 x   i }t        |dg      .t        |ddgt        j                  | t        |dg                   t        |dg      Et        |dgt        j                  t        |dg            D cg c]  }t        |||       c}       t        |dg      t        t        |dg      ||       |S c c}w Nrf   rg   rh   config)r7   r8   ri   rj   rk   r   r   rm   s         r!   _CountTokensParameters_to_mldevr     s     !)	+y!-				*d;	:; 
+
|$0	 T+
|%DE	
 dI{;	
 
+z".[8*%y+ 
	
   5B7c                 x   i }t        |dg      .t        |ddgt        j                  | t        |dg                   t        |dg      Et        |dgt        j                  t        |dg            D cg c]  }t        |||       c}       t        |dg      t        t        |dg      ||       |S c c}w r   )r7   r8   ri   rj   rk   rl   r   rm   s         r!    _CountTokensParameters_to_vertexr     s     !)	+y!-				*d;	:; 
+
|$0	 T+
|%DE	
 tY<	
 
+z". [8*%y+ 
	
r   c                     i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             |S )Nrp   rq   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                     i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             |S )Nrp   rq   r   r   r]   r9   s       r!    _CountTokensResponse_from_vertexr   4  sg    
 !)	+)*+7'(${=N<O*P 
+'3^$d;&HI	r#   c                     i }t        |dg      .t        |ddgt        j                  | t        |dg                   |S Nrf   rg   namer7   r8   ri   rj   rd   r*   r+   r,   r:   s        r!   _DeleteModelParameters_to_mldevr   E  J     !)	+y!-				*d;	:; 
r#   c                     i }t        |dg      .t        |ddgt        j                  | t        |dg                   |S r   r   r   s        r!    _DeleteModelParameters_to_vertexr   V  r   r#   c                 V    i }t        | dg      t        |dgt        | dg             |S Nrp   rq   r]   r9   s       r!   _DeleteModelResponse_from_mldevr   g  @    
 !)	+)*+7'(${=N<O*P 
r#   c                 V    i }t        | dg      t        |dgt        | dg             |S r   r]   r9   s       r!    _DeleteModelResponse_from_vertexr   u  r   r#   c                 6   i }t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |dd	gt        | dg             t        | d
g      t        |ddgt        | d
g             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |g dt        | dg             t        | dg      t        |g dt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |g d t        | dg             |S )!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                    i }t        |dg      .t        |ddgt        j                  | t        |dg                   t        |dg      t        |ddgt        |dg             t        |dg      3t        |ddgt        |dg      D cg c]  }t	        |||       c}       t        |dg      t        t        |dg      ||       |S c c}w )Nrf   rg   promptinstances[0]reference_imagesreferenceImagesr   )r7   r8   ri   rj   _ReferenceImageAPI_to_vertexr   rm   s         r!   _EditImageParameters_to_vertexr     s     !)	+y!-				*d;	:; 
+z".^X.[8*0MN	+*+,8	*+ [+=*>?	
 )y+F	
 
+z".[8*%y+ 
	
s   
Cc                     i }t        | dg      t        |dgt        | dg             t        | dg      2t        |dgt        | dg      D cg c]  }t        |||       c}       |S c c}w Nrp   rq   predictionsgenerated_imagesr7   r8   _GeneratedImage_from_vertexrW   s        r!   _EditImageResponse_from_vertexr         
 !)	+)*+7'(${=N<O*P 
+'3	 [=/:	
 (iE	
 
	
   A*c                    i }t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        d      t        | d	g      t        d
      t        | dg      t        d      t        | dg      t        d      |S )N	task_type
requests[]taskTypetitleoutput_dimensionalityoutputDimensionalityr@   zqmime_type parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.auto_truncatezuauto_truncate parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.document_ocrztdocument_ocr parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.audio_track_extractionz~audio_track_extraction parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.r6   r9   s       r!   _EmbedContentConfig_to_mldevr   7  s.   
 !)	+}%1	z"[;-( 
+y!-w/kG91MN	+/01=	-.[234 
+}%1
	< 
 
+()5
	< 
 
+'(4
	< 
 
+012>
	M 
 
r#   c                    i }t        |dg      }|d}|dk(  r(t        | dg      Gt        |ddgt        | dg             n,|dk(  r't        | dg      t        |ddgt        | dg             t        |dg      }|d}|dk(  r(t        | dg      Gt        |ddgt        | dg             n,|dk(  r't        | dg      t        |ddgt        | dg             t        |dg      }|d}|dk(  r(t        | d	g      Gt        |d
dgt        | d	g             n,|dk(  r't        | d	g      t        |ddgt        | d	g             t        |dg      }|d}|dk(  r't        | dg      t        |ddgt        | dg             t        |dg      }|d}|dk(  r(t        | dg      Gt        |d
dgt        | dg             n,|dk(  r't        | dg      t        |ddgt        | dg             t        |dg      }|d}|dk(  r't        | dg      t        |ddgt        | dg             t        |dg      }|d}|dk(  r't        | dg      t        |ddgt        | dg             |S )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  i  sG   
 !){%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                 2   i }t        |dg      .t        |ddgt        j                  | t        |dg                   t        |dg      <t        |ddgt        j                  | t        |dg            D cg c]  }| c}       t        |dg      +t        t        j                  t        |dg            ||       t        |dg      t        t        |dg      ||       t        |ddgt        j                  | t        |dg                   |S c c}w )Nrf   rg   rh   r   rD   r   )r7   r8   ri   rj   t_contents_for_embedr   r   r   rm   s         r!   '_EmbedContentParametersPrivate_to_mldevr    s+    !)	+y!-				*d;	:; 
+
|$0	y! ..Dzl;	
 	
	 
+	{#/	Dyk23Y 
+z". [8*%y+ Wii
Dwi89
 
/	
s   7	Dc                 F   i }t        |dg      .t        |ddgt        j                  | t        |dg                   t        |dg      }|d}|dk(  rIt        |dg      <t        |ddgt        j                  | t        |dg            D cg c]  }| c}       t        |dg      }|d}|dk(  rDt        |dg      7t        |dgt        t        j                  t        |dg            ||             t        |d	g      t        t        |d	g      ||       |S c c}w )
Nrf   rg   r   r   rh   r  rD   r  r   )r7   r8   ri   rj   r
  rl   r   r  )rd   r*   r+   r,   r:   r  rX   s          r!   (_EmbedContentParametersPrivate_to_vertexr    sW    !)	+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                    i }t        | dg      t        |dgt        | dg             t        | dg      't        |dgt        | dg      D cg c]  }| c}       t        | dg      t        |dgt        | dg             |S c c}w )Nrp   rq   
embeddingsmetadatar]   rW   s        r!    _EmbedContentResponse_from_mldevr  ;  s    
 !)	+)*+7'(${=N<O*P 
+~&2	{\N;<$< 
+
|$0ZL${ZL"AB	 	=s   	Bc                    i }t        | dg      t        |dgt        | dg             t        | ddg      3t        |dgt        | ddg      D cg c]  }t        |||       c}       t        | dg      t        |dgt        | dg             t        |dg      dk(  rat        | dg      }t        | d	g      }t        | d
g      }|r8i }|r|j                  d      r|d   |d<   |r||d
<   ||d<   t        |dg|g       |S c c}w )Nrp   rq   zpredictions[]r  r  r   r  	embeddingusageMetadatar~   promptTokenCountrH   r   )r7   r8   r   get)	r*   r+   r,   r:   rX   r  usage_metadatar~   statss	            r!   !_EmbedContentResponse_from_vertexr  S  sJ   
 !)	+)*+7'(${=N<O*P 
+67C	 [?L*IJ	
 *$	;G	
 
+
|$0ZL${ZL"AB	+,-./A[;-0I+'89N[;-0Ie	N../AB-.@Am	&k %i
9|nyk2	-	
s   Dc                     i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             |S )Nendpointr   deployedModelIddeployed_model_idr]   r9   s       r!   _Endpoint_from_vertexr  {  sf    
 !)	+
|$0VHd;=>	+)*+7'(${=N<O*P 
r#   c                     i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        d      |S )Ncoder   ra   rb   r6   r9   s       r!   _ExecutableCode_to_vertexr!    s~    
 !)	+x ,VHd;9:	+
|$0ZL${ZL"AB	+v*
	2 
 
r#   c                     i }t        | dg      t        d      t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             |S )Nr>   r?   file_urifileUrir@   rA   )r7   r   r8   r9   s       r!   _FileData_to_mldevr%    s    
 !)	+'(4
	< 
 
+
|$0YKkJ<!@A	+}%1ZL${[M"BC	r#   c                 N   i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        d      t        | dg      t        d      |S )Nra   argsr   partial_argsztpartial_args parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.will_continuezuwill_continue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.r6   r9   s       r!   _FunctionCall_to_mldevr*    s    
 !)	+v*TFDtf56	+x ,VHd;9:	+x ,VHd;9:	+'(4
	< 
 
+()5
	< 
 
r#   c                     i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        d      |S )Nallowed_function_namesallowedFunctionNamesmodestream_function_call_argumentszstream_function_call_arguments parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.r6   r9   s       r!   _FunctionCallingConfig_to_mldevr0    s    
 !)	+012>	 [345 
+x ,VHd;9:	+89:F
	M 
 
r#   c                 X
   i }t        |dg      7t        |dgt        t        j                  t        |dg            ||             t        |dg      t        |dgt        |dg             t        |dg      t        |dgt        |dg             t        |dg      t        |dgt        |dg             t        |dg      t        |d	gt        |dg             t        |d
g      t        |dgt        |d
g             t        |dg      t        |dgt        |dg             t        |dg      t        |dgt        |dg             t        |dg      t        |dgt        |dg             t        |dg      t        |dgt        |dg             t        |dg      t        |dgt        |dg             t        |dg      t        |dgt        |dg             t        |dg      t        |dgt        |dg             t        |dg      -t        |dgt        j
                  | t        |dg                   t        |dg      t        |dgt        |dg             t        |dg      t        d      t        |dg      t        d      t        |d g      2t        |d!gt        |d g      D cg c]  }t        |||       c}       t        |d"g      Zt        |d"gt        j                  | t        |d"g            D cg c]#  }t        t        j                  | |      ||      % c}       t        |d#g      $t        |d$gt        t        |d#g      ||             t        |d%g      t        d&      t        |d'g      -t        |d(gt        j                  | t        |d'g                   t        |d)g      t        |d*gt        |d)g             t        |d+g      t        |d,gt        |d+g             t        |d-g      ,t        |d.gt        j                  t        |d-g                   t        |d/g      t        d0      t        |d1g      t        |d2gt        |d1g             t        |d3g      $t        |d4gt        t        |d3g      ||             t        |d5g      t        |d6gt        |d5g             t        |d7g      t        d8      t        |d9g      t        |d:gt        |d9g             |S c c}w c c}w );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responseSchemaresponse_json_schemaresponseJsonSchemarouting_configzvrouting_config parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.model_selection_configz~model_selection_config parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.safety_settingssafetySettingsr   tool_config
toolConfigr   nlabels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.cached_contentcachedContentresponse_modalitiesresponseModalitiesmedia_resolutionmediaResolutionspeech_configspeechConfigaudio_timestampzwaudio_timestamp parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.thinking_configthinkingConfigimage_configimageConfigenable_enhanced_civic_answersenableEnhancedCivicAnswersmodel_armor_configzzmodel_armor_config parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.service_tierserviceTier)r7   r8   r   ri   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_mldevrm   s         r!   _GenerateContentConfig_to_mldevrl    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
	< 
 
+012>
	M 
 
+)*+7	 [+<*=>	
 $D)[A	
 
+y!-		 		*d;	.JK	
 188J5y+N	
 
+'3	}o.	;	
 
+z".
	3 
 
+()*6		[+;*<=	
 
+-./;	[012 
+*+,8%&[;M:N(O 
+()5		${_,=>? 
+)*+7
	< 
 
+)*+7%&[;L:M(NO	+'(4	~./K	
 
+789E	%&[:;< 
+,-.:
	B 
 
+'(4kN;K)LM	{	
	
s   T"(T'c                 
   i }t        |dg      7t        |dgt        t        j                  t        |dg            ||             t        |dg      t        |dgt        |dg             t        |dg      t        |dgt        |dg             t        |dg      t        |dgt        |dg             t        |dg      t        |d	gt        |dg             t        |d
g      t        |dgt        |d
g             t        |dg      t        |dgt        |dg             t        |dg      t        |dgt        |dg             t        |dg      t        |dgt        |dg             t        |dg      t        |dgt        |dg             t        |dg      t        |dgt        |dg             t        |dg      t        |dgt        |dg             t        |dg      t        |dgt        |dg             t        |dg      -t        |dgt        j
                  | t        |dg                   t        |dg      t        |dgt        |dg             t        |dg      t        |dgt        |dg             t        |dg      t        |dgt        |dg             t        |d g      't        |d!gt        |d g      D cg c]  }| c}       t        |d"g      Zt        |d"gt        j                  | t        |d"g            D cg c]#  }t        t        j                  | |      ||      % c}       t        |d#g      $t        |d$gt        t        |d#g      ||             t        |d%g      t        |d%gt        |d%g             t        |d&g      -t        |d'gt        j                  | t        |d&g                   t        |d(g      t        |d)gt        |d(g             t        |d*g      t        |d+gt        |d*g             t        |d,g      7t        |d-gt        t        j                  t        |d,g            ||             t        |d.g      t        |d/gt        |d.g             t        |d0g      t        |d1gt        |d0g             t        |d2g      $t        |d3gt        t        |d2g      ||             t        |d4g      t        d5      t        |d6g      t        |d7gt        |d6g             t        |d8g      t        |d9gt        |d8g             |S c c}w c c}w ):Nr   r   r2  r3  r4  r5  r6  r7  r8  r9  r:  r;  r<  r=  r>  r?  r@  rA  rB  rC  r   rD  rE  rF  rG  rH  rI  rJ  routingConfigrK  modelConfigrL  rM  r   rN  rO  r   rQ  rR  rS  rT  rU  rV  rW  rX  rY  audioTimestamprZ  r[  r\  r]  r^  enable_enhanced_civic_answers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.r`  modelArmorConfigra  rb  )r7   r8   rl   ri   r   rc  re  r   rg  _ToolConfig_to_vertexri  _SpeechConfig_to_vertexrj  _ImageConfig_to_vertexr   rm   s         r!    _GenerateContentConfig_to_vertexrv    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	
 AHHZ6	;O	
 
+'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	~./K	
 
+789E
	M 
 
+,-.:	[/01 
+'(4kN;K)LM	q 	B	
s   	U'(Uc                    i }t        |dg      .t        |ddgt        j                  | t        |dg                   t        |dg      Et        |dgt        j                  t        |dg            D cg c]  }t        |||       c}       t        |dg      %t        |dgt        | t        |dg      ||             |S c c}w Nrf   rg   rh   r   r   )r7   r8   ri   rj   rk   r   rl  rm   s         r!   #_GenerateContentParameters_to_mldevry  p  s     !)	+y!-				*d;	:; 
+
|$0	 T+
|%DE	
 dI{;	
 
+z".	'[8*5y+	
 
	
   5Cc                    i }t        |dg      .t        |ddgt        j                  | t        |dg                   t        |dg      Et        |dgt        j                  t        |dg            D cg c]  }t        |||       c}       t        |dg      %t        |dgt        | t        |dg      ||             |S c c}w rx  )r7   r8   ri   rj   rk   rl   rv  rm   s         r!   $_GenerateContentParameters_to_vertexr|    s     !)	+y!-				*d;	:; 
+
|$0	 T+
|%DE	
 tY<	
 
+z".	([8*5y+	
 
	
rz  c                 Z   i }t        | dg      t        |dgt        | dg             t        | dg      2t        |dgt        | dg      D cg c]  }t        |||       c}       t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |d	gt        | dg             t        | d
g      t        |dgt        | d
g             t        | dg      t        |dgt        | dg             |S c c}w )Nrp   rq   
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	
 "$	;?	
 
+'(4_%tK.9I'JK	+()*6&'k<L;M)NO	+~&2]OT+~%FG	+()5%&[?:K(LM	+'3^$d;&HI	+	
s   D(c                 D   i }t        | dg      t        |dgt        | dg             t        | dg      't        |dgt        | dg      D cg c]  }| c}       t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |d	gt        | dg             t        | d
g      t        |dgt        | d
g             t        | dg      t        |dgt        | dg             |S c c}w )Nrp   rq   r~  
createTimecreate_timer  r  r  r  r  r  r  r  r]   rW   s        r!   $_GenerateContentResponse_from_vertexr    sH   
 !)	+)*+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                    i }t        | dg      t        d      t        | dg      t        d      t        | dg      t        |ddgt        | dg             t        | dg      t        |dd	gt        | dg             t        | d
g      t        |ddgt        | d
g             t        | dg      t        d      t        | dg      0t        t        | dg             t        |ddgt        | dg             t        | dg      0t	        t        | dg             t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |g dt        | dg             t        | dg      t        |g dt        | dg             t        | dg      t        d      t        | dg      t        d      t        | dg      t        |dd gt        | dg             t        | d!g      t        d"      |S )#Nr   voutput_gcs_uri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.r   zwnegative_prompt parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.r   r   r   r   r   r   r   r   lseed parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.r   r   r   r   r   r   r   r   r   r   r   r   r   r   zuadd_watermark parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.r   rP  
image_sizesampleImageSizeenhance_promptzvenhance_prompt parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.)r7   r   r8   r&   r"   r9   s       r!   _GenerateImagesConfig_to_mldevr    sD   
 !)	+()*6
	< 
 
+)*+7
	< 
 
+*+,8	}%[-./ 
+'(4	}%[>*+ 
+()*6	'[+,- 
+x ,
	3 
 
+-./;-[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
	< 
 
+z".
	3 
 
+~&2	()[<.) 
+()*6
	< 
 
r#   c                 6   i }t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |dd	gt        | dg             t        | d
g      t        |ddgt        | d
g             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |g dt        | dg             t        | dg      t        |g dt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |dd gt        | dg             |S )!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                    i }t        |dg      .t        |ddgt        j                  | t        |dg                   t        |dg      t        |ddgt        |dg             t        |dg      t	        t        |dg      ||       |S Nrf   rg   r   r   r   )r7   r8   ri   rj   r  r   s        r!   "_GenerateImagesParameters_to_mldevr    s     !)	+y!-				*d;	:; 
+z".^X.[8*0MN	+z"."[8*%y+ 
r#   c                    i }t        |dg      .t        |ddgt        j                  | t        |dg                   t        |dg      t        |ddgt        |dg             t        |dg      t	        t        |dg      ||       |S r  )r7   r8   ri   rj   r  r   s        r!   #_GenerateImagesParameters_to_vertexr    s     !)	+y!-				*d;	:; 
+z".^X.[8*0MN	+z".#[8*%y+ 
r#   c                 @   i }t        | dg      t        |dgt        | dg             t        | dg      2t        |dgt        | dg      D cg c]  }t        |||       c}       t        | dg      $t        |dgt        t        | dg      ||             |S c c}w Nrp   rq   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	 [=/:	
 'tYD	
 
+89:F	,-$?@A	
 
#	
   Bc                 @   i }t        | dg      t        |dgt        | dg             t        | dg      2t        |dgt        | dg      D cg c]  }t        |||       c}       t        | dg      $t        |dgt        t        | dg      ||             |S c c}w r  )r7   r8   r   _SafetyAttributes_from_vertexrW   s        r!   #_GenerateImagesResponse_from_vertexr  R  s    
 !)	+)*+7'(${=N<O*P 
+'3	 [=/:	
 (iE	
 
+89:F	,-%?@A	
 
#	
r  c                    i }t        | dg      t        |ddgt        | dg             t        | dg      t        d      t        | dg      t        d      t        | dg      t        |dd	gt        | dg             t        | d
g      t        d      t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        d      t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        d      t        | dg      %t        |ddgt        t        | dg      ||             t        | dg      3t        |ddgt        | dg      D cg c]  }t	        |||       c}       t        | dg      t        d      t        | d g      t        d!      t        | d"g      t        d#      t        | d$g      t        |d%gt        | d$g             t        | d&g      t        d'      |S c c}w )(Nnumber_of_videosr   r   r   r  fpszkfps parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.duration_secondsdurationSecondsr   r  r   r   
resolutionr   r   pubsub_topicztpubsub_topic parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.r   r   r  r  generate_audiozvgenerate_audio parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.
last_framer   	lastFramer   r   maskzlmask parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.compression_qualityz{compression_quality parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.r   rP  webhook_configwebhookConfigresize_modezsresize_mode parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.)r7   r8   r   _Image_to_mldev'_VideoGenerationReferenceImage_to_mldevrW   s        r!   _GenerateVideosConfig_to_mldevr  u  s   
 !)	+*+,8	}%[-./ 
+()*6
	< 
 
+w+
	3 
 
+*+,8	()[-./ 
+x ,
	3 
 
+'(4	}%[>*+ 
+~&2	|$[<.) 
++,-9	)*[./0 
+'(4
	< 
 
+)*+7	'([,-. 
+()*6	'[+,- 
+()*6
	< 
 
+~&2	%|n-y+	
 
+*+,8	*+
 [+=*>?		
  4i	
	 
+x ,
	3 
 
+-./;
	B 
 
+z".
	3 
 
+()*6(${=M<N*O 
+'3
	< 
 
K	
s   #Jc                    i }t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | d	g      t        |dd	gt        | d	g             t        | d
g      t        |ddgt        | d
g             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      %t        |ddgt        t        | dg      ||             t        | dg      3t        |ddgt        | dg      D cg c]  }t        |||       c}       t        | dg      %t        |ddgt	        t        | dg      ||             t        | dg      t        |ddgt        | dg             t        | dg      t        |dgt        | dg             t        | d g      t        d!      t        | d"g      t        |dd#gt        | d"g             |S c c}w )$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  zvwebhook_config parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.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i	
	 
+x ,	 &vh'K	
 
+-./;	+,[012 
+z".
Dxj$AB	+()*6
	? 
 
+'3	|$[=/* 
Q	
s   .L	c                    i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | ddg      %t        |dgt        t        | ddg      ||             t        | ddg      %t        |dgt        t        | ddg      ||             |S )Nr   r  doneerrorresponse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           
         i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      $t        |dgt        t        | dg      ||             t        | dg      $t        |dgt        t        | dg      ||             |S )Nr   r  r  r  r  r  )r7   r8   #_GenerateVideosResponse_from_vertexr9   s       r!   $_GenerateVideosOperation_from_vertexr  	  s   
 !)	+x ,VHd;9:	+
|$0ZL${ZL"AB	+x ,VHd;9:	+y!-WItK';<	+
|$0	+zl+Y	
 
+
|$0	
+zl+Y	
 
r#   c                 *   i }t        |dg      .t        |ddgt        j                  | t        |dg                   t        |dg      t        |ddgt        |dg             t        |dg      %t        |ddgt	        t        |dg      ||             t        |dg      %t        |ddgt        t        |dg      ||             t        |dg      t        t        |dg      ||       t        |dg      t        t        |dg      ||       |S 	Nrf   rg   r   r   imagevideosourcer   )r7   r8   ri   rj   r  _Video_to_mldev_GenerateVideosSource_to_mldevr  r   s        r!   "_GenerateVideosParameters_to_mldevr  	  s7    !)	+y!-				*d;	:; 
+z".^X.[8*0MN	+y!-	![7)4iM 
+y!-	![7)4iM 
+z"."[8*%y+ 
+z"."[8*%y+ 
r#   c                 *   i }t        |dg      .t        |ddgt        j                  | t        |dg                   t        |dg      t        |ddgt        |dg             t        |dg      %t        |ddgt	        t        |dg      ||             t        |dg      %t        |ddgt        t        |dg      ||             t        |dg      t        t        |dg      ||       t        |dg      t        t        |dg      ||       |S r  )r7   r8   ri   rj   r  _Video_to_vertex_GenerateVideosSource_to_vertexr  r   s        r!   #_GenerateVideosParameters_to_vertexr  	
  s7    !)	+y!-				*d;	:; 
+z".^X.[8*0MN	+y!-	!kG95y+N 
+y!-	!kG95y+N 
+z".#[8*%y+ 
+z".#[8*%y+ 
r#   c                 *   i }t        | dg      2t        |dgt        | dg      D cg c]  }t        |||       c}       t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             |S c c}w )NgeneratedSamplesgenerated_videosraiMediaFilteredCountrai_media_filtered_countraiMediaFilteredReasonsrai_media_filtered_reasons)r7   r8   _GeneratedVideo_from_mldevrW   s        r!   r  r  5
  s    
 !)	+*+,8	 [+=*>?	
 'tYD	
 
+/01=	#$[234 
+123?	%&[456 
)	
   Bc                 *   i }t        | dg      2t        |dgt        | dg      D cg c]  }t        |||       c}       t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             |S c c}w )Nvideosr  r  r  r  r  )r7   r8   _GeneratedVideo_from_vertexrW   s        r!   r  r  V
  s    
 !)	+z".	 [8*5	
 (iE	
 
+/01=	#$[234 
+123?	%&[456 
)	
r  c           
          i }t        | dg      t        |ddgt        | dg             t        | dg      %t        |ddgt        t        | dg      ||             t        | dg      %t        |ddgt        t        | dg      ||             |S Nr   r   r  r  )r7   r8   r  r  r9   s       r!   r  r  w
  s    
 !)	+z".14hZ3P 
+y!-	![7)4iM 
+y!-	![7)4iM 
r#   c           
          i }t        | dg      t        |ddgt        | dg             t        | dg      %t        |ddgt        t        | dg      ||             t        | dg      %t        |ddgt        t        | dg      ||             |S r  )r7   r8   r  r  r9   s       r!   r  r  
  s    
 !)	+z".14hZ3P 
+y!-	!kG95y+N 
+y!-	!kG95y+N 
r#   c           
          i }t        | dg      $t        |dgt        t        | dg      ||             t        | dg      't        |dgt        | dg      D cg c]  }| c}       |S c c}w )N_selfr  r   )r7   r8   _Image_from_vertexrW   s        r!   _GeneratedImageMask_from_vertexr  
  s    
 !)	+y!-	wi()[	
 
+z".H:kH:1NOO 
  Ps   	A*c           
         i }t        | dg      $t        |dgt        t        | dg      ||             t        | dg      t        |dgt        | dg             t        | dg      $t        |dgt        t        | dg      ||             |S )Nr  r  raiFilteredReasonrai_filtered_reasonsafety_attributes)r7   r8   _Image_from_mldevr  r9   s       r!   r  r  
  s    
 !)	+y!-		${WI6	;O 
++,-9	[./0 
+y!-	$wi()[	
 
r#   c           
      f   i }t        | dg      $t        |dgt        t        | dg      ||             t        | dg      t        |dgt        | dg             t        | dg      $t        |dgt        t        | dg      ||             t        | dg      t        |dgt        | dg             |S )Nr  r  r  r  r  r   enhanced_prompt)r7   r8   r  r  r9   s       r!   r   r   
  s    
 !)	+y!-		wi()[	
 
++,-9	[./0 
+y!-	%wi()[	
 
+z".&'kH:)FG	r#   c           
      l    i }t        | dg      $t        |dgt        t        | dg      ||             |S )Nr  )r7   r8   _Video_from_mldevr9   s       r!   r  r    sE    
 !)	+y!-		${WI6	;O 
r#   c           
      l    i }t        | dg      $t        |dgt        t        | dg      ||             |S )Nr  r  )r7   r8   _Video_from_vertexr9   s       r!   r  r    sH    
 !)	+y!-		wi()[	
 
r#   c           
         i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | d	g      t        |d
gt        | d	g             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      $t        |d gt        t        | dg      ||             t        | d!g      t        |d"gt        | d!g             t        | d#g      t        |d#gt        | d#g             t        | d$g      t        |d%gt        | d$g             t        | d&g      t        |d'gt        | d&g             t        | d(g      t        |d)gt        | d(g             t        | d*g      t        d+      |S ),NrK  ro  rH  rI  rY  rp  r7  r8  enable_affective_dialogenableAffectiveDialogrB  rC  r?  r9  r:  rU  rV  r@  rA  r=  r>  rD  rE  rS  rT  rF  rG  rJ  rn  r   rW  rX  r;  r<  r2  rZ  r[  r5  r6  r3  r4  r^  rq  )r7   r8   rt  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
	M 
 
r#   c                     i }t        |dg      .t        |ddgt        j                  | t        |dg                   |S r   r   r   s        r!   _GetModelParameters_to_mldevr    r   r#   c                     i }t        |dg      .t        |ddgt        j                  | t        |dg                   |S r   r   r   s        r!   _GetModelParameters_to_vertexr    r   r#   c           
          i }t        | dg      $t        |dgt        t        | dg      ||             t        | dg      t        |dgt        | dg             |S )Nauth_config
authConfigenable_widgetenableWidget)r7   r8   r;   r9   s       r!   _GoogleMaps_to_mldevr    sq    
 !)	+'3	}o.	;	
 
+()5^$d;8I&JK	r#   c                    i }t        | dg      t        |dgt        | dg             t        | dg      t        d      t        | dg      t        d      t        | dg      t        |dgt        | dg             |S )	Nsearch_typessearchTypesblocking_confidencez{blocking_confidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.exclude_domainszwexclude_domains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.time_range_filtertimeRangeFilterr6   r9   s       r!   _GoogleSearch_to_mldevr	    s    
 !)	+'(4]OT+7G%HI	+-./;
	B 
 
+)*+7
	< 
 
++,-9%&[;N:O(P 
r#   c                    i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        d      t        | dg      t        d      t        | d	g      t        d
      t        | dg      t        d      t        | dg      t        d      |S )Nr   r   r  	imageSizer   zyperson_generation parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.prominent_peoplezxprominent_people parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.r   zxoutput_mime_type parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.r   zoutput_compression_quality parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.image_output_optionsz|image_output_options parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.r6   r9   s       r!   rk  rk    s   
 !)	+'(4]OT+7G%HI	+~&2[M4l^#DE	++,-9
	B 
 
+*+,8
	B 
 
+*+,8
	B 
 
+456B
	M 
 
+./0<
	B 
 
r#   c                 "   i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | d	g      t        |d
dgt        | d	g             t        | dg      t        |d
dgt        | dg             t        | dg      t        |d
gt        | dg             |S )Nr   r   r  r  r   r   r  prominentPeopler   imageOutputOptionsrA   r   r   r  r]   r9   s       r!   ru  ru  '  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           
          i }t        | dg      ,t        |dgt        j                  t        | dg                   t        | dg      t        |dgt        | dg             |S )NbytesBase64Encodedimage_bytesrA   r@   r7   r8   base_tt_bytesr9   s       r!   r  r  W  so    
 !)	+,-.:	tK*>)?@A 
+
|$0[M4j\#BC	r#   c           
         i }t        | dg      t        |dgt        | dg             t        | dg      ,t        |dgt        j                  t        | dg                   t        | dg      t        |dgt        | dg             |S )NgcsUrigcs_urir  r  rA   r@   r  r9   s       r!   r  r  k  s    
 !)	+z".YKkH:!>?	+,-.:	tK*>)?@A 
+
|$0[M4j\#BC	r#   c           
          i }t        | dg      t        d      t        | dg      ,t        |dgt        j                  t        | dg                   t        | dg      t        |dgt        | dg             |S )Nr  zogcs_uri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.r  r  r@   rA   )r7   r   r8   r  r  r9   s       r!   r  r    s    
 !)	+	{#/
	< 
 
+'3	tK-9: 
+}%1ZL${[M"BC	r#   c           
         i }t        | dg      t        |dgt        | dg             t        | dg      ,t        |dgt        j                  t        | dg                   t        | dg      t        |dgt        | dg             |S )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                 j   i }t        |dg      t        |ddgt        |dg             t        |dg      t        |ddgt        |dg             t        |dg      t        |ddgt        |dg             t        |dg      .t        |dd	gt        j                  | t        |dg                   |S 
N	page_size_querypageSize
page_token	pageTokenfilter
query_baserg   
models_urlr7   r8   ri   t_models_urlr   s        r!   _ListModelsConfig_to_mldevr(         !)	+}%1*-tK+/O 
+~&2	;[<.) 
+z".8,d;
.KL	+~&2		z4l^#DE 
r#   c                 j   i }t        |dg      t        |ddgt        |dg             t        |dg      t        |ddgt        |dg             t        |dg      t        |ddgt        |dg             t        |dg      .t        |dd	gt        j                  | t        |dg                   |S r  r&  r   s        r!   _ListModelsConfig_to_vertexr+    r)  r#   c                 V    i }t        |dg      t        | t        |dg      ||       |S Nr   )r7   r(  r   s        r!   _ListModelsParameters_to_mldevr.    s:     !)	+z".Dxj19k 
r#   c                 V    i }t        |dg      t        | t        |dg      ||       |S r-  )r7   r+  r   s        r!   _ListModelsParameters_to_vertexr0    s:     !)	+z".Dxj19k 
r#   c                 P   i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      Et        |dgt        j                  t        | dg            D cg c]  }t	        |||       c}       |S c c}w Nrp   rq   nextPageTokennext_page_tokenr  models)r7   r8   ri   t_extract_models_Model_from_mldevrW   s        r!   _ListModelsResponse_from_mldevr8    s    
 !)	+)*+7'(${=N<O*P 
+()5&'kO;L)MN	+y!-	
 **4gY+GH	
 dI{;	
 
	
   B#c                 P   i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      Et        |dgt        j                  t        | dg            D cg c]  }t	        |||       c}       |S c c}w r2  )r7   r8   ri   r6  _Model_from_vertexrW   s        r!   _ListModelsResponse_from_vertexr<  +  s    
 !)	+)*+7'(${=N<O*P 
+()5&'kO;L)MN	+y!-	
 **4gY+GH	
 tY<	
 
	
r9  c                     i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             |S )N	mask_modemaskModesegmentation_classesmaskClassesmask_dilationdilationr]   r9   s       r!   _MaskReferenceConfig_to_vertexrD  F  s    
 !)	+}%1ZL${[M"BC	+./0<M?D7M6N$O 
+()5ZL${_4E"FG	r#   c                 j    i }t        | dg      t        d      t        | dg      t        d      |S )Nr   zlname parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.streamable_http_transportzstreamable_http_transport parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.r   r9   s       r!   _McpServer_to_vertexrG  Z  sX    
 !)	+x ,
	2 
 
+345A
	M 
 
r#   c                    i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |d	gt        | dg             t        | d
g      t        |dgt        | d
g             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             |S )Nr   displayNamer>   descriptionversionr  tuned_model_infoinputTokenLimitinput_token_limitoutputTokenLimitoutput_token_limitsupportedGenerationMethodssupported_actionsr2  maxTemperaturemax_temperaturer4  r3  r6  r5  thinkingr]   r9   s       r!   r7  r7  o  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                 .   i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      2t        |dgt        | dg      D cg c]  }t        |||       c}       t        | d	g      t        |d	gt        | d	g             t        | d
g      $t        |dgt        t        | d
g      ||             t        | dg      t        |dgt        | dg             t        | dg      't        |dgt        | dg      D cg c]  }| c}       |S c c}w c c}w )Nr   rI  r>   rJ  	versionIdrK  deployedModels	endpointsr   r  rL  defaultCheckpointIddefault_checkpoint_idcheckpoints)r7   r8   r  _TunedModelInfo_from_vertexrW   s        r!   r;  r;    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                     i }t        | dg      2t        |dgt        | dg      D cg c]  }t        |||       c}       |S c c}w )Nspeaker_voice_configsspeakerVoiceConfigs)r7   r8   _SpeakerVoiceConfig_to_vertexrW   s        r!   "_MultiSpeakerVoiceConfig_to_vertexrb    sd    
 !)	+/01=	 [+B*CD	
 *$	;G	
 
	
   Ac           
      t   i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      $t        |dgt        t        | dg      ||             t        | d	g      $t        |d
gt        t        | d	g      ||             t        | dg      t        |dgt        | dg             t        | dg      $t        |dgt	        t        | dg      ||             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             |S )NrU  rV  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!   r   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           
      
   i }t        | dg      t        |dgt        | dg             t        | dg      $t        |dgt        t        | dg      ||             t        | dg      $t        |dgt        t        | dg      ||             t        | dg      t        |dgt        | dg             t        | d	g      t        |d
gt        | d	g             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t	        d      t        | dg      t	        d      t        | dg      t	        d      |S )NrU  rV  re  rf  rg  rh  ri  rj  rk  rl  rm  rn  ro  rp  rq  rr  rs  rt  ru  rv  rw  zqtool_call parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.ry  zutool_response parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.r{  zupart_metadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.)r7   r8   rc   r!  r   r9   s       r!   r   r   H  sw   
 !)	+*+,8%&[;M:N(O 
+/01=	&678)[	
 
+)*+7	!012I{	
 
+}%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
	9 
 
+()5
	? 
 
+()5
	? 
 
r#   c           
      l    i }t        | dg      $t        |dgt        t        | dg      ||             |S )Nproduct_imager  r7   r8   r  r9   s       r!   _ProductImage_to_vertexr    sJ    
 !)	+()5		/0)[	
 
r#   c                 b   i }t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | d	g      t        |dd
gt        | d	g             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |g dt        | dg             t        | dg      t        |g dt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |dgt        | dg             |S )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_vertexr    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                    i }t        |dg      .t        |ddgt        j                  | t        |dg                   t        |dg      t	        t        |dg      ||       t        |dg      t        t        |dg      ||       |S Nrf   rg   r  r   )r7   r8   ri   rj   _RecontextImageSource_to_vertexr  r   s        r!   #_RecontextImageParameters_to_vertexr    s     !)	+y!-				*d;	:; 
+z".#[8*%y+ 
+z".#[8*%y+ 
r#   c                     i }t        | dg      2t        |dgt        | dg      D cg c]  }t        |||       c}       |S c c}w )Nr   r   r   rW   s        r!   #_RecontextImageResponse_from_vertexr    s`    
 !)	+'3	 [=/:	
 (iE	
 
	
rc  c                 F   i }t        | dg      t        |ddgt        | dg             t        | dg      %t        |g dt        t        | dg      ||             t        | dg      3t        |ddgt        | dg      D cg c]  }t        |||       c}       |S c c}w )Nr   r   person_image)r   personImager  product_imagesproductImages)r7   r8   r  r  rW   s        r!   r  r  )  s    
 !)	+z".14hZ3P 
+'(40~./K	
 
+()*6	) [+;*<=	
 $D)[A	
 
	
s   Bc           
      `   i }t        | dg      $t        |dgt        t        | dg      ||             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      $t        |dgt        t        | dg      ||             t        | d	g      $t        |d
gt	        t        | d	g      ||             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             |S )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  rD  r   r9   s       r!   r   r   J  s   
 !)	+)*+7	012I{	
 
+'(4]OT+7G%HI	+()*6_%tK:J9K'LM	++,-9	&234i	
 
+./0<	)567K	
 
+,-.:	[/01 
+./0<	[123 
r#   c                    i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        d      t        | dg      t        d      |S )	Nr@   rA   voice_sample_audiovoiceSampleAudioconsent_audiozuconsent_audio parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.voice_consent_signaturezvoice_consent_signature parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.r6   r9   s       r!    _ReplicatedVoiceConfig_to_vertexr    s    
 !)	+}%1ZL${[M"BC	+,-.:	[/01 
+()5
	? 
 
+123?
	M 
 
r#   c           	          i }t        | ddg      t        |dgt        | ddg             t        | ddg      t        |dgt        | ddg             t        | dg      t        |dgt        | dg             |S 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           	          i }t        | ddg      t        |dgt        | ddg             t        | ddg      t        |dgt        | ddg             t        | dg      t        |dgt        | dg             |S r  r]   r9   s       r!   r  r    r  r#   c                     i }t        | dg      t        |dgt        | dg             t        | dg      t        d      t        | dg      t        |dgt        | dg             |S )Ncategorymethodznmethod parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.	thresholdr6   r9   s       r!   rd  rd    s~    
 !)	+
|$0ZL${ZL"AB	+z".
	3 
 
+}%1[M4k]#CD	r#   c           
      l    i }t        | dg      $t        |dgt        t        | dg      ||             |S )Nr  r  r9   s       r!   _ScribbleImage_to_vertexr    sE    
 !)	+y!-		kG95y+N 
r#   c                    i }t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | d	g      t        |dd
gt        | d	g             t        | dg      t        |dgt        | dg             |S )Nr.  r   max_predictionsmaxPredictionsconfidence_thresholdconfidenceThresholdrB  maskDilationbinary_color_thresholdbinaryColorThresholdr   r]   r9   s       r!   _SegmentImageConfig_to_vertexr    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                    i }t        |dg      .t        |ddgt        j                  | t        |dg                   t        |dg      t	        t        |dg      ||       t        |dg      t        t        |dg      ||       |S r  )r7   r8   ri   rj   _SegmentImageSource_to_vertexr  r   s        r!   !_SegmentImageParameters_to_vertexr  "  s     !)	+y!-				*d;	:; 
+z".![8*%y+ 
+z".![8*%y+ 
r#   c                     i }t        | dg      2t        |dgt        | dg      D cg c]  }t        |||       c}       |S c c}w )Nr   generated_masks)r7   r8   r  rW   s        r!   !_SegmentImageResponse_from_vertexr  =  s`    
 !)	+'3	 [=/:	
 ,D)[I	
 
	
rc  c           
          i }t        | dg      t        |ddgt        | dg             t        | dg      %t        |ddgt        t        | dg      ||             t        | dg      %t        |ddgt        t        | dg      ||             |S )Nr   r   r  scribble_imagescribble)r7   r8   r  r  r9   s       r!   r  r  P  s    
 !)	+z".14hZ3P 
+y!-	!kG95y+N 
+()*6	$ /019k	
 
r#   c           
          i }t        | dg      t        |dgt        | dg             t        | dg      $t        |dgt        t        | dg      ||             |S )Nspeakervoice_configvoiceConfig)r7   r8   _VoiceConfig_to_vertexr9   s       r!   ra  ra  n  sp    
 !)	+	{#/YKkI;!?@	+'(4	~./K	
 
r#   c           
         i }t        | dg      $t        |dgt        t        | dg      ||             t        | dg      t        |dgt        | dg             t        | dg      $t        |dgt        t        | dg      ||             |S )Nr  r  language_codelanguageCodemulti_speaker_voice_configmultiSpeakerVoiceConfig)r7   r8   r  rb  r9   s       r!   rt  rt    s    
 !)	+'(4	~./K	
 
+()5^$d;8I&JK	+456B	"#*;<=	
 
r#   c           
         i }t        | dg      t        |dgt        | dg             t        | dg      $t        |dgt        t        | dg      ||             t        | dg      t        |dgt        | dg             |S )Nretrieval_configretrievalConfigfunction_calling_configfunctionCallingConfig$include_server_side_tool_invocations includeServerSideToolInvocations)r7   r8   r0  r9   s       r!   rh  rh    s    
 !)	+*+,8%&[;M:N(O 
+123?	 !'89:	
 
+>?@L	+,[ABC 
r#   c                     i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        d      |S )Nr  r  r  r  r  zinclude_server_side_tool_invocations parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.r6   r9   s       r!   rs  rs    s    
 !)	+*+,8%&[;M:N(O 
+123?	 ![456 
+>?@L
	  
r#   c           
         i }t        | dg      t        d      t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      $t        |dgt        t        | dg      ||             t        | d	g      $t        |d
gt	        t        | d	g      ||             t        | dg      t        |dgt        | dg             t        | dg      t        d      t        | dg      't        |dgt        | dg      D cg c]  }| c}       t        | dg      t        |dgt        | dg             t        | dg      t        d      t        | dg      t        |dgt        | dg             t        | dg      't        |dgt        | dg      D cg c]  }| c}       |S c c}w c c}w )N	retrievalzqretrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.computer_usecomputerUsefile_search
fileSearchgoogle_searchgoogleSearchgoogle_maps
googleMapscode_executioncodeExecutionenterprise_web_searchz}enterprise_web_search parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.function_declarationsfunctionDeclarationsgoogle_search_retrievalgoogleSearchRetrievalparallel_ai_searchzzparallel_ai_search parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.url_context
urlContextmcp_servers
mcpServers)r7   r   r8   r	  r  rW   s        r!   rf  rf    sD   
 !)	+}%1
	< 
 
+'(4]OT+7G%HI	+'3\ND}o$FG	+()5	/0)[	
 
+'3	}o.	;	
 
+()*6_%tK:J9K'LM	+/01=
	B 
 
+/01=	 {-D,EFG$G 
+123?	 ![456 
+,-.:
	B 
 
+'3\ND}o$FG	+'3	{]O<=$= 
5 	H. 	>s   +	G	Gc                    i }t        | dg      t        |dgt        | dg             t        | dg      $t        |dgt        t        | dg      ||             t        | dg      t        d      t        | dg      t        |dgt        | dg             t        | dg      t        |d	gt        | dg             t        | d
g      t        |dgt        | d
g             t        | dg      t        |dgt        | dg             t        | dg      't        |dgt        | dg      D cg c]  }| c}       t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      2t        |dgt        | dg      D cg c]  }t	        |||       c}       |S c c}w c c}w )Nr  r  r  r  zsfile_search parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.r  r  r  r  r  r  r  enterpriseWebSearchr  r  r  r  r  parallelAiSearchr  r  r  r  )r7   r8   r|   r   rG  rW   s        r!   r   r   -  s\   
 !)	+}%1[M4k]#CD	+'(4	~./K	
 
+'3
	9 
 
+()5^$d;8I&JK	+'3\ND}o$FG	+()*6_%tK:J9K'LM	+/01=	[234 
+/01=	 {-D,EFG$G 
+123?	 ![456 
+,-.:	[/01 
+'3\ND}o$FG	+'3	 [=/:	
 !y+>	
 
= 	H0	
s   .	G1G6c           	          i }t        | ddg      	 t        |dgt        | ddg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             |S )Nr   z&google-vertex-llm-tuning-base-model-id
base_modelr  r  
updateTimeupdate_timer]   r9   s       r!   r]  r]  z  s    
 !)
;#KLM 		[8%MNO 
+~&2]OT+~%FG	+~&2]OT+~%FG	r#   c                     i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             |S Nr>   rI  rJ  r[  rZ  r]   r9   s       r!   _UpdateModelConfig_to_mldevr        
 !)	+'(4kN;K)LM	+'3kM?)KL	+/01=	[234 
r#   c                     i }t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             |S r  r]   r9   s       r!   _UpdateModelConfig_to_vertexr    r  r#   c                     i }t        |dg      .t        |ddgt        j                  | t        |dg                   t        |dg      t	        t        |dg      ||       |S )Nrf   rg   r   r   )r7   r8   ri   rj   r  r   s        r!   _UpdateModelParameters_to_mldevr    ss     !)	+y!-				*d;	:; 
+z".[8*%y+ 
r#   c                     i }t        |dg      .t        |ddgt        j                  | t        |dg                   t        |dg      t	        t        |dg      ||       |S )Nrf   rg   r   )r7   r8   ri   rj   r  r   s        r!    _UpdateModelParameters_to_vertexr    ss     !)	+y!-				*d;	:; 
+z". [8*%y+ 
r#   c                 b   i }t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |dd	gt        | dg             t        | d
g      t        |g dt        | d
g             t        | dg      t        |g dt        | dg             t        | dg      t        |g dt        | dg             t        | dg      t        |g dt        | dg             t        | dg      t        |dgt        | dg             t        | dg      t        |ddgt        | dg             t        | dg      t        |ddgt        | dg             |S )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    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                 |   i }t        |dg      .t        |ddgt        j                  | t        |dg                   t        |dg      %t        |ddgt	        t        |dg      ||             t        |dg      t        |g dt        |dg             t        |dg      t        t        |dg      ||       |S )Nrf   rg   r  r   upscale_factor)r   r   upscaleFactorr   )r7   r8   ri   rj   r  r  r   s        r!   $_UpscaleImageAPIParameters_to_vertexr  <  s     !)	+y!-				*d;	:; 
+y!-	!kG95y+N 
+()*68[+,- 
+z".$[8*%y+ 
r#   c                     i }t        | dg      t        |dgt        | dg             t        | dg      2t        |dgt        | dg      D cg c]  }t        |||       c}       |S c c}w r   r   rW   s        r!   !_UpscaleImageResponse_from_vertexr
  `  r   r   c           
          i }t        | dg      $t        |dgt        t        | dg      ||             t        | dg      t        |dgt        | dg             |S )Nr  r  r>  r?  r  r9   s       r!   r  r  x  sk    
 !)	+y!-		kG95y+N 
+}%1ZL${[M"BC	r#   c           
          i }t        | dg      $t        |dgt        t        | dg      ||             t        | dg      /t        t        | dg             t        |dgt        | dg             |S 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           
          i }t        | dg      $t        |dgt        t        | dg      ||             t        | dg      t        |dgt        | dg             |S r  r  r9   s       r!   r  r    sp    
 !)	+y!-		kG95y+N 
+()*6_%tK:J9K'LM	r#   c           
         i }t        | dg      t        |dgt        | dg             t        | dg      ,t        |dgt        j                  t        | dg                   t        | dg      t        |dgt        | dg             |S )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           
         i }t        | dg      t        |dgt        | dg             t        | dg      ,t        |dgt        j                  t        | dg                   t        | dg      t        |dgt        | dg             |S )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           
         i }t        | dg      t        |dgt        | dg             t        | dg      ,t        |dgt        j                  t        | dg                   t        | dg      t        |dgt        | dg             |S )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           
         i }t        | dg      t        |dgt        | dg             t        | dg      ,t        |dgt        j                  t        | dg                   t        | dg      t        |dgt        | dg             |S )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           
          i }t        | dg      $t        |dgt        t        | dg      ||             t        | dg      t        |dgt        | dg             |S )Nreplicated_voice_configreplicatedVoiceConfigprebuilt_voice_configprebuiltVoiceConfig)r7   r8   r  r9   s       r!   r  r    s    
 !)	+123?	 !(89:	
 
+/01=	[234 
r#   c                   	   e Zd Zdddedeej                  ej                  f   deej                     dej                  fdZdddedeej                  ej                  f   deej                     deej                     fdZddddd	dedeeej                  ej                  f      d
eeej                  ej                  f      deej                      deej"                     dej$                  fdZdddededeej(                     dej*                  fdZdddededeej0                     deej2                     dej4                  f
dZdddedej8                  dedeej:                     dej<                  f
dZdddedej@                  deejB                     dejD                  fdZ#dddedejH                  deejJ                     dejL                  fdZ'dddedeejP                     dejR                  fdZ*dddeejV                     dejX                  fdZ-dddedeej\                     dejR                  fdZ/dddedeej`                     dejb                  fdZ2dddedeej                  ej                  f   deejf                     dejh                  fdZ5dddedeej                  ej                  f   deejl                     dejn                  fdZ8dddddddedee   deej8                     deejr                     deejt                     deejv                     dejx                  fdZ=dddedeej                  ej                  f   deej"                     dej$                  fd Z>dddedej                  deej                     dej                  fd!Z?dddedej                  deej                     deej                     fd"Z@dddededeej(                     dej*                  fd#ZAdddededeej0                     deej2                     dej4                  f
d$ZBdddedej8                  dedeej                     dej<                  f
d%ZDdddddddedee   deej8                     deejr                     deejt                     deejv                     dejx                  fd&ZEdddeejV                     deFejR                     fd'Zy)(ModelsNr   rf   rh   r   r   c                   t        j                  |||      }| j                  j                  r@t	        | j                  |d |      }|j                  d      }|rdj                  |      }nBd}n?t        | j                  |d |      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd        d }	|j                  ,|j                  j                  |j                  j                  }	t        j                  |      }t        j                  |      }| j                  j                  d|||	      }
|@t!        |dd       r3t        j"                  |
	      }| j                  j%                  |       |S |
j&                  si nt)        j*                  |
j&                        }| j                  j                  rt-        |d |      }| j                  j                  st/        |d |      }t         j"                  j1                  |t!        |dd       rGdt!        |j                  d
d       t!        |j                  dd       t!        |j                  dd       dini       }t        j2                  |
j4                        |_        | j                  j%                  |       |S Nrf   rh   r   rg   z{model}:generateContentr  ?r   postshould_return_http_response)rq   rF  rH  include_all_fieldsrF  rH  r%  r  kwargsheaders)r   _GenerateContentParameters_api_clientvertexair|  r  
format_mapry  r	   popr   http_optionsr   convert_to_dictencode_unserializable_typesrequestgetattrGenerateContentResponse_verify_responsebodyjsonloadsr  r  _from_responseHttpResponser*  rq   selfrf   rh   r   parameter_modelrequest_dictrequest_url_dictpathquery_paramsr0  r  return_valueresponse_dicts                r!   _generate_contentzModels._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''lLH g-t 22XNl
''5&mmBHMM1JM  :
m $$9
m 00?? ?Hd3 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! @ L$ &+%7%7  &L" 	%%l3r#   c             #   n  K   t        j                  |||      }| j                  j                  r@t	        | j                  |d |      }|j                  d      }|rdj                  |      }nBd}n?t        | j                  |d |      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd        d }	|j                  ,|j                  j                  |j                  j                  }	t        j                  |      }t        j                  |      }|t        |dd       rt!        d      | j                  j#                  d	|||	      D ]/  }
|
j$                  si nt'        j(                  |
j$                        }| j                  j                  rt+        |d |      }| j                  j                  st-        |d |      }t         j.                  j1                  |t        |dd       rGdt        |j                  d
d       t        |j                  dd       t        |j                  dd       dini       }t        j2                  |
j4                        |_        | j                  j9                  |       | 2 y w)Nr!  rg   %{model}:streamGenerateContent?alt=sser  r"  r   r$  FAccessing the raw HTTP response is not supported in streaming methods.r#  rF  rH  r%  r&  r'  r)  )r   r+  r,  r-  r|  r  r.  ry  r	   r/  r   r0  r   r1  r2  r4  r   request_streamedr7  r8  r9  r  r  r5  r:  r;  r*  rq   r6  r=  rf   rh   r   r>  r?  r@  rA  rB  r0  r  rD  rC  s                r!   _generate_content_streamz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lL & !)b4::hmm3Lm				"	"<4
 &&;4
 22AA  _h5 %,%,,.?& +2%,,.Dd+ )0%,,.BD)
 ! B l$ (-'9'9""(l$ ''5M&s   J3J5rh   rD   r   r   rD   r   c                h   t        j                  |||||      }| j                  j                  rct	        | j                  |d|      }|j                  d      }t        j                  |j                        rdnd}	|r|	j                  |      }
nB|	}
n?t        | j                  |d|      }|j                  d      }|rdj                  |      }
nd}
|j                  d      }|r|
 dt        |       }
|j                  d	d       d}|j                  ,|j                  j                  |j                  j                  }t        j                   |      }t        j"                  |      }| j                  j%                  d
|
||      }|j&                  si nt)        j*                  |j&                        }| j                  j                  rt-        |d|      }| j                  j                  st/        |d|      }t         j0                  j3                  |t5        |d	d      rGd	t5        |j                  dd      t5        |j                  dd      t5        |j                  dd      dini       }t        j6                  |j8                        |_        | j                  j=                  |       |S )aA  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
          },
      )
    rf   rh   rD   r   r   Nrg   {model}:embedContent{model}:predict{model}:batchEmbedContentsr  r"  r   r#  rF  rH  r%  r&  r'  r)  )r   _EmbedContentParametersPrivater,  r-  r  r  ri   t_is_vertex_embed_content_modelrf   r.  r  r	   r/  r   r0  r   r1  r2  r3  r7  r8  r9  r  r  EmbedContentResponser:  r4  r;  r*  rq   r6  r=  rf   rh   rD   r   r   r>  r?  r@  endpoint_urlrA  rB  r0  r  rD  rC  s                   r!   _embed_contentzModels._embed_content  s   H ::-O   =


OT?l &))&1/0/P/PQ`QfQf/g+m~l	&&'78<


OT?l &))&1	+667GH+##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''lLH 'mmBHMM1JM  7
m $$6
m --<< ?Hd3 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! = L$ &+%7%7  &L" 	%%l3r#   r   c                   t        j                  |||      }| j                  j                  r@t	        | j                  |d|      }|j                  d      }|rdj                  |      }nBd}n?t        | j                  |d|      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd       d}	|j                  ,|j                  j                  |j                  j                  }	t        j                  |      }t        j                  |      }| j                  j                  d|||	      }
|
j                   si nt#        j$                  |
j                         }| j                  j                  rt'        |d|      }| j                  j                  st)        |d|      }t         j*                  j-                  |t/        |dd      rGdt/        |j                  d	d      t/        |j                  d
d      t/        |j                  dd      dini       }t        j0                  |
j2                        |_        | j                  j7                  |       |S )z%Private method for generating images.rf   r   r   Nrg   rP  r  r"  r   r#  rF  rH  r%  r&  r'  r)  )r   _GenerateImagesParametersr,  r-  r  r  r.  r  r	   r/  r   r0  r   r1  r2  r3  r7  r8  r9  r  r  GenerateImagesResponser:  r4  r;  r*  rq   r6  r=  rf   r   r   r>  r?  r@  rA  rB  r0  r  rD  rC  s                r!   _generate_imageszModels._generate_imagesg  s    55O   8


OT?l &))&1	 ++,<= 7


OT?l &))&1	 ++,<= ##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''lLH 'mmBHMM1JM  9
m $$8
m //>> ?Hd3 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! ? L$ &+%7%7  &L" 	%%l3r#   r   c                p   t        j                  ||||      }| j                  j                  st	        d      t        | j                  |d|      }|j                  d      }|rdj                  |      }nd}|j                  d      }	|	r| dt        |	       }|j                  dd       d}
|j                  ,|j                  j                  |j                  j                  }
t        j                  |      }t        j                  |      }| j                  j                  d	|||
      }|j                   si nt#        j$                  |j                         }| j                  j                  rt'        |d|      }t         j(                  j+                  |t-        |dd      rGdt-        |j                  d
d      t-        |j                  dd      t-        |j                  dd      dini       }t        j.                  |j0                        |_        | j                  j5                  |       |S )z$Private method for editing an image.rf   r   r   r   iThis method is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.Nrg   rP  r  r"  r   r#  rF  rH  r%  r&  r'  r)  )r   _EditImageParametersr,  r-  r   r   r  r.  r	   r/  r   r0  r   r1  r2  r3  r7  r8  r9  r   EditImageResponser:  r4  r;  r*  rq   r6  r=  rf   r   r   r   r>  r?  r@  rA  rB  r0  r  rD  rC  s                 r!   _edit_imagezModels._edit_image  s4    00)	O $$5 
 4


OT?l &))&1	 ++,<= ##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''lLH 'mmBHMM1JM  4
m **99 ?Hd3 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! : L$ &+%7%7  &L" 	%%l3r#   r  r  c                p   t        j                  ||||      }| j                  j                  st	        d      t        | j                  |d|      }|j                  d      }|rdj                  |      }nd}|j                  d      }	|	r| dt        |	       }|j                  dd       d}
|j                  ,|j                  j                  |j                  j                  }
t        j                  |      }t        j                  |      }| j                  j                  d	|||
      }|j                   si nt#        j$                  |j                         }| j                  j                  rt'        |d|      }t         j(                  j+                  |t-        |dd      rGdt-        |j                  d
d      t-        |j                  dd      t-        |j                  dd      dini       }t        j.                  |j0                        |_        | j                  j5                  |       |S )z&Private method for upscaling an image.rf   r  r  r   r`  Nrg   rP  r  r"  r   r#  rF  rH  r%  r&  r'  r)  )r   _UpscaleImageAPIParametersr,  r-  r   r  r  r.  r	   r/  r   r0  r   r1  r2  r3  r7  r8  r9  r
  UpscaleImageResponser:  r4  r;  r*  rq   r6  r=  rf   r  r  r   r>  r?  r@  rA  rB  r0  r  rD  rC  s                 r!   _upscale_imagezModels._upscale_image  s4    66%	O $$5 
 :


OT?l &))&1	 ++,<= ##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''lLH 'mmBHMM1JM  7
m --<< ?Hd3 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! = L$ &+%7%7  &L" 	%%l3r#   r  c                $   t        j                  |||      }| j                  j                  st	        d      t        | j                  |d|      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd       d}	|j                  ,|j                  j                  |j                  j                  }	t        j                  |      }t        j                  |      }| j                  j                  d	|||	      }
|
j                   si nt#        j$                  |
j                         }| j                  j                  rt'        |d|      }t         j(                  j+                  |t-        |dd      rGdt-        |j                  d
d      t-        |j                  dd      t-        |j                  dd      dini       }| j                  j/                  |       |S )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(location=IMAGE1_FILE_PATH),
              product_images=[types.ProductImage(product_image=
                  types.Image.from_file(location=IMAGE2_FILE_PATH)
              )],
          ),
          config=types.RecontextImageConfig(
              number_of_images=1,
          ),
      )
      image = virtual_try_on_response.generated_images[0].image
      ```
    rf   r  r   r`  Nrg   rP  r  r"  r   r#  rF  rH  r%  r&  r'  )r   _RecontextImageParametersr,  r-  r   r  r  r.  r	   r/  r   r0  r   r1  r2  r3  r7  r8  r9  r  RecontextImageResponser:  r4  r6  r=  rf   r  r   r>  r?  r@  rA  rB  r0  r  rD  rC  s                r!   recontext_imagezModels.recontext_imagej  s   N 55O $$5 
 9


OT?l &))&1	 ++,<= ##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''lLH 'mmBHMM1JM  9
m //>> ?Hd3 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! ? L& 	%%l3r#   c                $   t        j                  |||      }| j                  j                  st	        d      t        | j                  |d|      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd       d}	|j                  ,|j                  j                  |j                  j                  }	t        j                  |      }t        j                  |      }| j                  j                  d	|||	      }
|
j                   si nt#        j$                  |
j                         }| j                  j                  rt'        |d|      }t         j(                  j+                  |t-        |dd      rGdt-        |j                  d
d      t-        |j                  dd      t-        |j                  dd      dini       }| j                  j/                  |       |S )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(location=IMAGE_FILE_PATH),
          ),
      )

      mask_image = response.generated_masks[0].mask
      ```
    rl  r`  Nrg   rP  r  r"  r   r#  rF  rH  r%  r&  r'  )r   _SegmentImageParametersr,  r-  r   r  r  r.  r	   r/  r   r0  r   r1  r2  r3  r7  r8  r9  r  SegmentImageResponser:  r4  r6  ro  s                r!   segment_imagezModels.segment_image  s   @ 33O $$5 
 7


OT?l &))&1	 ++,<= ##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''lLH 'mmBHMM1JM  7
m --<< ?Hd3 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! = L& 	%%l3r#   c                   t        j                  ||      }| j                  j                  r@t	        | j                  |d |      }|j                  d      }|rdj                  |      }nBd}n?t        | j                  |d |      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd        d }|j                  ,|j                  j                  |j                  j                  }t        j                  |      }t        j                  |      }| j                  j                  d|||      }	|	j                   si nt#        j$                  |	j                         }
| j                  j                  rt'        |
d |      }
| j                  j                  st)        |
d |      }
t         j*                  j-                  |
t/        |dd       rGdt/        |j                  dd       t/        |j                  d	d       t/        |j                  d
d       dini       }| j                  j1                  |       |S Nrf   r   rg   {name}r  r"  r   r  rF  rH  r%  r&  r'  )r   _GetModelParametersr,  r-  r  r  r.  r  r	   r/  r   r0  r   r1  r2  r3  r7  r8  r9  r;  r7  Modelr:  r4  r6  r=  rf   r   r>  r?  r@  rA  rB  r0  r  rD  rC  s               r!   r  z
Models.get?  sR    //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 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! . L& 	%%l3r#   c                   t        j                  |      }| j                  j                  r@t	        | j                  |d |      }|j                  d      }|rdj                  |      }nBd}n?t        | j                  |d |      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r=|j                  d      r,|j                  d      }| d| }|r$|dt        |       z  }n|r| dt        |       }|j                  d	d        d }|j                  ,|j                  j                  |j                  j                  }t        j                  |      }t        j                  |      }| j                  j                  d
|||      }	|	j                   si nt#        j$                  |	j                         }
| j                  j                  rt'        |
d |      }
| j                  j                  st)        |
d |      }
t         j*                  j-                  |
t/        |d	d       rGd	t/        |j                  dd       t/        |j                  dd       t/        |j                  dd       dini       }t        j0                  |	j2                        |_        | j                  j7                  |       |S Nr  rg   z{models_url}r  r#  z?filter=&r"  r   r  rF  rH  r%  r&  r'  r)  )r   _ListModelsParametersr,  r-  r0  r  r.  r.  r/  r	   r   r0  r   r1  r2  r3  r7  r8  r9  r<  r8  ListModelsResponser:  r4  r;  r*  rq   r6  r=  r   r>  r?  r@  rA  rB  query_param_filterr0  r  rD  rC  s               r!   _listzModels._list  s    11O   4


OT?l &))&1	(()9:3


OT?l &))&1	(()9:##H-L((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 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! ; L$ &+%7%7  &L" 	%%l3r#   c                   t        j                  ||      }| j                  j                  r@t	        | j                  |d |      }|j                  d      }|rdj                  |      }nBd}n?t        | j                  |d |      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd        d }|j                  ,|j                  j                  |j                  j                  }t        j                  |      }t        j                  |      }| j                  j                  d|||      }	|	j                   si nt#        j$                  |	j                         }
| j                  j                  rt'        |
d |      }
| j                  j                  st)        |
d |      }
t         j*                  j-                  |
t/        |dd       rGdt/        |j                  d	d       t/        |j                  d
d       t/        |j                  dd       dini       }| j                  j1                  |       |S Nrw  rg   z{model}rx  r  r"  r   patchrF  rH  r%  r&  r'  )r   _UpdateModelParametersr,  r-  r  r  r.  r  r	   r/  r   r0  r   r1  r2  r3  r7  r8  r9  r;  r7  rz  r:  r4  r6  r{  s               r!   updatezModels.update  sW    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 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! . L& 	%%l3r#   c                   t        j                  ||      }| j                  j                  r@t	        | j                  |d |      }|j                  d      }|rdj                  |      }nBd}n?t        | j                  |d |      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd        d }|j                  ,|j                  j                  |j                  j                  }t        j                  |      }t        j                  |      }| j                  j                  d|||      }	|	j                   si nt#        j$                  |	j                         }
| j                  j                  rt'        |
d |      }
| j                  j                  st)        |
d |      }
t         j*                  j-                  |
t/        |dd       rGdt/        |j                  dd       t/        |j                  d	d       t/        |j                  d
d       dini       }t        j0                  |	j2                        |_        | j                  j7                  |       |S Nrw  rg   rx  r  r"  r   deleterF  rH  r%  r&  r'  r)  )r   _DeleteModelParametersr,  r-  r   r  r.  r   r	   r/  r   r0  r   r1  r2  r3  r7  r8  r9  r   r   DeleteModelResponser:  r4  r;  r*  rq   r6  r{  s               r!   r  zModels.delete2  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 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! < L$ &+%7%7  &L" 	%%l3r#   c                   t        j                  |||      }| j                  j                  r@t	        | j                  |d|      }|j                  d      }|rdj                  |      }nBd}n?t        | j                  |d|      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd       d}	|j                  ,|j                  j                  |j                  j                  }	t        j                  |      }t        j                  |      }| j                  j                  d|||	      }
|
j                   si nt#        j$                  |
j                         }| j                  j                  rt'        |d|      }| j                  j                  st)        |d|      }t         j*                  j-                  |t/        |dd      rGdt/        |j                  d	d      t/        |j                  d
d      t/        |j                  dd      dini       }t        j0                  |
j2                        |_        | j                  j7                  |       |S )a8  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!  Nrg   {model}:countTokensr  r"  r   r#  rF  rH  r%  r&  r'  r)  )r   _CountTokensParametersr,  r-  r   r  r.  r   r	   r/  r   r0  r   r1  r2  r3  r7  r8  r9  r   r   CountTokensResponser:  r4  r;  r*  rq   r6  rJ  s                r!   count_tokensz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''lLH 'mmBHMM1JM  6
m $$5
m ,,;; ?Hd3 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! < L$ &+%7%7  &L" 	%%l3r#   c                n   t        j                  |||      }| j                  j                  st	        d      t        | j                  |d|      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd       d}	|j                  ,|j                  j                  |j                  j                  }	t        j                  |      }t        j                  |      }| j                  j                  d	|||	      }
|
j                   si nt#        j$                  |
j                         }| j                  j                  rt'        |d|      }t         j(                  j+                  |t-        |dd      rGdt-        |j                  d
d      t-        |j                  dd      t-        |j                  dd      dini       }t        j.                  |
j0                        |_        | j                  j5                  |       |S )az  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!  r`  Nrg   {model}:computeTokensr  r"  r   r#  rF  rH  r%  r&  r'  r)  )r   _ComputeTokensParametersr,  r-  r   rn   r  r.  r	   r/  r   r0  r   r1  r2  r3  r7  r8  r9  rt   ComputeTokensResponser:  r4  r;  r*  rq   r6  rJ  s                r!   compute_tokenszModels.compute_tokens  s1   < 44O $$5 
 8


OT?l &))&1	&112BC&##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''lLH 'mmBHMM1JM  8
m ..== ?Hd3 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! > L$ &+%7%7  &L" 	%%l3r#   r   r  r  r  r   r  c                   t        j                  ||||||      }| j                  j                  r@t	        | j                  |d|      }|j                  d      }	|	rdj                  |	      }
nBd}
n?t        | j                  |d|      }|j                  d      }	|	rdj                  |	      }
nd}
|j                  d      }|r|
 dt        |       }
|j                  dd       d}|j                  ,|j                  j                  |j                  j                  }t        j                  |      }t        j                  |      }| j                  j                  d|
||      }|j                   si nt#        j$                  |j                         }| j                  j                  rt'        |d|      }| j                  j                  st)        |d|      }t         j*                  j-                  |t/        |dd      rGdt/        |j                  d	d      t/        |j                  d
d      t/        |j                  dd      dini       }| j                  j1                  |       |S )z%Private method for generating videos.rf   r   r  r  r  r   Nrg   {model}:predictLongRunningr  r"  r   r#  rF  rH  r%  r&  r'  )r   _GenerateVideosParametersr,  r-  r  r  r.  r  r	   r/  r   r0  r   r1  r2  r3  r7  r8  r9  r  r  GenerateVideosOperationr:  r4  r6  r=  rf   r   r  r  r  r   r>  r?  r@  rA  rB  r0  r  rD  rC  s                   r!   _generate_videoszModels._generate_videos^  sp    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''lLH 'mmBHMM1JM  :
m $$9
m 00?? ?Hd3 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! @ L& 	%%l3r#   c                   | j                   j                  s-d|v rt        j                  |      }| j	                  |||      S t        j
                  |      r_t        j                  |      }t        |      dkD  rt        d      | j	                  |d|d   t        j                  j                  |      S | j	                  |d|t        j                  j                  |      S )	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   rN  )rf   rD   rh   r   r   r,  r-  ri   rk   rW  rS  lenr   r   EmbeddingApiTyper  r   r=  rf   rh   r   normalized_contentss        r!   embed_contentzModels.embed_content  s    T $$		&<<)  ux OO((/LL2	 	!A	%
 	
   %a("33AA !     "33;; !  r#   c                   t        j                  |      }t        j                  |      }|r@|j                  r4t	        j
                  |j                        rt        j                  d      t        j                  |      r| j                  |||      S |rd}t        |t        j                        r"|j                  rEt        |j                        }n/t        |t              r|j                  dg       }|rt        |      }t        |      |k7  r5dj!                  t#        t$        |            }t&        j)                  d|       | j                  |||      S t        j*                  |      }	t&        j-                  d|	 d       g }
t        j.                         }d}|	dkD  r|r|j1                  d	
      nd}t        j2                  |      }|rt        j4                  |      }|dz  }| j                  |||      }|snR|snN|j6                  r<|j6                  d   j8                  r#|j6                  d   j8                  j:                  snt        j<                  ||      }|snt&        j-                  d| d       |	dz  }	|	dk(  rt&        j-                  d       |j6                  d   j8                  }t        j>                  d|      }tA        jB                  |      }|
s|
jE                  |       t        |tF              r"|jI                  |       |jI                  |       |
jI                  |       |
jI                  |       |	dkD  rt        jJ                  |      r	||
|_&        |S )a	  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: .TdeepNr
   AFC remote call 	 is done.8Reached max remote calls for automatic function calling.userr   r   )'r   "find_afc_incompatible_tool_indexesparse_config_for_mcp_usager   r   has_mcp_session_usager   UnsupportedFunctionErrorshould_disable_afcrE  
isinstancer   GenerateContentConfigr  dictr  joinmapstrloggerwarningget_max_remote_calls_afcinfor5  
model_copyget_function_mapget_usage_headerr~  rD   r   get_function_response_partsContentri   rk   extendlistappendshould_append_afc_history"automatic_function_calling_history)r=  rf   rh   r   incompatible_tools_indexesparsed_configoriginal_tools_lengthr   indices_strremaining_remote_calls_afcr  r  iparsed_config_to_callfunction_mapfunc_response_partsfunc_call_contentfunc_response_contents                     r!   generate_contentzModels.generate_content  sf   F 	77?  !;;FCM,,]-@-@A++
B  &&}5## $   "	FE77	8<<"%fll"3
fd#

7B'"%e*
	'	(,A	AiiC)C DED 	
 ## $   ".!F!F" KK
01K0LAN ?A&,,.H	A
$q
(1>-
"
"
"
-D  "22=Al	 , = =!!
 1fa''1F ( h !!$$Q'//$$Q'//55(DD
L !kk$QCy12 A% 	#q	(NO"--a088#mm# h'h/*11(;	Hd	#)*-.(//0AB(//0EF] %q
(` 	..}=  - 1 Or#   c             #     K   t        j                  |      }t        j                  |      }|r@|j                  r4t	        j
                  |j                        rt        j                  d      t        j                  |      r| j                  |||      E d{    y|rd}t        |t        j                        r"|j                  rEt        |j                        }n/t        |t              r|j                  dg       }|rt        |      }t        |      |k7  r5dj!                  t#        t$        |            }t&        j)                  d|       | j                  |||      E d{    yt        j*                  |       t        j,                  |      }	t&        j/                  d|	 d	       g }
d}d}d}|	dkD  r|r|j1                  d
      nd}t        j2                  |      }|rt        j4                  |      }|dz  }| j                  |||      }|dk(  r|D ]  }|st        j6                  ||      }|  |j8                  r<|j8                  d   j:                  r#|j8                  d   j:                  j<                  s nt        j>                  ||      }|rt        j6                  ||      }|  n|D ]8  }t        j@                  |      r|
|_!        t        j6                  ||      }| : |H|j8                  r<|j8                  d   j:                  r#|j8                  d   j:                  j<                  syt        j>                  ||      }|sy|syt&        j/                  d| d       |	dz  }	|	dk(  rt&        j/                  d       ||j8                  |j8                  d   j:                  }t        jD                  d|      }tG        jH                  |      }|
s|
jK                  |       t        |tL              r$|"|jO                  |       |jO                  |       ||
jO                  |       |
jO                  |       |	dkD  ryy7 7 w)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'
      )

      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  Tr  r
   r  r  r  r  r  )(r   r  r  r   r   r  r   r  r  rK  r  r   r  r  r  r  r  r  r  r  r  'raise_error_for_afc_incompatible_configr  r  r  r  r  append_chunk_contentsr~  rD   r   r  r  r  r  ri   rk   r  r  r  )r=  rf   rh   r   r  r  r  r   r  r  r  chunkr  r  r  r  r  r  r  s                      r!   generate_content_streamzModels.generate_content_stream  sh    F 	77?  !;;FCM,,]-@-@A++
B  &&}5.. /    !	FE77	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
(1>-
"
"
"
-D  "22=Al	 , = =!!
 1fa..1F / h 
a  	E#99(EJHK $$''*22''*2288"."J"J|# '%;;HeLhk!	(  	E33M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Ha %q
(Q*s3   BQ,Q&CQ,*Q)+D:Q,&F<Q,$Q,)Q,c                ,   | j                  |||      }d}g }|r|j                  s|S |j                  D ]E  }|j                  r&|j                  j                  dk(  r|j                  }5|j	                  |       G t        j                  ||      }|S )ap  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.
    rY  NPositive Promptr   r  r]  r   r  r  r  r   r[  	r=  rf   r   r   api_responser  r   generated_imager  s	            r!   generate_imageszModels.generate_imagesu  s    : (( ) L
 )-%|<<'88 1

+
+//<< -<,M,M)01 ++)*KH Or#   c                ,    | j                  ||||      S )aU  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(location=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.
    r_  rd  r=  rf   r   r   r   s        r!   
edit_imagezModels.edit_image  s)    b )	   r#   c                h   t        j                  ||||       |xs i }t        |t         j                        r|j	                         }nt        |      }t        j                  |j                  dd      |j                  dd      |j                  dd      |j                  dd      |j                  dd      |j                  dd      |j                  d	d      |j                  d
d      |j                  dd      |j                  dd      
      }d|d<   d|d<   | j                  ||||      S )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(location=IMAGE_FILE_PATH),
          upscale_factor='x2',
      )
      response.generated_images[0].image.show()
      # Opens my-image.png which is upscaled by a factor of 2.
    rf  r0  Nr   r   r   r   r   r   r  r  r   
r0  r   r   r   r   r   r   r  r  r   upscaler.  r
   r   	r   UpscaleImageParametersr  UpscaleImageConfig
model_dumpr  _UpscaleImageAPIConfigDictr  rj  r=  rf   r  r  r   
config_dct
api_configs          r!   upscale_imagezModels.upscale_image  s8   B 
  %	 \rF&%223$$&j<j11^^ND9!~~&6=&NN+@$G$..)<dC%>>*>E#(:DA#->>($$
 'NN+@$G",..'#
 ~~h-J$ #Jv%&J!"%	   r#   c          
      D   |s|s|r|rt        d      i }| j                  j                  s|rt        |t        j
                        r|j                         }nt        |      }|j                  d      r|j                  d      rt	        j
                  |j                  d      |j                  d            }nL| j                  j                  s5|r2t        |t        j                        r#|j                         }|j                  di       }nht        |      }t        |j                  d      t        j
                        r4|j                  dt	        j
                               }	|	j                         }|r|j                  d      rz|j                  d      rit	        j                  |j                  d      |j                  d      t	        j
                  |j                  d      |j                  d            	      }| j                  ||||||
      S )  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=  rf   r   r  r  r  r   	video_dct
source_dct	video_objs
             r!   generate_videoszModels.generate_videos.  s   b 	%5f' 
 !#I$$	E5;;	'$$&	K		u	)--">e$	k0J
 &&6	FE66	7&&(
NN7B/	&\
jnnW-u{{;#->>'5;;=#I)**,)	y}}U+	m0L++>>(+..)++MM%(#--4
    !  r#   c                   t        j                  |      j                  xs t        j                         }|j                  d|_        | j
                  j                  r8|j                  d      }|j                  s|j                  }|r|dz   nd|_        t        d| j                  | j                  |      |      S )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  Tr  &filter=labels.tune-type:*labels.tune-type:*r5  )r   r  r   ListModelsConfigr$  r,  r-  r  r#  r   r  r=  r   filter_values      r!   r  zModels.list  s    8 	##6299 	$!!#   f    d +f}}  77% 	
 



&
!	 r#   )G__name__
__module____qualname__r  r   r   ContentListUnionContentListUnionDictr   GenerateContentConfigOrDictr5  rE  r   rK  ContentUnionContentUnionDictr  EmbedContentConfigOrDictrT  rW  GenerateImagesConfigOrDictr[  r]  r  _ReferenceImageAPIOrDictEditImageConfigOrDictrb  rd  ImageOrDict_UpscaleImageAPIConfigOrDictrh  rj  RecontextImageSourceOrDictRecontextImageConfigOrDictrn  rp  SegmentImageSourceOrDictSegmentImageConfigOrDictrs  rt  GetModelConfigOrDictrz  r  ListModelsConfigOrDictr  r  UpdateModelConfigOrDictr  DeleteModelConfigOrDictr  r  CountTokensConfigOrDictr  r  ComputeTokensConfigOrDictr  r  VideoOrDictGenerateVideosSourceOrDictGenerateVideosConfigOrDictr  r  r  r  r  r  r  UpscaleImageConfigOrDictr  r  r    r#   r!   r  r  '  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 <@l l ..	l
 u778l ##lf :>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g g **	g
 u889g $$g\ =AGI GI **	GI
 u889GI --.GI\ <@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r#   r  c                   6
   e Zd Zdddedeej                  ej                  f   deej                     dej                  fdZdddedeej                  ej                  f   deej                     deeej                        fdZddddd	dedeeej                  ej                  f      d
eeej                  ej                   f      deej"                     deej$                     dej&                  fdZdddededeej*                     dej,                  fdZdddededeej2                     deej4                     dej6                  f
dZdddedej:                  dedeej<                     dej>                  f
dZ dddedejB                  deejD                     dejF                  fdZ$dddedejJ                  deejL                     dejN                  fdZ(dddedeejR                     dejT                  fdZ+dddeejX                     dejZ                  fdZ.dddedeej^                     dejT                  fdZ0dddedeejb                     dejd                  fdZ3dddedeej                  ej                  f   deejh                     dejj                  fdZ6dddedeej                  ej                  f   deejn                     dejp                  fdZ9dddddddedee   deej:                     deejt                     deejv                     deejx                     dejz                  fdZ>dddedeej                  ej                  f   deej                     dej                  fd Z?dddedeej                  ej                  f   deej                     deej                     fd!Z@dddededeej2                     deej4                     dej6                  f
d"ZAdddeejX                     deBejT                     fd#Zdddededeej*                     dej,                  fd$ZCdddedej:                  dedeej                     dej>                  f
d%ZEdddddddedee   deej:                     deejt                     deejv                     deejx                     dejz                  fd&ZFdddedeej                  ej                  f   deej$                     dej&                  fd'ZGy)(AsyncModelsNr  rf   rh   r   r   c                  K   t        j                  |||      }| j                  j                  r@t	        | j                  |d |      }|j                  d      }|rdj                  |      }nBd}n?t        | j                  |d |      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd        d }	|j                  ,|j                  j                  |j                  j                  }	t        j                  |      }t        j                  |      }| j                  j                  d|||	       d {   }
|@t!        |dd       r3t        j"                  |
	      }| j                  j%                  |       |S |
j&                  si nt)        j*                  |
j&                        }| j                  j                  rt-        |d |      }| j                  j                  st/        |d |      }t         j"                  j1                  |t!        |dd       rGdt!        |j                  d
d       t!        |j                  dd       t!        |j                  dd       dini       }t        j2                  |
j4                        |_        | j                  j%                  |       |S 7 qwr   )r   r+  r,  r-  r|  r  r.  ry  r	   r/  r   r0  r   r1  r2  async_requestr4  r5  r6  r7  r8  r9  r  r  r:  r;  r*  rq   r<  s                r!   rE  z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lL H g-t 22XNl
''5&mmBHMM1JM  :
m $$9
m 00?? ?Hd3 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! @ L$ &+%7%7  &L" 	%%l3[s   E(K*K+E1Kc                <   
K   t        j                  |||      
 j                  j                  r@t	         j                  
d 
      }|j                  d      }|rdj                  |      }nBd}n?t         j                  
d 
      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd        d }
j                  ,
j                  j                  
j                  j                  }t        j                  |      }t        j                  |      }|t        |dd       rt!        d       j                  j#                  d	|||       d {   
 fd
}	 |	       S 7 w)Nr!  rg   rG  r  r"  r   r$  rH  r#  c                   K   2 3 d {   } | j                   si nt        j                  | j                         }j                  j                  rt        |d       }j                  j                  st        |d       }t        j                  j                  |t        dd       rGdt        j                  dd       t        j                  dd       t        j                  dd       dini       }t        j                  | j                        |_        j                  j                  |       | 87 46 y w)Nr   rF  rH  r%  r&  r'  r)  )r7  r8  r9  r,  r-  r  r  r   r5  r:  r4  r   r;  r*  rq   r6  )r  rD  rC  r>  response_streamr=  s      r!   async_generatorz=AsyncModels._generate_content_stream.<locals>.async_generatora  s>    + $ $"*--TZZ5N$$>T?- ((=T?- 44CC" $7 '.'..0A4( -4'..0F- +2'..0Dd+
 ! D 
$ */););$$*
& 	)),7I$Os&   EED>ED0E>EE)r   r+  r,  r-  r|  r  r.  ry  r	   r/  r   r0  r   r1  r2  r4  r   async_request_streamed)r=  rf   rh   r   r?  r@  rA  rB  r0  r/  r>  r.  s   `         @@r!   rK  z$AsyncModels._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  
 !,,CClL O%N Ws   FFFFrL  rD   r   c                  K   t        j                  |||||      }| j                  j                  rct	        | j                  |d|      }|j                  d      }t        j                  |j                        rdnd}	|r|	j                  |      }
nB|	}
n?t        | j                  |d|      }|j                  d      }|rdj                  |      }
nd}
|j                  d      }|r|
 dt        |       }
|j                  d	d       d}|j                  ,|j                  j                  |j                  j                  }t        j                   |      }t        j"                  |      }| j                  j%                  d
|
||       d{   }|j&                  si nt)        j*                  |j&                        }| j                  j                  rt-        |d|      }| j                  j                  st/        |d|      }t         j0                  j3                  |t5        |d	d      rGd	t5        |j                  dd      t5        |j                  dd      t5        |j                  dd      dini       }t        j6                  |j8                        |_        | j                  j=                  |       |S 7 /w)aK  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
          },
      )
    rN  Nrg   rO  rP  rQ  r  r"  r   r#  rF  rH  r%  r&  r'  r)  )r   rR  r,  r-  r  r  ri   rS  rf   r.  r  r	   r/  r   r0  r   r1  r2  r+  r7  r8  r9  r  r  rT  r:  r4  r;  r*  rq   r6  rU  s                   r!   rW  zAsyncModels._embed_content  s    H ::-O   =


OT?l &))&1/0/P/PQ`QfQf/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lL H 'mmBHMM1JM  7
m $$6
m --<< ?Hd3 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! = L$ &+%7%7  &L" 	%%l3Ms   FKJ>D/Kr   c                <  K   t        j                  |||      }| j                  j                  r@t	        | j                  |d|      }|j                  d      }|rdj                  |      }nBd}n?t        | j                  |d|      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd       d}	|j                  ,|j                  j                  |j                  j                  }	t        j                  |      }t        j                  |      }| j                  j                  d|||	       d{   }
|
j                   si nt#        j$                  |
j                         }| j                  j                  rt'        |d|      }| j                  j                  st)        |d|      }t         j*                  j-                  |t/        |dd      rGdt/        |j                  d	d      t/        |j                  d
d      t/        |j                  dd      dini       }t        j0                  |
j2                        |_        | j                  j7                  |       |S 7 /w)z4Private method for generating images asynchronously.rY  Nrg   rP  r  r"  r   r#  rF  rH  r%  r&  r'  r)  )r   rZ  r,  r-  r  r  r.  r  r	   r/  r   r0  r   r1  r2  r+  r7  r8  r9  r  r  r[  r:  r4  r;  r*  rq   r6  r\  s                r!   r]  zAsyncModels._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%%33lL H 'mmBHMM1JM  9
m $$8
m //>> ?Hd3 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! ? L$ &+%7%7  &L" 	%%l3M   E(J*J+D/Jr   c                  K   t        j                  ||||      }| j                  j                  st	        d      t        | j                  |d|      }|j                  d      }|rdj                  |      }nd}|j                  d      }	|	r| dt        |	       }|j                  dd       d}
|j                  ,|j                  j                  |j                  j                  }
t        j                  |      }t        j                  |      }| j                  j                  d	|||
       d{   }|j                   si nt#        j$                  |j                         }| j                  j                  rt'        |d|      }t         j(                  j+                  |t-        |dd      rGdt-        |j                  d
d      t-        |j                  dd      t-        |j                  dd      dini       }t        j.                  |j0                        |_        | j                  j5                  |       |S 7 w)z3Private method for editing an image asynchronously.r_  r`  Nrg   rP  r  r"  r   r#  rF  rH  r%  r&  r'  r)  )r   ra  r,  r-  r   r   r  r.  r	   r/  r   r0  r   r1  r2  r+  r7  r8  r9  r   rb  r:  r4  r;  r*  rq   r6  rc  s                 r!   rd  zAsyncModels._edit_image^  sC     00)	O $$5 
 4


OT?l &))&1	 ++,<= ##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33lL H 'mmBHMM1JM  4
m **99 ?Hd3 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! : L$ &+%7%7  &L" 	%%l3C   D4I6I7DIr  r  c                  K   t        j                  ||||      }| j                  j                  st	        d      t        | j                  |d|      }|j                  d      }|rdj                  |      }nd}|j                  d      }	|	r| dt        |	       }|j                  dd       d}
|j                  ,|j                  j                  |j                  j                  }
t        j                  |      }t        j                  |      }| j                  j                  d	|||
       d{   }|j                   si nt#        j$                  |j                         }| j                  j                  rt'        |d|      }t         j(                  j+                  |t-        |dd      rGdt-        |j                  d
d      t-        |j                  dd      t-        |j                  dd      dini       }t        j.                  |j0                        |_        | j                  j5                  |       |S 7 w)z5Private method for upscaling an image asynchronously.rf  r`  Nrg   rP  r  r"  r   r#  rF  rH  r%  r&  r'  r)  )r   rg  r,  r-  r   r  r  r.  r	   r/  r   r0  r   r1  r2  r+  r7  r8  r9  r
  rh  r:  r4  r;  r*  rq   r6  ri  s                 r!   rj  zAsyncModels._upscale_image  sC     66%	O $$5 
 :


OT?l &))&1	 ++,<= ##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33lL H 'mmBHMM1JM  7
m --<< ?Hd3 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! = L$ &+%7%7  &L" 	%%l3Cr5  r  c                @  K   t        j                  |||      }| j                  j                  st	        d      t        | j                  |d|      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd       d}	|j                  ,|j                  j                  |j                  j                  }	t        j                  |      }t        j                  |      }| j                  j                  d	|||	       d{   }
|
j                   si nt#        j$                  |
j                         }| j                  j                  rt'        |d|      }t         j(                  j+                  |t-        |dd      rGdt-        |j                  d
d      t-        |j                  dd      t-        |j                  dd      dini       }| j                  j/                  |       |S 7 w)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(location=IMAGE1_FILE_PATH),
              product_images=[types.ProductImage(product_image=
                  types.Image.from_file(location=IMAGE2_FILE_PATH)
              )],
          ),
          config=types.RecontextImageConfig(
              number_of_images=1,
          ),
      )
      image = virtual_try_on_response.generated_images[0].image
      ```
    rl  r`  Nrg   rP  r  r"  r   r#  rF  rH  r%  r&  r'  )r   rm  r,  r-  r   r  r  r.  r	   r/  r   r0  r   r1  r2  r+  r7  r8  r9  r  rn  r:  r4  r6  ro  s                r!   rp  zAsyncModels.recontext_image  s"    N 55O $$5 
 9


OT?l &))&1	 ++,<= ##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33lL H 'mmBHMM1JM  9
m //>> ?Hd3 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! ? L& 	%%l3?   D3H5H6C'Hc                @  K   t        j                  |||      }| j                  j                  st	        d      t        | j                  |d|      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd       d}	|j                  ,|j                  j                  |j                  j                  }	t        j                  |      }t        j                  |      }| j                  j                  d	|||	       d{   }
|
j                   si nt#        j$                  |
j                         }| j                  j                  rt'        |d|      }t         j(                  j+                  |t-        |dd      rGdt-        |j                  d
d      t-        |j                  dd      t-        |j                  dd      dini       }| j                  j/                  |       |S 7 w)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 = await client.aio.models.segment_image(
          model="image-segmentation-001",
          source=types.SegmentImageSource(
              image=types.Image.from_file(location=IMAGE_FILE_PATH),
          ),
          config=types.SegmentImageConfig(
              mode=types.SegmentMode.foreground,
          ),
      )

      mask_image = response.generated_masks[0].mask
      ```
    rl  r`  Nrg   rP  r  r"  r   r#  rF  rH  r%  r&  r'  )r   rr  r,  r-  r   r  r  r.  r	   r/  r   r0  r   r1  r2  r+  r7  r8  r9  r  rs  r:  r4  r6  ro  s                r!   rt  zAsyncModels.segment_imaget  s"    F 33O $$5 
 7


OT?l &))&1	 ++,<= ##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33lL H 'mmBHMM1JM  7
m --<< ?Hd3 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! = L& 	%%l3?r8  c                  K   t        j                  ||      }| j                  j                  r@t	        | j                  |d |      }|j                  d      }|rdj                  |      }nBd}n?t        | j                  |d |      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd        d }|j                  ,|j                  j                  |j                  j                  }t        j                  |      }t        j                  |      }| j                  j                  d|||       d {   }	|	j                   si nt#        j$                  |	j                         }
| j                  j                  rt'        |
d |      }
| j                  j                  st)        |
d |      }
t         j*                  j-                  |
t/        |dd       rGdt/        |j                  dd       t/        |j                  d	d       t/        |j                  d
d       dini       }| j                  j1                  |       |S 7 
wrv  )r   ry  r,  r-  r  r  r.  r  r	   r/  r   r0  r   r1  r2  r+  r7  r8  r9  r;  r7  rz  r:  r4  r6  r{  s               r!   r  z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 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! . L& 	%%l3A   E'I6)I3*D
I6c                  K   t        j                  |      }| j                  j                  r@t	        | j                  |d |      }|j                  d      }|rdj                  |      }nBd}n?t        | j                  |d |      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r=|j                  d      r,|j                  d      }| d| }|r$|dt        |       z  }n|r| dt        |       }|j                  d	d        d }|j                  ,|j                  j                  |j                  j                  }t        j                  |      }t        j                  |      }| j                  j                  d
|||       d {   }	|	j                   si nt#        j$                  |	j                         }
| j                  j                  rt'        |
d |      }
| j                  j                  st)        |
d |      }
t         j*                  j-                  |
t/        |d	d       rGd	t/        |j                  dd       t/        |j                  dd       t/        |j                  dd       dini       }t        j0                  |	j2                        |_        | j                  j7                  |       |S 7 /wr}  )r   r  r,  r-  r0  r  r.  r.  r/  r	   r   r0  r   r1  r2  r+  r7  r8  r9  r<  r8  r  r:  r4  r;  r*  rq   r6  r  s               r!   r  zAsyncModels._list,  s     11O   4


OT?l &))&1	(()9:3


OT?l &))&1	(()9:##H-L((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 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! ; L$ &+%7%7  &L" 	%%l3Ms   F%K'K(D/Kc                  K   t        j                  ||      }| j                  j                  r@t	        | j                  |d |      }|j                  d      }|rdj                  |      }nBd}n?t        | j                  |d |      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd        d }|j                  ,|j                  j                  |j                  j                  }t        j                  |      }t        j                  |      }| j                  j                  d|||       d {   }	|	j                   si nt#        j$                  |	j                         }
| j                  j                  rt'        |
d |      }
| j                  j                  st)        |
d |      }
t         j*                  j-                  |
t/        |dd       rGdt/        |j                  d	d       t/        |j                  d
d       t/        |j                  dd       dini       }| j                  j1                  |       |S 7 
wr  )r   r  r,  r-  r  r  r.  r  r	   r/  r   r0  r   r1  r2  r+  r7  r8  r9  r;  r7  rz  r:  r4  r6  r{  s               r!   r  z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 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! . L& 	%%l3Ar;  c                :  K   t        j                  ||      }| j                  j                  r@t	        | j                  |d |      }|j                  d      }|rdj                  |      }nBd}n?t        | j                  |d |      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd        d }|j                  ,|j                  j                  |j                  j                  }t        j                  |      }t        j                  |      }| j                  j                  d|||       d {   }	|	j                   si nt#        j$                  |	j                         }
| j                  j                  rt'        |
d |      }
| j                  j                  st)        |
d |      }
t         j*                  j-                  |
t/        |dd       rGdt/        |j                  dd       t/        |j                  d	d       t/        |j                  d
d       dini       }t        j0                  |	j2                        |_        | j                  j7                  |       |S 7 /wr  )r   r  r,  r-  r   r  r.  r   r	   r/  r   r0  r   r1  r2  r+  r7  r8  r9  r   r   r  r:  r4  r;  r*  rq   r6  r{  s               r!   r  z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 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! < L$ &+%7%7  &L" 	%%l3Ms   E'J)J*D/Jc                <  K   t        j                  |||      }| j                  j                  r@t	        | j                  |d|      }|j                  d      }|rdj                  |      }nBd}n?t        | j                  |d|      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd       d}	|j                  ,|j                  j                  |j                  j                  }	t        j                  |      }t        j                  |      }| j                  j                  d|||	       d{   }
|
j                   si nt#        j$                  |
j                         }| j                  j                  rt'        |d|      }| j                  j                  st)        |d|      }t         j*                  j-                  |t/        |dd      rGdt/        |j                  d	d      t/        |j                  d
d      t/        |j                  dd      dini       }t        j0                  |
j2                        |_        | j                  j7                  |       |S 7 /w)aB  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!  Nrg   r  r  r"  r   r#  rF  rH  r%  r&  r'  r)  )r   r  r,  r-  r   r  r.  r   r	   r/  r   r0  r   r1  r2  r+  r7  r8  r9  r   r   r  r:  r4  r;  r*  rq   r6  rJ  s                r!   r  z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lL H 'mmBHMM1JM  6
m $$5
m ,,;; ?Hd3 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! < L$ &+%7%7  &L" 	%%l3Mr3  c                  K   t        j                  |||      }| j                  j                  st	        d      t        | j                  |d|      }|j                  d      }|rdj                  |      }nd}|j                  d      }|r| dt        |       }|j                  dd       d}	|j                  ,|j                  j                  |j                  j                  }	t        j                  |      }t        j                  |      }| j                  j                  d	|||	       d{   }
|
j                   si nt#        j$                  |
j                         }| j                  j                  rt'        |d|      }t         j(                  j+                  |t-        |dd      rGdt-        |j                  d
d      t-        |j                  dd      t-        |j                  dd      dini       }t        j.                  |
j0                        |_        | j                  j5                  |       |S 7 w)aF  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!  r`  Nrg   r  r  r"  r   r#  rF  rH  r%  r&  r'  r)  )r   r  r,  r-  r   rn   r  r.  r	   r/  r   r0  r   r1  r2  r+  r7  r8  r9  rt   r  r:  r4  r;  r*  rq   r6  rJ  s                r!   r  zAsyncModels.compute_tokens   s@    : 44O $$5 
 8


OT?l &))&1	&112BC&##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33lL H 'mmBHMM1JM  8
m ..== ?Hd3 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! > L$ &+%7%7  &L" 	%%l3Cs   D3I5I6DIr  r  c                  K   t        j                  ||||||      }| j                  j                  r@t	        | j                  |d|      }|j                  d      }	|	rdj                  |	      }
nBd}
n?t        | j                  |d|      }|j                  d      }	|	rdj                  |	      }
nd}
|j                  d      }|r|
 dt        |       }
|j                  dd       d}|j                  ,|j                  j                  |j                  j                  }t        j                  |      }t        j                  |      }| j                  j                  d|
||       d{   }|j                   si nt#        j$                  |j                         }| j                  j                  rt'        |d|      }| j                  j                  st)        |d|      }t         j*                  j-                  |t/        |dd      rGdt/        |j                  d	d      t/        |j                  d
d      t/        |j                  dd      dini       }| j                  j1                  |       |S 7 
w)z4Private method for generating videos asynchronously.r  Nrg   r  r  r"  r   r#  rF  rH  r%  r&  r'  )r   r  r,  r-  r  r  r.  r  r	   r/  r   r0  r   r1  r2  r+  r7  r8  r9  r  r  r  r:  r4  r6  r  s                   r!   r  zAsyncModels._generate_videos !  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lL H 'mmBHMM1JM  :
m $$9
m 00?? ?Hd3 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! @ L& 	%%l3Is   E+I:-I7.D
I:c          	      x  K   t        j                  |t        | j                  dd            }|sd}n8t	        |t
              rt        j                  di |}n|j                  d      }t        j                         4 d{   }| j                  j                  rpt        j                  |      rZ|Wg }|j                  rH|j                  D ]1  }t	        |t        j                        r|j                  r|j                   s0|j"                  s$|j$                  s|j&                  s|j(                  r%|j                  ddi      }	|j+                  |	       |j                  D ]  }
t        |
d	d      	 t-        d
      |
j.                  S|j1                  t3        j4                  | j                  |
j.                               d{   }|j+                  |       {t-        d       !|j+                  |       4 ||_        t        j6                  |t        | j                  dd             d{   \  }}t        j8                  |      r-| j;                  |||       d{   cddd      d{    S |rd}t	        |t        j                        r"|j                  rEt=        |j                        }n/t	        |t
              r|j?                  dg       }|rt=        |      }t=        |      |k7  r5djA                  tC        tD        |            }tF        jI                  d|       | j;                  |||       d{   cddd      d{    S t        jJ                  |      }tF        jM                  d| d       g }t        jN                         }|dkD  rt        jP                  ||d      }|r|j                  d      nd}|rt        jR                  |      }| j;                  |||       d{   }|dz  }|dk(  rtF        jM                  d       |sn!|sn|jT                  r<|jT                  d   jV                  r#|jT                  d   jV                  jX                  snt        jZ                  ||       d{   }|sn|jT                  d   jV                  }t        j\                  d|      }t_        j`                  |      }|s|jc                  |       t	        |td              r"|j+                  |       |j+                  |       |j+                  |       |j+                  |       |dkD  rt        jf                  |      r	|||_4        |cddd      d{    S 7 7 7 O7 7 7 E7 87 7 7  # 1 d{  7  sw Y   yxY ww)ad  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.
    r-  Fis_agent_platformNTr  r  r  rF  The 'streamable_http_transport' parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.2Agent Platform MCP servers require a 'name' field.r!  r   r   r  r  r  r  is_caller_method_asyncr
   r  r  r  r'  )5r   r  r4  r,  r  r  r   r  r  
contextlibAsyncExitStackr-  has_agent_platform_mcp_serversr   Toolr  r  r  r  r  r  r  r   r   enter_async_contextr   _connect_agent_platform_mcpparse_config_for_mcp_sessionsr  rE  r  r  r  r  r  r  r  r  r  r5  r  r  r~  rD   r   !get_function_response_parts_asyncr  ri   rk   r  r  r  r  )r=  rf   rh   r   r  r  stack	new_toolstool	tool_copyserversessionfinal_parsed_configmcp_to_genai_tool_adaptersr  r   r  r  r  r  r  final_parsed_config_to_callr  r  r  s                            r!   r  zAsyncModels.generate_content_!  s    P 	77%d&6&6
EJ	
  m	FD	!11;F;m''T'2m ((* ^ ^e 


#
#99-H'!	#)) &%d$

+0@0@ ,,''^^11(( OOM43HOI	  + ,, & F$?F  #9  ;;*"'";"; <<**FKK# '
 ""7+"J +2 t$M&%N !*-
 :: '(8(8*e L  65 
	(	()<	=++(3F , 
 
y^ ^ ^@ 
$ !fe99:\\$'$5!%**Wb)%$'J!)*.CC		#c+E"FG+
..G  ++(3F , 
 
e^ ^ ^l $0#H#H
$  kk23M2Na
P AC(..0h&*#44&#'
 #  ***5 	$
 (4(E(E))
% //(3N 0 
 
 	#a'"%*
++H 

##&&q)11&&q)1177
@@,  	
 #
$//2:: %%!
 <<)1
,
3
3H
=h%
//+
,
///
0*112CD*112GHk '*p 
0
01D
E" / 	3 }^ ^ ^J 
y^d
e^\
(E^ ^ ^ ^s   BV:VV:EV%V
A.V%?V 3V%3V4V%7V:VV:	C	V%VV%V:"V#V:(B&V%VBV%V B8V%V%6V:V#V:V%V%V%V:V%V:V% V%#V:%V7+V.,V73V:c                
   K   sdn8t        t              rt        j                  di nj	                  d      t        j                  t         j                  dd             fd} |       S w)	aM  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.
    NTr  r-  FrC  c            	     2  K   t        j                         4 d {   } }t        j                  dd      rpt	        j
                  |      rZ|Wg }|j                  rH|j                  D ]1  }t        |t        j                        r|j                  r|j                  s0|j                  s$|j                  s|j                  s|j                  r%|j!                  dd i      }|j#                  |       |j                  D ]  }t        |dd       	 t%        d      |j&                  S| j)                  t+        j,                  j                  |j&                               d {   }|j#                  |       {t%        d       !|j#                  |       4 ||_        t	        j.                  |t        j                  dd             d {   \  }}t	        j0                  |      r-j3                  |	       d {   }	|	2 3 d {   }
|
 rd
}t        t        j4                        r"j                  rEt7        j                        }n/t        t8              rj;                  dg       }|rt7        |      }t7              |k7  r5dj=                  t?        t@                    }tB        jE                  d|       j3                  |	       d {   }	|	2 3 d {   }
|
 t	        jF                  |       t	        jH                  |      }tB        jK                  d| d       g }d }d }
d
}}|d
kD  r`t	        jL                  ||d      }|r|j!                  d      nd }|rt	        jN                  |      }|dz  }j3                  ||	       d {   }	|dkD  rtB        jK                  d| d       |dz  }|dkD  r|d
k(  rtB        jK                  d       |dk(  r|	2 3 d {   }
|st	        jP                  ||
      }|
 '|
jR                  r<|
jR                  d
   jT                  r#|
jR                  d
   jT                  jV                  s nt	        jX                  |
|       d {   }|rt	        jP                  ||
      }|
 |	2 3 d {   }
t	        jZ                  |      r||
_.        t	        jP                  ||
      }|
 A|r|sn|
|
jR                  d
   jT                  }t        j^                  d|      }ta        jb                  |      }|s|je                  |       t        |tf              r$|"|j#                  |       |j#                  |       ||j#                  |       |j#                  |       |d
kD  r`d d d       d {    y 7 7 _7 7 7 6 	 d d d       d {  7   y 7 7 6 	 d d d       d {  7   y 7 M7 7 {6 7 W6 |
H|
jR                  r<|
jR                  d
   jT                  r#|
jR                  d
   jT                  jV                  st	        jX                  |
|       d {  7  }7 # 1 d {  7  sw Y   y xY ww)Nr-  Fr  rE  rF  rF  rG  rC  r!  r   r   r  r  r  r  TrH  r  r
   r  r  r  r  r  )4rJ  rK  r4  r,  r   rL  r   r  r   rM  r  r  r  r  r  r  r  r  r   r   rN  r   rO  rP  r  rK  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r~  rD   r   rQ  r  r  r  ri   rk   r  r  )rR  current_configrS  rT  rU  rV  rW  rX  rY  r  r  r  r   r  r  r  r  r  loop_contentsr  rZ  r  r  r   rh   r  rf   r  r=  s                          r!   stream_generatorz=AsyncModels.generate_content_stream.<locals>.stream_generator"  s    **, OK OK& D$$j%8;;NK*!#)!!&,, #'D%**-$2B2B..))~~33**"oomT5JoK)""9-".. Ff&A4H!" %;  [[,$)$=$=">> ,,fkk% G
 $$W-$L '.   &G#'H $-N  <<")$*:*:J"N  	87 **+>?88H5H 9  ( &  EK &"#
 ; ;<||&)&,,&7#&$'JJw+E&)%j#+,0EE))C-G$HIKNN
   88H5H 9  ( &  EK 	<<	
 &2%J%J&
" 	*+1.	
 CE*" (1,%66!(%), % ",,$,7 &
 *6*G*G++' q&!88$0 9  ( UKK*1#Y78
$
)
$U1Q6KKJ !V'  e! , B B!5!  (( ++A.66 ++A.66<<&HH|  $
 +"."D"D#U#- +'  e778KL6 8 +@@m k %8] $..q199
"'--'#
 ,,}5-3.55mDt,1B1N  !23  !67*.556GH
,
3
34I
JK )1,UOK OK OKDX
{OK OK OKdX
oOK OK OK|  (0x ''''*22''*2288"DD<    kOK OK OK OKs~  ZWZEZ+W

,A.ZW3ZWZWWWCZ-W*.Z4W08W-9W0<B;Z7X8AZX	X
XBZX
ZZ5X9X:X=C7Z6ZZ Z
ZZZWZZ#W&$Z*Z-W00Z2Z=X >ZZX
ZZXA%Z8Y;9Z ZZZ	ZZr'  )	r  r  r   r  r  r   r  r4  r,  )r=  rf   rh   r   r_  r  r  s   ```` @@r!   r  z#AsyncModels.generate_content_stream5"  s     B m	FD	!11;F;m''T'2m 	77%d&6&6
EJ	
 QK QKf s   A;Bc                H   K   | j                  ||||       d{   S 7 w)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(location=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.
    r_  Nr  r  s        r!   r  zAsyncModels.edit_imageY#  s7     b !!)	 "    s   " "c                  K   t        j                  |      j                  xs t        j                         }|j                  d|_        | j
                  j                  r8|j                  d      }|j                  s|j                  }|r|dz   nd|_        t        d| j                  | j                  |       d{   |      S 7 	w)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  r5  )r   r  r   r  r$  r,  r-  r  r#  r   r  r	  s      r!   r  zAsyncModels.list#  s     < 	##6299 	$!!#   f    d +f}}  77% 	
 

jjj''	  	(s   B>C C

Cc                H  K   | j                  |||       d{   }d}g }|r|j                  s|S |j                  D ]E  }|j                  r&|j                  j                  dk(  r|j                  }5|j	                  |       G t        j                  ||      }|S 7 w)az  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.
    rY  Nr  r  r  r  s	            r!   r  zAsyncModels.generate_images#  s     : .. /  L
 )-%|<<'88 1

+
+//<< -<,M,M)01 ++)*KH O1s   B"B BB"c                  K   t        j                  ||||       |xs i }t        |t         j                        r|j	                         }nt        |      }t        j                  |j                  dd      |j                  dd      |j                  dd      |j                  dd      |j                  dd      |j                  dd      |j                  d	d      |j                  d
d      |j                  dd      |j                  dd      
      }d|d<   d|d<   | j                  ||||       d{   S 7 w)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(location=IMAGE_FILE_PATH),
          upscale_factor='x2',
      )
      response.generated_images[0].image.show()
      # Opens my-image.png which is upscaled by a factor of 2.
    rf  r0  Nr   r   r   r   r   r   r  r  r   r  r  r.  r
   r   r  r  s          r!   r  zAsyncModels.upscale_image#  sF    B 
  %	 \rF&%223$$&j<j11^^ND9!~~&6=&NN+@$G$..)<dC%>>*>E#(:DA#->>($$
 'NN+@$G",..'#
 ~~h-J$ #Jv%&J!"$$%	 %    s   D7E 9D>:E c          
      `  K   |s|s|r|rt        d      i }| j                  j                  s|rt        |t        j
                        r|j                         }nt        |      }|j                  d      r|j                  d      rt	        j
                  |j                  d      |j                  d            }nL| j                  j                  s5|r2t        |t        j                        r#|j                         }|j                  di       }nht        |      }t        |j                  d      t        j
                        r4|j                  dt	        j
                               }	|	j                         }|r|j                  d      rz|j                  d      rit	        j                  |j                  d      |j                  d      t	        j
                  |j                  d      |j                  d            	      }| j                  ||||||
       d{   S 7 w)r  r  r  r  r@   r  r  r   r  r  r  Nr  r   s
             r!   r  zAsyncModels.generate_videosF$  s    b 	%5f' 
 !#I$$	E5;;	'$$&	K		u	)--">e$	k0J
 &&6	FE66	7&&(
NN7B/	&\
jnnW-u{{;#->>'5;;=#I)**,)	y}}U+	m0L++>>(+..)++MM%(#--4
 && '    s   H%H.'H,(H.c                  K   | j                   j                  s5d|v rt        j                  |      }| j	                  |||       d{   S t        j
                  |      rgt        j                  |      }t        |      dkD  rt        d      | j	                  |||d   t        j                  j                  |       d{   S | j	                  ||t        j                  j                  |       d{   S 7 7 ;7 w)	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 = 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   rN  )rf   rh   r   r   r  r  s        r!   r  zAsyncModels.embed_content$  s    T $$		&<<)&& '    	((/LL2	 	!A	%
 	
 &&%a("33AA '    &&"33;;	 '   %s7   AD	C?
A;DD4D:D;DDD)Hr  r  r  r  r   r   r  r  r   r  r5  rE  r   r   rK  r  r  r  r  rT  rW  r  r[  r]  r  r  r  rb  rd  r  r  rh  rj  r  r  rn  rp  r  r  rs  rt  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!   r)  r)    sE    =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 <@l l ..	l
 u778l ##lf :>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T T e,,e.H.HHI	T
 u889T $$Tv =Ab b e,,e.H.HHI	b
 u889b U223bT	 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r#   r)  )NN)rJ  r8  loggingtypingr   r   r   r   r   r   urllib.parser	    r   r   r  r   r   r   r   ri   r   r   r,  r   r   r7   r   r8   pagersr   r   	getLoggerr  r"   r&   r)   r  r  objectr;   rB   rY   rV   rc   rn   rt   r|   r   r   r   rl   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r!  r%  r*  r0  rl  rv  ry  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	  rk  ru  r  r  r  r  r(  r+  r.  r0  r8  r<  rD  rG  r7  r;  rb  r   r   r  r  r  r  r  r   r  r  r  rd  r  r  r  r  r  ra  rt  rh  rs  rf  r   r]  r  r  r  r  r  r  r
  r  r  r  r  r  r  r  r  
BaseModuler  r)  r'  r#   r!   <module>rn     sz8  $    K K "  *        & . . %			0	1  # $ 	 /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;?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(^	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(^	. /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(^	. /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(^	< /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(^	/h /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(^	. /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(^	8 /3;?	BBtCH~v-.B DcN+B %S#X 678	B
 
#s(^BP /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;?~tCH~v-.~DcN+~ %S#X 678~ 
#s(^	~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;?HtCH~v-.HDcN+H %S#X 678H 
#s(^	HZ /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(^	*^ /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(^	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(^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;?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;?OtCH~v-.ODcN+O %S#X 678O 
#s(^	Oh /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;?KtCH~v-.KDcN+K %S#X 678K 
#s(^	K` /3;?JtCH~v-.JDcN+J %S#X 678J 
#s(^	J^ /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(^	6T"[## T"nDi$+(( i$r#   