
    Ojk                       S SK r S SKrS SKJrJrJr  S SKJr  SSKJ	r	  SSKJ
r
  SSKJr  SSKJr  SS	K
Jr  SS
K
Jr  SSKJrJr  \R*                  " S5      r  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S jjr  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S jjr  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S jjr  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S jjr  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S jjr  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S jjr  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S jjr   SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S jjr!  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S jjr"  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S jjr#  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S jjr$  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S jjr%  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S jjr&  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S jjr'  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S jjr(  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S  jjr)  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S! jjr*  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S" jjr+  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S# jjr,  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S$ jjr-  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S% jjr.  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S& jjr/  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S' jjr0  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S( jjr1  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S) jjr2  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S* jjr3  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S+ jjr4  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S, jjr5  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S- jjr6  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S. jjr7  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S/ jjr8  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S0 jjr9  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S1 jjr:  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S2 jjr;  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S3 jjr<  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S4 jjr=  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S5 jjr>  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S6 jjr?  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S7 jjr@  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S8 jjrA  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S9 jjrB  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S: jjrC  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S; jjrD  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S< jjrE  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S= jjrF  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S> jjrG  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S? jjrH  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4S@ jjrI  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4SA jjrJ  SIS\\\\4   \4   S\\\\4      S\\\\\4   \4      S\\\4   4SB jjrK " SC SD\	R                  5      rM " SE SF\	R                  5      rN " SG SH5      rOg)J    N)AnyOptionalUnion)	urlencode   )_api_module)_common)_transformers)types)get_value_by_path)set_value_by_path)
AsyncPagerPagerzgoogle_genai.tuningsfrom_objectparent_objectroot_objectreturnc           
      V   0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b#  [        US/[        [        U S/5      X25      5        U$ )	NsamplingCountsampling_countflipEnabledflip_enabledautoraterModelautorater_modelgenerationConfiggeneration_configgetvsetv_GenerationConfig_from_vertexr   r   r   	to_objects       V/var/www/html/leaf-doctor-v1/venv/lib/python3.13/site-packages/google/genai/tunings.py_AutoraterConfig_from_vertexr$   "   s    
 !)	+()5%&[?:K(LM	+'3^$d;&HI	+()*6&'k<L;M)NO	+*+,8	%123Y	
 
    c           
      V   0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b#  [        US/[        [        U S/5      X25      5        U$ )	Nr   r   r   r   r   r   r   r   )r   r   _GenerationConfig_to_vertexr!   s       r#   _AutoraterConfig_to_vertexr(   =   s    
 !)	+()*6_%tK:J9K'LM	+'(4]OT+7G%HI	+)*+7%&[;L:M(NO	++,-9	#234i	
 
r%   c                 Z    0 n[        U S/5      b  [        USS/[        U S/5      5        U$ Nname_urlr   r   r!   s       r#   #_CancelTuningJobParameters_to_mldevr.   X   8    
 !)	+x ,VV$d;&AB	r%   c                 Z    0 n[        U S/5      b  [        USS/[        U S/5      5        U$ r*   r-   r!   s       r#   $_CancelTuningJobParameters_to_vertexr1   d   r/   r%   c                 X    0 n[        U S/5      b  [        US/[        U S/5      5        U$ NsdkHttpResponsesdk_http_responser-   r!   s       r#   #_CancelTuningJobResponse_from_mldevr6   p   @    
 !)	+)*+7'(${=N<O*P 
r%   c                 X    0 n[        U S/5      b  [        US/[        U S/5      5        U$ r3   r-   r!   s       r#   $_CancelTuningJobResponse_from_vertexr9   ~   r7   r%   c                     0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        S5      eU$ )Noutcomeoutputidjid parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.r   r   
ValueErrorr!   s       r#   _CodeExecutionResult_to_vertexrA      s~    
 !)	+	{#/YKkI;!?@	+z".XJ[8* =>	+v*
	2 
 
r%   c           
          0 n[        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S/5      b  [        US/[        U S/5      5        U$ )NrewardConfigreward_configweight)r   r   2_SingleReinforcementTuningRewardConfig_from_vertexr!   s       r#   I_CompositeReinforcementTuningRewardConfigWeightedRewardConfig_from_vertexrG      so    
 !)	+'(4	:~./	
 
+z".XJ[8* =>	r%   c           
          0 n[        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S/5      b  [        US/[        U S/5      5        U$ )NrD   rC   rE   )r   r   0_SingleReinforcementTuningRewardConfig_to_vertexr!   s       r#   G_CompositeReinforcementTuningRewardConfigWeightedRewardConfig_to_vertexrJ      so    
 !)	+()5	8/0)	
 
+z".XJ[8* =>	r%   c                     0 n[        U S/5      b4  [        US/[        U S/5       Vs/ s H  n[        XCU5      PM     sn5        U$ s  snf )NweightedRewardConfigsweighted_reward_configs)r   r   rG   r   r   r   r"   items        r#   5_CompositeReinforcementTuningRewardConfig_from_vertexrP      sq    
 !)	+/01=	"#
 [+B*CD		
 E V E		
	 
	
   Ac                     0 n[        U S/5      b4  [        US/[        U S/5       Vs/ s H  n[        XCU5      PM     sn5        U$ s  snf )NrM   rL   )r   r   rJ   rN   s        r#   3_CompositeReinforcementTuningRewardConfig_to_vertexrS      sq    
 !)	+123?	 !
 [+D*EF		
 G T G		
	 
	
rQ   c                     0 n[        U S/5      b4  [        US/[        U S/5       Vs/ s H  n[        XCU5      PM     sn5        [        U S/5      b  [        US/[        U S/5      5        U$ s  snf )Npartsrole)r   r   _Part_to_vertexrN   s        r#   _Content_to_vertexrX      s    
 !)	+y!-		 [7)4	
4 D[94	
 
+x ,VHd;9:		
s   A.c                    0 n[        U S/5      b  [        S5      e[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        S5      e[        U S/5      b  [        U/ SQ[        U S/5      5        [        U S	/5      b  [        U/ S
Q[        U S	/5      5        [        U S/5      b  [        S5      e[        U S/5      b  [        S5      e[        U S/5      b  [        S5      e[        U S/5      b  [        S5      e[        U S/5      b  [        S5      e[        U S/5      b  [        U/ SQ[        U S/5      5        [        U S/5      b  [        U/ SQ[        U S/5      5        [        U S/5      b  [        S5      e[        U S/5      b  [        S5      e[        U S/5      b  [        S5      e[        U S/5      b  [        S 5      e[        U S!/5      b  [        S"5      e[        U S#/5      b  [        S$5      e[        U S%/5      b  [        S&5      e[        U S'/5      b  [        S(5      e[        U S)/5      b  [        S*5      e[        U S+/5      b  [        S,5      e[        U S-/5      b  [        S.5      e[        U S//5      b  [        S05      e[        U S1/5      b  [        S25      e[        U S3/5      b  [        S45      e[        U S5/5      b  [        S65      e[        U S7/5      b  [        S85      eU$ )9Nvalidation_datasetzzvalidation_dataset parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.tuned_model_display_namedisplayNamedescriptionzsdescription parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.epoch_count)
tuningTaskhyperparameters
epochCountlearning_rate_multiplier)r_   r`   learningRateMultiplierexport_last_checkpoint_onlyzexport_last_checkpoint_only parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.pre_tuned_model_checkpoint_idzpre_tuned_model_checkpoint_id parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.adapter_sizeztadapter_size parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.tuning_modezstuning_mode parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.custom_base_modelzycustom_base_model parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.
batch_size)r_   r`   	batchSizelearning_rate)r_   r`   learningRateevaluation_configzyevaluation_config parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.labelsznlabels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.betazlbeta parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.base_teacher_modelzzbase_teacher_model parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.tuned_teacher_model_sourceztuned_teacher_model_source parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.sft_loss_weight_multiplierzsft_loss_weight_multiplier parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.
output_urizroutput_uri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.encryption_speczwencryption_spec parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.rD   zureward_config parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.composite_reward_configzcomposite_reward_config parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.samples_per_promptzzsamples_per_prompt parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.evaluate_intervalzyevaluate_interval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.checkpoint_intervalz{checkpoint_interval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.max_output_tokenszymax_output_tokens parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.thinking_levelzvthinking_level parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.validation_dataset_uriz~validation_dataset_uri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.r   r@   r   r!   s       r#   _CreateTuningJobConfig_to_mldevr}     sG   
 !)	+,-.:
	B 
 
+234@	[567 
+'3
	< 
 
+'37[=/* 
+234@C[567 
+567C
	M 
 
+789E
	M 
 
+'(4
	< 
 
+'3
	< 
 
++,-9
	B 
 
+~&26[<.) 
+()59[?+, 
++,-9
	B 
 
+z".
	3 
 
+x ,
	3 
 
+,-.:
	B 
 
+456B
	M 
 
+456B
	M 
 
+~&2
	< 
 
+)*+7
	< 
 
+()5
	< 
 
+123?
	M 
 
+,-.:
	B 
 
++,-9
	B 
 
+-./;
	B 
 
++,-9
	B 
 
+()*6
	< 
 
+012>
	M 
 
r%   c           
      6   0 n[        USS/5      nUc  SnUS:X  a2  [        U S/5      b#  [        US/[        [        U S/5      X25      5        OUS:X  a2  [        U S/5      b#  [        US/[        [        U S/5      X25      5        OoUS:X  a2  [        U S/5      b#  [        US	/[        [        U S/5      X25      5        O7US
:X  a1  [        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        USS/5      nUc  SnUS:X  a)  [        U S/5      b  [        U/ SQ[        U S/5      5        OUS:X  a)  [        U S/5      b  [        U/ SQ[        U S/5      5        O]US:X  a)  [        U S/5      b  [        U/ SQ[        U S/5      5        O.US
:X  a(  [        U S/5      b  [        U/ SQ[        U S/5      5        [        USS/5      nUc  SnUS:X  a)  [        U S/5      b  [        U/ SQ[        U S/5      5        OUS:X  a)  [        U S/5      b  [        U/ SQ[        U S/5      5        O]US:X  a)  [        U S/5      b  [        U/ SQ[        U S/5      5        O.US
:X  a(  [        U S/5      b  [        U/ SQ[        U S/5      5        [        USS/5      nUc  SnUS:X  a)  [        U S/5      b  [        USS/[        U S/5      5        O]US:X  a)  [        U S/5      b  [        USS/[        U S/5      5        O.US:X  a(  [        U S/5      b  [        US	S/[        U S/5      5        [        USS/5      nUc  SnUS:X  a)  [        U S/5      b  [        U/ SQ[        U S/5      5        OUS:X  a)  [        U S/5      b  [        U/ SQ[        U S/5      5        O]US:X  a)  [        U S/5      b  [        U/ SQ[        U S/5      5        O.US
:X  a(  [        U S/5      b  [        U/ SQ[        U S/5      5        [        USS/5      nUc  SnUS:X  a)  [        U S /5      b  [        USS!/[        U S /5      5        O.US:X  a(  [        U S /5      b  [        US	S!/[        U S /5      5        [        U S"/5      b  [        US#/[        U S"/5      5        [        USS/5      nUc  SnUS:X  a)  [        U S$/5      b  [        U/ S%Q[        U S$/5      5        O]US:X  a)  [        U S$/5      b  [        U/ S&Q[        U S$/5      5        O.US
:X  a(  [        U S$/5      b  [        U/ S'Q[        U S$/5      5        [        USS/5      nUc  SnUS:X  a)  [        U S(/5      b  [        U/ S)Q[        U S(/5      5        O.US:X  a(  [        U S(/5      b  [        U/ S*Q[        U S(/5      5        [        USS/5      nUc  SnUS:X  a3  [        U S+/5      b$  [        USS,/[        [        U S+/5      X25      5        OqUS:X  a3  [        U S+/5      b$  [        USS,/[        [        U S+/5      X25      5        O8US:X  a2  [        U S+/5      b$  [        US	S,/[        [        U S+/5      X25      5        [        U S-/5      b  [        US-/[        U S-/5      5        [        U S./5      b  [        U/ S/Q[        U S./5      5        [        U S0/5      b  [        US	S1/[        U S0/5      5        [        U S2/5      b  [        US	S3/[        U S2/5      5        [        U S4/5      b  [        U/ S5Q[        U S4/5      5        [        U S6/5      b  [        US7/[        U S6/5      5        [        U S8/5      b  [        US9/[        U S8/5      5        [        U S:/5      b$  [        USS;/[	        [        U S:/5      X25      5        [        U S</5      b%  [        USS=/[        [        U S</5      UU5      5        [        U S>/5      b  [        U/ S?Q[        U S>/5      5        [        U S@/5      b  [        U/ SAQ[        U S@/5      5        [        U SB/5      b  [        U/ SCQ[        U SB/5      5        [        U SD/5      b  [        U/ SEQ[        U SD/5      5        [        U SF/5      b  [        U/ SGQ[        U SF/5      5        [        U SH/5      b  [        USSI/[        U SH/5      5        U$ )JNconfigmethodSUPERVISED_FINE_TUNINGrZ   supervisedTuningSpecPREFERENCE_TUNINGpreferenceOptimizationSpecDISTILLATIONdistillationSpecREINFORCEMENT_TUNINGreinforcementTuningSpecr[   tunedModelDisplayNamer]   r^   )r   hyperParametersra   )r   r   ra   )r   r   ra   )r   r   ra   rb   )r   r   rc   )r   r   rc   )r   r   rc   )r   r   rc   rd   exportLastCheckpointOnlyrf   )r   r   adapterSize)r   r   r   )r   r   r   )r   r   r   rg   
tuningModerh   customBaseModelri   )r   r   rj   )r   r   rj   )r   r   rj   rk   )r   r   rl   )r   r   rl   rm   evaluationConfigrn   ro   )r   r   ro   rp   baseTeacherModelrq   tunedTeacherModelSourcerr   )r   r   sftLossWeightMultiplierrs   	outputUrirt   encryptionSpecrD   singleRewardConfigru   compositeRewardConfigrv   )r   r   samplesPerPromptrw   )r   r   evaluateIntervalrx   )r   r   checkpointIntervalry   )r   r   maxOutputTokensrz   )r   r   thinkingLevelr{   validationDatasetUri)r   r   "_TuningValidationDataset_to_vertex_EvaluationConfig_to_vertexrI   rS   r   r   r   r"   discriminators        r#    _CreateTuningJobConfig_to_vertexr     s2   
 !){Xx$89-,M..K./0<

!
"
,;!5 67 ++K./0<

'
(
,;!5 67 &K./0<



,;!5 67 ..K./0<

$
%
,;!5 67 
+234@	 ![567 
+'3kM?)KL{Xx$89-,M..K-)5


C
{]O
,
 ++K-)5


I
{]O
,
 &K-)5


?
{]O
,
 ..K-)5


F
{]O
, {Xx$89-,M..K456B


O
{78
9
 ++K456B


 {78
9 &K456B


K
{78
9
 ..K456B


 {78
9 {Xx$89-,M..K789E

!#=
>
{:;
<
 ++K789E

')C
D
{:;
<
 &K789E

9
:
{:;
< {Xx$89-,M..K.)*6


D
{^,
-
 ++K.)*6


J
{^,
-
 &K.)*6


@
{^,
-
 ..K.)*6


G
{^,
- {Xx$89-,M..K-)5

!<
0
{]O
,
 &K-)5

|
,
{]O
, 
++,-9	[./0 {Xx$89-,M..K,(4


B
{\N
+
 &K,(4


>
{\N
+
 ..K,(4


E
{\N
+ {Xx$89-,M..K/*+7


E
{_-
.
 &K/*+7


A
{_-
. {Xx$89-,M..K-./;

!#5
6
%;!4 56	 ++K-./;

');
<
%;!4 56	 &K-./;

1
2
%;!4 56	 
+z".
Dxj$AB	+x ,A[6(# 
+,-.:	/0[/01 
+456B	67[789 
+456BJ[789 
+~&2tK,'HI	+)*+7	[,-. 
+()5	"$898/0)	
 
+123?	"$;<;89:	
 
+,-.:J[/01 
++,-9J[./0 
+-./;L[012 
++,-9I[./0 
+()*6G[+,- 
+012>	"$:;[345 
r%   c                 :   0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        [        U S/5      X25        [        U S/5      b  [        [        U S/5      X25        U$ N
base_model	baseModelpre_tuned_modelpreTunedModeltraining_datasetr   )r   r   _TuningDataset_to_mldevr}   r!   s       r#   *_CreateTuningJobParametersPrivate_to_mldevr   I  s    
 !)	+~&2[M4l^#DE	+)*+7_%tK:K9L'MN	+*+,8[-./ 
+z".#[8*%y 
r%   c                 :   0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        [        U S/5      X25        [        U S/5      b  [        [        U S/5      X25        U$ r   )r   r   _TuningDataset_to_vertexr   r!   s       r#   +_CreateTuningJobParametersPrivate_to_vertexr   b  s    
 !)	+~&2[M4l^#DE	+)*+7_%tK:K9L'MN	+*+,8[-./ 
+z".$[8*%y 
r%   c           
         0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S	/5      b  [        US
/[        U S	/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )Nr   rf   ra   r^   rc   rb   r   r   rl   rk   rj   ri   r   r!   s       r#   (_DistillationHyperParameters_from_vertexr   {  s   
 !)	+'3^$d;&HI	+~&2]OT+~%FG	+012>	#$[345 
+*+,8	%123Y	
 
+'(4_%tK.9I'JK	+}%1\ND{m$DE	r%   c           
         0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S	/5      b#  [        US	/[        [        U S	/5      X25      5        U$ )
Nr   rp   r   rq   r   r{   promptDatasetUriprompt_dataset_urir`   r   r   r   r!   s       r#   %_DistillationSamplingSpec_from_vertexr     s   
 !)	+*+,8	[-./ 
+123?	%&[456 
+./0<	!"[123 
+*+,8	[-./ 
+)*+7	0012I	
 
r%   c           
         0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S/5      b  [        US/[        U S/5      5        [        U S	/5      b  [        US
/[        U S	/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )Nr   r   r   rp   r   hyper_parameterspipelineRootDirectorypipeline_root_directorystudentModelstudent_modeltrainingDatasetUritraining_dataset_urir   rq   r   r{   r   rg   r   r!   s       r#   _DistillationSpec_from_vertexr     s   
 !)	+*+,8	[-./ 
+*+,8	[-./ 
+)*+7	0012I	
 
+/01=	"#[234 
+'(4_%tK.9I'JK	+,-.:	 [/01 
+123?	%&[456 
+./0<	!"[123 
+~&2]OT+~%FG	r%   c           
         0 n[        U S/5      b-  [        US/[        R                  " [        U S/5      5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b#  [        US/[	        [        U S/5      X25      5        [        U S/5      b$  [        US/[        [        U S/5      UU5      5        U$ )NmetricsoutputConfigoutput_configautoraterConfigautorater_configinferenceGenerationConfiginference_generation_config)r   r   t	t_metricsr$   r    r!   s       r#   _EvaluationConfig_from_vertexr     s    
 !)	+	{#/YKT+	{-K!LM	+'(4_%tK.9I'JK	+)*+7	$012I	
 
+345A	&'%:;<	
 
r%   c           
         0 n[        U S/5      b-  [        US/[        R                  " [        U S/5      5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b#  [        US/[	        [        U S/5      X25      5        [        U S/5      b$  [        US/[        [        U S/5      UU5      5        U$ )Nr   r   r   r   r   r   r   )r   r   r   r   r(   r'   r!   s       r#   r   r   3  s    
 !)	+	{#/YKT+	{-K!LM	+()5^$d;8I&JK	+*+,8	"123Y	
 
+567C	$%#<=>	
 
r%   c                     0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        S5      eU$ )Ncodelanguager=   r>   r?   r!   s       r#   _ExecutableCode_to_vertexr   V  s~    
 !)	+x ,VHd;9:	+
|$0ZL${ZL"AB	+v*
	2 
 
r%   c                    0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S	/5      b  [        US
/[        U S	/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US /[        U S/5      5        [        U S!/5      b  [        US"/[        U S!/5      5        [        U S#/5      b  [        US#/[        U S#/5      5        [        U S$/5      b  [        US%/[        U S$/5      5        [        U S&/5      b  [        US'/[        U S&/5      5        [        U S(/5      b  [        US)/[        U S(/5      5        U$ )*NmodelConfigmodel_selection_configresponseJsonSchemaresponse_json_schemaaudioTimestampaudio_timestampcandidateCountcandidate_countenableAffectiveDialogenable_affective_dialogfrequencyPenaltyfrequency_penaltylogprobsr   ry   mediaResolutionmedia_resolutionpresencePenaltypresence_penaltyresponseLogprobsresponse_logprobsresponseMimeTyperesponse_mime_typeresponseModalitiesresponse_modalitiesresponseSchemaresponse_schemaroutingConfigrouting_configseedspeechConfigspeech_configstopSequencesstop_sequencestemperaturethinkingConfigthinking_configtopKtop_ktopPtop_pr-   r!   s       r#   r    r    k  s   
 !)	+'3	!"[=/* 
+,-.:	 [/01 
+()*6&'k<L;M)NO	+()*6&'k<L;M)NO	+/01=	"#[234 
+*+,8	[-./ 
+
|$0ZL${ZL"AB	+)*+7'(${=N<O*P 
+)*+7&'k<M;N)O 
+)*+7&'k<M;N)O 
+*+,8	[-./ 
+*+,8	[-./ 
+,-.:	[/01 
+()*6&'k<L;M)NO	+()5%&[?:K(LM	+x ,VHd;9:	+'(4_%tK.9I'JK	+()5%&[?:K(LM	+'3]OT+%GH	+()*6&'k<L;M)NO	+x ,WItK&:;	+x ,WItK&:;	r%   c           
         0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S	/5      b  [        US
/[        U S	/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b#  [        US /[        [        U S/5      X25      5        [        U S!/5      b  [        US"/[        U S!/5      5        [        U S#/5      b  [        US#/[        U S#/5      5        [        U S$/5      b  [        US%/[        U S$/5      5        [        U S&/5      b  [        US'/[        U S&/5      5        [        U S(/5      b  [        US)/[        U S(/5      5        [        U S*/5      b  [        S+5      eU$ ),Nr   r   r   r   r   r   r   r   r   r   r   r   r   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   enable_enhanced_civic_answerszenable_enhanced_civic_answers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.)r   r   _SpeechConfig_to_vertexr@   r!   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                 Z    0 n[        U S/5      b  [        USS/[        U S/5      5        U$ r*   r-   r!   s       r#    _GetTuningJobParameters_to_mldevr   Q  r/   r%   c                 Z    0 n[        U S/5      b  [        USS/[        U S/5      5        U$ r*   r-   r!   s       r#   !_GetTuningJobParameters_to_vertexr   ]  r/   r%   c                     0 n[        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        USS/[        U S/5      5        U$ )N	page_size_querypageSize
page_token	pageTokenfilterr-   r!   s       r#   _ListTuningJobsConfig_to_vertexr  i  s    
 !)	+}%1*-tK+/O 
+~&2	;[<.) 
+z".8,d;
.KL	r%   c                 T    0 n[        U S/5      b  [        [        U S/5      X25        U$ )Nr   )r   r  r!   s       r#   #_ListTuningJobsParameters_to_vertexr    s6    
 !)	+z".#[8*%y 
r%   c                 4   0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b4  [        US/[        U S/5       Vs/ s H  n[        XCU5      PM     sn5        U$ s  snf )Nr4   r5   nextPageTokennext_page_token
tuningJobstuning_jobs)r   r   _TuningJob_from_vertexrN   s        r#   #_ListTuningJobsResponse_from_vertexr    s    
 !)	+)*+7'(${=N<O*P 
+()5&'kO;L)MN	+~&2	 [<.9	
9 #4K@9	
 
	
s   6Bc                     0 n[        U S/5      b4  [        US/[        U S/5       Vs/ s H  n[        XCU5      PM     sn5        U$ s  snf )Nspeaker_voice_configsspeakerVoiceConfigs)r   r   _SpeakerVoiceConfig_to_vertexrN   s        r#   "_MultiSpeakerVoiceConfig_to_vertexr    sg    
 !)	+/01=	 [+B*CD	
D *$;GD	
 
	
rQ   c           
      "   0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S/5      b  [        US/[        U S/5      5        [        U S	/5      b  [        US
/[        U S	/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [	        S5      e[        U S/5      b  [	        S5      e[        U S/5      b  [	        S5      eU$ )Nr   r   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_callzqtool_call parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.tool_responsezutool_response parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.part_metadatazupart_metadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.)r   r   rA   r   r@   r!   s       r#   rW   rW     ss   
 !)	+*+,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           
         0 n[        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S	/5      b  [        US
/[        U S	/5      5        U$ )Nr   r   autoraterPromptautorater_promptautoraterResponseParseConfigautorater_response_parse_configparsedResponseConversionScorer!parsed_response_conversion_scorerexactMatchScorerexact_match_scorer)r   r   r$   r!   s       r#   /_ReinforcementTuningAutoraterScorer_from_vertexr2    s   
 !)	+)*+7	$012I	
 
+)*+7&'k<M;N)O 
+678D	*+[9:; 
+89:F	,-[;<= 
+*+,8	[-./ 
r%   c           
         0 n[        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S	/5      b  [        US
/[        U S	/5      5        U$ )Nr   r   r+  r*  r-  r,  r/  r.  r1  r0  )r   r   r(   r!   s       r#   -_ReinforcementTuningAutoraterScorer_to_vertexr4  <  s   
 !)	+*+,8	"123Y	
 
+*+,8%&[;M:N(O 
+9:;G	'([<=> 
+;<=I	)*[>?@ 
+,-.:	[/01 
r%   c                 H   0 n[        U S/5      b4  [        US/[        U S/5       Vs/ s H  n[        XCU5      PM     sn5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b#  [        US/[        [        U S/5      X25      5        U$ s  snf )Ncontents
referencessystem_instructionsystemInstruction)r   r   rX   rN   s        r#   %_ReinforcementTuningExample_to_vertexr:  h  s    
 !)	+
|$0	 [:,7	
7 t<7	
 
+~&2\ND|n$EF	+,-.:	345y	
 
%	
s   Bc           
         0 n[        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S	/5      b#  [        US
/[        [        U S	/5      X25      5        U$ )Nr   ru   r   r   r   r{   r   r   r   single_reward_config)r   r   rP   rF   r!   s       r#   $_ReinforcementTuningSpec_from_vertexr=    s   
 !)	+/01=	"#=678)	
 
+,-.:	 [/01 
+./0<	!"[123 
+)*+7&'k<M;N)O 
+,-.:	 :345y	
 
r%   c                 
   0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        S5      e[        U S/5      b  [        S5      eU$ )	N	mime_typemimeType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.r?   r!   s       r#    _ReplicatedVoiceConfig_to_vertexrE    s    
 !)	+}%1ZL${[M"BC	+,-.:	[/01 
+()5
	? 
 
+123?
	M 
 
r%   c           
         0 n[        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S	/5      b  [        US
/[        U S	/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )NautoraterScorerautorater_scorer
rewardNamereward_nameparseResponseConfigparse_response_configcodeExecutionRewardScorercode_execution_reward_scorerstringMatchRewardScorerstring_match_reward_scorercloudRunRewardScorercloud_run_reward_scorer)r   r   r2  r!   s       r#   rF   rF     s9   
 !)	+)*+7	7012I	
 
+~&2]OT+~%FG	+-./;	 ![012 
+345A	'([678 
+123?	%&[456 
+./0<	"#[123 
r%   c           
         0 n[        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S	/5      b  [        US
/[        U S	/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )NrH  rG  rJ  rI  rL  rK  rN  rM  rP  rO  rR  rQ  )r   r   r4  r!   s       r#   rI   rI     s9   
 !)	+*+,8	5123Y	
 
+'3\ND}o$FG	+/01=	[234 
+678D	$%[9:; 
+456B	"#[789 
+123?	 [456 
r%   c           
          0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b#  [        US/[        [        U S/5      X25      5        U$ )Nspeakervoice_configvoiceConfig)r   r   _VoiceConfig_to_vertexr!   s       r#   r  r  6  sn    
 !)	+	{#/YKkI;!?@	+'(4	~./	
 
r%   c           
         0 n[        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b$  [        US/[        [        U S/5      UU5      5        U$ )NrV  rW  language_codelanguageCodemulti_speaker_voice_configmultiSpeakerVoiceConfig)r   r   rX  r  r!   s       r#   r   r   K  s    
 !)	+'(4	~./	
 
+()5^$d;8I&JK	+456B	"#*;<=	
 
r%   c                     0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )Nr+   modelendpointr-   r!   s       r#   _TunedModel_from_mldevra  k  s[    
 !)	+x ,WItK&:;	+x ,ZL${VH"=>	r%   c                     0 n[        U S/5      b  [        S5      e[        U S/5      b  [        S5      e[        U S/5      b*  [        USS/[        U S/5       Vs/ s H  oDPM     sn5        U$ s  snf )Ngcs_urizogcs_uri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.vertex_dataset_resourcezvertex_dataset_resource parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.examplesr|   rN   s        r#   r   r   z  s    
 !)	+	{#/
	< 
 
+123?
	M 
 
+
|$0	Z {ZL9:9$9: 
 	;s   A/c                 t   0 n[        USS/5      nUc  SnUS:X  a)  [        U S/5      b  [        USS/[        U S/5      5        OUS:X  a)  [        U S/5      b  [        USS/[        U S/5      5        O]US	:X  a)  [        U S/5      b  [        US
S/[        U S/5      5        O.US:X  a(  [        U S/5      b  [        USS/[        U S/5      5        [        USS/5      nUc  SnUS:X  a)  [        U S/5      b  [        USS/[        U S/5      5        OUS:X  a)  [        U S/5      b  [        USS/[        U S/5      5        O]US	:X  a)  [        U S/5      b  [        US
S/[        U S/5      5        O.US:X  a(  [        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b  [        S5      eU$ )Nr   r   r   rc  r   r   r   r   r   r   r   r   r   rd  re  zpexamples parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.r?   r   s        r#   r   r     sN   
 !){Xx$89-,M..K)%1

!#7
8
{YK
(
 ++K)%1

')=
>
{YK
(
 &K)%1

1
2
{YK
(
 ..K)%1

$&:
;
{YK
( {Xx$89-,M..K345A

!#7
8
{67
8
 ++K345A

')=
>
{67
8
 &K345A

1
2
{67
8
 ..K345A

$&:
;
{67
8 
+
|$0
	5 
 
r%   c           
      Z   0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b-  [        US/[        R                  " [        U S/5      5      5        [        U S/5      b  [        US/[        U S/5      5        [        U SS/5      b  [        US	/[        U SS/5      5        [        U SS
/5      b  [        US/[        U SS
/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b#  [        US/[	        [        U S/5      X25      5        U$ )Nr4   r5   r+   state
createTimecreate_timer_   	startTime
start_timecompleteTimeend_time
updateTimeupdate_timer]   r   r   _selftuned_model)r   r   r   t_tuning_job_statusra  r!   s       r#   _TuningJob_from_mldevrt    s   
 !)	+)*+7'(${=N<O*P 
+x ,VHd;9:	+y!-			d;	:; 
+~&2]OT+~%FG	+k23?	[<56 
+n56B	[<89 
+~&2]OT+~%FG	+'3]OT+%GH	+}%1\ND{m$DE	+y!-	wi()	
 
r%   c           
         0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b-  [        US/[        R                  " [        U S/5      5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S	/5      b  [        US
/[        U S	/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b#  [        US/[	        [        U S/5      X25      5        [        U S/5      b$  [        US/[        [        U S/5      UU5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US /[        U S/5      5        [        U S!/5      b  [        US"/[        U S!/5      5        [        U S#/5      b#  [        US$/[        [        U S#/5      X25      5        [        U S%/5      b  [        US&/[        U S%/5      5        [        U S'/5      b)  [        US(/[        U S'/5       Vs/ s H  oDPM     sn5        [        U S)/5      b  [        US)/[        U S)/5      5        [        U S*/5      b  [        US+/[        U S*/5      5        [        U S,/5      b  [        US,/[        U S,/5      5        [        U S-/5      b  [        US./[        U S-/5      5        [        U S//5      b  [        US0/[        U S//5      5        [        U S1/5      b  [        US2/[        U S1/5      5        [        U S3/5      b  [        US4/[        U S3/5      5        [        U S5/5      b  [        US6/[        U S5/5      5        [        U S7/5      b  [        US8/[        U S7/5      5        [        U S9/5      b  [        US:/[        U S9/5      5        [        U S;/5      b  [        US</[        U S;/5      5        [        U S=/5      b$  [        US>/[        [        U S=/5      UU5      5        U$ s  snf )?Nr4   r5   r+   rh  ri  rj  rk  rl  endTimern  ro  rp  errorr]   r   r   
tunedModelrr  r   r   r   supervised_tuning_specr   preference_optimization_specr   distillation_specr   reinforcement_tuning_spectuningDataStatstuning_data_statsr   rt   partnerModelTuningSpecpartner_model_tuning_specr   rm   r   rh   evaluateDatasetRunsevaluate_dataset_runs
experimentfullFineTuningSpecfull_fine_tuning_specrn   r   rs   pipelineJobpipeline_jobserviceAccountservice_accountr   r[   tuningJobStatetuning_job_stateveoTuningSpecveo_tuning_spectuningJobMetadatatuning_job_metadataveoLoraTuningSpecveo_lora_tuning_specdistillationSamplingSpecdistillation_sampling_spec)r   r   r   rs  r   r=  r   r   rN   s        r#   r  r  !  sA   
 !)	+)*+7'(${=N<O*P 
+x ,VHd;9:	+y!-			d;	:; 
+~&2]OT+~%FG	+}%1\ND{m$DE	+	{#/ZL${YK"@A	+~&2]OT+~%FG	+y!-WItK';<	+'3]OT+%GH	+}%1\ND{m$DE	+~&2]OT+~%FG	+()5&'kO;L)MN	+./0<	!"[123 
+456B	'([789 
+*+,8	%123Y	
 
+123?	$%,89:	
 
+)*+7'(${=N<O*P 
+()*6&'k<L;M)NO	+012>	$%[345 
+*+,8	%123Y	
 
+)*+7'(${=N<O*P 
+-./;	 !{-B,CDED$DE 
+~&2\ND|n$EF	+,-.:	 ![/01 
+z".XJ[8* =>	+}%1\ND{m$DE	+'3^$d;&HI	+()*6&'k<L;M)NO	+/01=	#$[234 
+()*6'(${=M<N*OP	+()5&'kO;L)MN	++,-9	[./0 
++,-9	 [./0 
+234@	%&-9:;	
 
 	Fs   Vc                    0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )Nr4   r5   r+   metadatadonerw  r-   r!   s       r#   _TuningOperation_from_mldevr    s    
 !)	+)*+7'(${=N<O*P 
+x ,VHd;9:	+
|$0ZL${ZL"AB	+x ,VHd;9:	+y!-WItK';<	r%   c                     0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )Nrc  r   rd  r-   r!   s       r#   r   r     si    
 !)	+	{#/+,d;.LM	+123?	 [456 
r%   c           
         0 n[        U S/5      b  [        USS/[        U S/5      5        [        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S/5      b#  [        US/[        [        U S/5      X25      5        [        U S/5      b#  [        US/[	        [        U S/5      X25      5        [        U S/5      b$  [        US	/[        [        U S/5      UU5      5        U$ )
Nparentr,   sample_responsesampleResponseexampler<  r   ru   r   )r   r   rX   r:  rI   rS   r!   s       r#   #_ValidateRewardParameters_to_vertexr  	  s'   
 !)	+z".VX&[8*(EF	+)*+7	012I	
 
+	{#/	-yk*I	
 
+./0<	8567	
 
+123?	 !;89:	
 
r%   c           
         0 n[        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b  [        US/[        U S/5      5        [        U S/5      b<  [        US/[        U S/5      R                  5        VVs0 s H  u  pEXE_M	     snn5        U$ s  snnf )Nr4   r5   overallRewardoverall_rewardrw  rewardInfoDetailsreward_info_details)r   r   items)r   r   r   r"   kvs         r#   #_ValidateRewardResponse_from_vertexr  5	  s    
 !)	+)*+7'(${=N<O*P 
+()5%&[?:K(LM	+y!-WItK';<	++,-9	{-@,ABHHJKJ$!JK 
 	Ls   ,Cc           
          0 n[        U S/5      b$  [        US/[        [        U S/5      UU5      5        [        U S/5      b  [        US/[        U S/5      5        U$ )Nreplicated_voice_configreplicatedVoiceConfigprebuilt_voice_configprebuiltVoiceConfig)r   r   rE  r!   s       r#   rX  rX  P	  s    
 !)	+123?	 !(89:	
 
+/01=	[234 
r%   c                      \ rS rSrSS.S\S\\R                     S\R                  4S jjr	SS.S\\R                     S\R                  4S jjrSS.S\S\\R                     S\R                  4S	 jjrSSSS
.S\\   S\\R                      S\R"                  S\\R$                     S\R                  4
S jjrSSSS
.S\\   S\\R                      S\R"                  S\\R$                     S\R(                  4
S jjrSSSS.S\S\R,                  S\R.                  S\\R0                     S\\R2                     S\\R4                     S\R6                  4S jjrSS.S\S\\R                     S\R                  4S jjr\R>                  " S5      SS.S\S\R"                  S\\R$                     S\R                  4S jj5       r SS.S\\R                     S\!\R                     4S jjr"Sr#g)Tuningsik	  Nr   r+   r   r   c                :   [         R                  " UUS9nU R                  R                  (       a:  [	        USU5      nUR                  S5      nU(       a  SR                  U5      nO<SnO9[        USU5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       a  U S[        U5       3nUR                  SS5        SnUR                  b-  UR                  R                  b  UR                  R                  n[        R                  " U5      n[        R                  " U5      nU R                  R                  SXdU5      n	U	R                   (       d  0 O["        R$                  " U	R                   5      n
U R                  R                  (       a  ['        U
SU5      n
U R                  R                  (       d  [)        U
SU5      n
[         R*                  R-                  U
[/        USS5      (       aG  S[/        UR                  S	S5      [/        UR                  S
S5      [/        UR                  SS5      S.0O0 S9n[         R0                  " U	R2                  S9Ul        U R                  R7                  U5        U$ zfGets a TuningJob.

Args:
  name: The resource name of the tuning job.

Returns:
  A TuningJob object.
r+   r   Nr,   z{name}r   ?r   getr   r   include_all_fieldsr   r   r  responsekwargsheaders)r   _GetTuningJobParameters_api_clientvertexair   r  
format_mapr   r   popr   http_optionsr	   convert_to_dictencode_unserializable_typesrequestbodyjsonloadsr  rt  	TuningJob_from_responsegetattrHttpResponser  r5   _verify_responseselfr+   r   parameter_modelrequest_dictrequest_url_dictpathquery_paramsr  r  response_dictreturn_values               r#   _getTunings._getm	  sk    33O   6
4l &))&1	""#345
4l &))&1	""#34##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''t<PH&mmBHMM1JM  ,
m $$+
m ??11 ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! 2 L$ &+%7%7  &L" 	%%l3r%   c                   [         R                  " US9nU R                  R                  (       d  [	        S5      e[        US U5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       a  U S[        U5       3nUR                  SS 5        S nUR                  b-  UR                  R                  b  UR                  R                  n[        R                  " U5      n[        R                  " U5      nU R                  R                  SXSU5      nUR                   (       d  0 O["        R$                  " UR                   5      n	U R                  R                  (       a  ['        U	S U5      n	[         R(                  R+                  U	[-        USS 5      (       aG  S[-        UR                  S	S 5      [-        UR                  S
S 5      [-        UR                  SS 5      S.0O0 S9n
[         R.                  " UR0                  S9U
l        U R                  R5                  U
5        U
$ Nr  iThis method 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   _ListTuningJobsParametersr  r  r@   r  r  r  r   r  r   r  r	   r  r  r  r  r  r  r  ListTuningJobsResponser  r  r  r  r5   r  r  r   r  r  r  r  r  r  r  r  r  s              r#   _listTunings._list	  s    55O
 $$5 
 9
4l &))&1	&&'78##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''t<PH&mmBHMM1JM  9
m //>> ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! ? L$ &+%7%7  &L" 	%%l3r%   c                :   [         R                  " UUS9nU R                  R                  (       a:  [	        USU5      nUR                  S5      nU(       a  SR                  U5      nO<SnO9[        USU5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       a  U S[        U5       3nUR                  SS5        SnUR                  b-  UR                  R                  b  UR                  R                  n[        R                  " U5      n[        R                  " U5      nU R                  R                  SXdU5      n	U	R                   (       d  0 O["        R$                  " U	R                   5      n
U R                  R                  (       a  ['        U
SU5      n
U R                  R                  (       d  [)        U
SU5      n
[         R*                  R-                  U
[/        USS5      (       aG  S[/        UR                  S	S5      [/        UR                  S
S5      [/        UR                  SS5      S.0O0 S9n[         R0                  " U	R2                  S9Ul        U R                  R7                  U5        U$ )zDCancels a tuning job.

Args:
  name (str): TuningJob resource name.
r  Nr,   {name}:cancelr   r  r   postr   r   r  r  r  r  )r   _CancelTuningJobParametersr  r  r1   r  r  r.   r   r  r   r  r	   r  r  r  r  r  r  r9   r6   CancelTuningJobResponser  r  r  r  r5   r  r  s               r#   cancelTunings.cancel
  ss    66O   9
4l &))&1	))*:;8
4l &))&1	))*:;##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''LH 'mmBHMM1JM  :
m $$9
m 00?? ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! @ L$ &+%7%7  &L" 	%%l3r%   r   r   r   r   r   r   c                   [         R                  " UUUUS9nU R                  R                  (       d  [	        S5      e[        USU5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      n	U	(       a  U S[        U	5       3nUR                  SS5        Sn
UR                  b-  UR                  R                  b  UR                  R                  n
[        R                  " U5      n[        R                  " U5      nU R                  R                  S	XU
5      nUR                   (       d  0 O["        R$                  " UR                   5      nU R                  R                  (       a  ['        USU5      n[         R(                  R+                  U[-        USS5      (       aG  S[-        UR                  S
S5      [-        UR                  SS5      [-        UR                  SS5      S.0O0 S9n[         R.                  " UR0                  S9Ul        U R                  R5                  U5        U$ zCreates a tuning job and returns the TuningJob object.

Args:
  base_model: The name of the model to tune.
  training_dataset: The training dataset to use.
  config: The configuration to use for the tuning job.

Returns:
  A TuningJob object.
r   r   r   r   r  Nr,   r
  r   r  r   r  r   r   r  r  r  r  )r   !_CreateTuningJobParametersPrivater  r  r@   r   r  r  r   r  r   r  r	   r  r  r  r  r  r  r  r  r  r  r  r  r5   r  r  r   r   r   r   r  r  r  r  r  r  r  r  r  s                 r#   _tuneTunings._tunep
  s,   & ==')	O $$5 
 A
4l &))&1	&&'78##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''LH 'mmBHMM1JM  ,
m ??11 ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! 2 L$ &+%7%7  &L" 	%%l3r%   c                   [         R                  " UUUUS9nU R                  R                  (       a  [	        S5      e[        USU5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      n	U	(       a  U S[        U	5       3nUR                  SS5        Sn
UR                  b-  UR                  R                  b  UR                  R                  n
[        R                  " U5      n[        R                  " U5      nU R                  R                  S	XU
5      nUR                   (       d  0 O["        R$                  " UR                   5      nU R                  R                  (       d  ['        USU5      n[         R(                  R+                  U[-        USS5      (       aG  S[-        UR                  S
S5      [-        UR                  SS5      [-        UR                  SS5      S.0O0 S9n[         R.                  " UR0                  S9Ul        U R                  R5                  U5        U$ zCreates a tuning job and returns the TuningJob object.

Args:
  base_model: The name of the model to tune.
  training_dataset: The training dataset to use.
  config: The configuration to use for the tuning job.

Returns:
  A TuningJob operation.
r  ziThis method is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.Nr,   tunedModelsr   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  TuningOperationr  r  r  r  r5   r  r  s                 r#   _tune_mldevTunings._tune_mldev
  s.   & ==')	O   4 
 @
4l &))&1	''(89##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''LH 'mmBHMM1JM$$1
m ((77 ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! 8 L$ &+%7%7  &L" 	%%l3r%   r<  ru   r   r  r  r  r<  ru   c                   [         R                  " UUUUUUS9nU R                  R                  (       d  [	        S5      e[        USU5      nUR                  S5      n	U	(       a  SR                  U	5      n
OSn
UR                  S5      nU(       a  U
 S[        U5       3n
UR                  SS5        SnUR                  b-  UR                  R                  b  UR                  R                  n[        R                  " U5      n[        R                  " U5      nU R                  R                  S	XU5      nUR                   (       d  0 O["        R$                  " UR                   5      nU R                  R                  (       a  ['        USU5      n[         R(                  R+                  U[-        USS5      (       aG  S[-        UR                  S
S5      [-        UR                  SS5      [-        UR                  SS5      S.0O0 S9n[         R.                  " UR0                  S9Ul        U R                  R5                  U5        U$ a  Validates a reinforcement tuning reward configuration.

Allows users to validate a reinforcement tuning reward configuration
against a sample response and example before creating a reinforcement
tuning job, so that they can iterate on the reward configuration without
having to create a tuning job each time.

Args:
  parent: The resource name of the Location to validate the reward in, e.g.
    `projects/{project}/locations/{location}`.
  sample_response: The sample response for validating the reward
    configuration.
  example: The example to validate the reward configuration.
  single_reward_config: Single reward function configuration for
    reinforcement tuning. Mutually exclusive with composite_reward_config.
  composite_reward_config: Composite reward function configuration for
    reinforcement tuning. Mutually exclusive with single_reward_config.
  config: Optional parameters for the request.

Returns:
  A ValidateRewardResponse with the computed reward(s).
)r  r  r  r<  ru   r   r  Nr,   z5{parent}/tuningJobs:validateReinforcementTuningRewardr   r  r   r  r   r   r  r  r  r  )r   _ValidateRewardParametersr  r  r@   r  r  r  r   r  r   r  r	   r  r  r  r  r  r  r  ValidateRewardResponser  r  r  r  r5   r  r  r  r  r  r<  ru   r   r  r  r  r  r  r  r  r  r  s                   r#   validate_rewardTunings.validate_reward*  s<   J 55'1 7O $$5 
 9
4l &))&1	CNN  	 G##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL''LH 'mmBHMM1JM  9
m //>> ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! ? L$ &+%7%7  &L" 	%%l3r%   c                   U R                  XS9nUR                  (       ad  U R                  R                  (       aI  U R                  R                  b2  [
        R                  UR                  U R                  R                  S9  U$ Nr  )r  projectr  r  r  r  r  _IpythonUtilsdisplay_experiment_buttonr  r+   r   jobs       r#   r  Tunings.get  sl     )))
-C%%$$0--^^""** .  Jr%   SThe SDK's tuning implementation is experimental, and may change in future versions.c                D   U R                   R                  (       Ga  UR                  S5      (       a=  S nU(       a  [        USS 5      n[        R
                  " XS9nU R                  UUUS9nGOS nUGb  [        USS 5      Gb  [        US5      n[        U[        5      (       a  [        R                  " S0 UD6nUR                  (       a  UR                  (       d  [        S5      e[        [        UR                  5      5       H`  n	[        UR                  U	   [        5      (       d  M'  [        R                  R!                  UR                  U	   5      UR                  U	'   Mb     [        U[        5      (       a  XS'   OXl        UnU R                  UUUS9nUb  [        USS 5      b  Xvl        OU R%                  UUUS9n
U
R&                  b   SU
R&                  ;   a  U
R&                  S   nO6U
R(                  c  [        S	5      eU
R(                  R+                  S
5      S   n[        R,                  " U[        R.                  R0                  S9nUR(                  (       a8  U R                   R                  (       a  [2        R5                  UR(                  S9  U$ Nz	projects/re   )tuned_model_namecheckpoint_id)r   r   r   rm   zEEvaluation config must have at least one metric and an output config.)r   r   r   rx  zOperation name is required.z/operations/r   )r+   rh  )tuning_job_resource r  r  
startswithr  r   PreTunedModelr  
isinstancedictEvaluationConfigr   r   r@   rangelenMetricmodel_validaterm   r  r  r+   	partitionr  JobStateJOB_STATE_QUEUEDr  display_model_tuning_button)r  r   r   r   r
  r   
tuning_jobvalidated_evaluation_configrm   i	operationr	  s               r#   tuneTunings.tune  sx       			{	+	+!&*I4P---'
 ZZ+-   

 IM# 3T:F%f.AB
)400 % 6 6 K9J K#++&44  .6678a+33A6==-2\\-H-H#++A..''* 9
 %%*;&''8$(9
%ZZ!-   

  3T:F)D
&""+ # i
 
			'LI<N<N,N$--l;>>!89
9$>>33NCAF??//j 4++44//(oo 0  r%   c                P    U R                   n[        SUU R                  US9U5      $ )a]  Lists `TuningJob` objects.

Args:
  config: The configuration for the list request.

Returns:
  A Pager object that contains one page of tuning jobs. When iterating over
  the pager, it automatically fetches the next page if there are more.

Usage:

.. code-block:: python
    for tuning_job in client.tunings.list():
        print(tuning_job.name)
r  r  )r  r   r  r   list_requests      r#   listTunings.list  s1    & ::L

&
!	 r%   r  )$__name__
__module____qualname____firstlineno__strr   r   GetTuningJobConfigOrDictr  r  ListTuningJobsConfigOrDictr  r  CancelTuningJobConfigOrDictr  r  PreTunedModelOrDictTuningDatasetOrDictCreateTuningJobConfigOrDictr  r  r  ContentOrDict ReinforcementTuningExampleOrDict+SingleReinforcementTuningRewardConfigOrDict.CompositeReinforcementTuningRewardConfigOrDictValidateRewardConfigOrDictr  r  r  r	   experimental_warningr  r   r$  __static_attributes__r  r%   r#   r  r  k	  s    :>	\ \ u556	\
 \~ EIF @ @AF##FX =A	[ [ u889	[
 $$[@ #'=A<@[ 3-[   9 9:	[
 11[ u889[ [@ #'=A<@[ 3-[   9 9:	[
 11[ u889[ [J  ;?s s **	s
 55s %

;
;s  (

>
> s u778s ##sr :>	  u556	
 $ + =AM M 11	M
 u889M M	M` EI @ @AU__ r%   r  c                      \ rS rSrSS.S\S\\R                     S\R                  4S jjr	SS.S\\R                     S\R                  4S jjrSS.S\S\\R                     S\R                  4S	 jjrSSSS
.S\\   S\\R                      S\R"                  S\\R$                     S\R                  4
S jjrSSSS
.S\\   S\\R                      S\R"                  S\\R$                     S\R(                  4
S jjrSSSS.S\S\R,                  S\R.                  S\\R0                     S\\R2                     S\\R4                     S\R6                  4S jjrSS.S\S\\R                     S\R                  4S jjr\R>                  " S5      SS.S\S\R"                  S\\R$                     S\R                  4S jj5       r SS.S\\R                     S\!\R                     4S jjr"Sr#g)AsyncTuningsi   Nr  r+   r   r   c                X  #    [         R                  " UUS9nU R                  R                  (       a:  [	        USU5      nUR                  S5      nU(       a  SR                  U5      nO<SnO9[        USU5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       a  U S[        U5       3nUR                  SS5        SnUR                  b-  UR                  R                  b  UR                  R                  n[        R                  " U5      n[        R                  " U5      nU R                  R                  SXdU5      I Sh  vN n	U	R                   (       d  0 O["        R$                  " U	R                   5      n
U R                  R                  (       a  ['        U
SU5      n
U R                  R                  (       d  [)        U
SU5      n
[         R*                  R-                  U
[/        USS5      (       aG  S[/        UR                  S	S5      [/        UR                  S
S5      [/        UR                  SS5      S.0O0 S9n[         R0                  " U	R2                  S9Ul        U R                  R7                  U5        U$  GN?7fr  )r   r  r  r  r   r  r  r   r   r  r   r  r	   r  r  async_requestr  r  r  r  rt  r  r  r  r  r  r5   r  r  s               r#   r  AsyncTunings._get"  s~     33O   6
4l &))&1	""#345
4l &))&1	""#34##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33t< H 'mmBHMM1JM  ,
m $$+
m ??11 ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! 2 L$ &+%7%7  &L" 	%%l3M   E&J*(J')D?J*c                  #    [         R                  " US9nU R                  R                  (       d  [	        S5      e[        US U5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       a  U S[        U5       3nUR                  SS 5        S nUR                  b-  UR                  R                  b  UR                  R                  n[        R                  " U5      n[        R                  " U5      nU R                  R                  SXSU5      I S h  vN nUR                   (       d  0 O["        R$                  " UR                   5      n	U R                  R                  (       a  ['        U	S U5      n	[         R(                  R+                  U	[-        USS 5      (       aG  S[-        UR                  S	S 5      [-        UR                  S
S 5      [-        UR                  SS 5      S.0O0 S9n
[         R.                  " UR0                  S9U
l        U R                  R5                  U
5        U
$  GN7f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  r5   r  r  s              r#   r  AsyncTunings._list  s2     55O
 $$5 
 9
4l &))&1	&&'78##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33t< H 'mmBHMM1JM  9
m //>> ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! ? L$ &+%7%7  &L" 	%%l3Cs   D6I8I9DIc                X  #    [         R                  " UUS9nU R                  R                  (       a:  [	        USU5      nUR                  S5      nU(       a  SR                  U5      nO<SnO9[        USU5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      nU(       a  U S[        U5       3nUR                  SS5        SnUR                  b-  UR                  R                  b  UR                  R                  n[        R                  " U5      n[        R                  " U5      nU R                  R                  SXdU5      I Sh  vN n	U	R                   (       d  0 O["        R$                  " U	R                   5      n
U R                  R                  (       a  ['        U
SU5      n
U R                  R                  (       d  [)        U
SU5      n
[         R*                  R-                  U
[/        USS5      (       aG  S[/        UR                  S	S5      [/        UR                  S
S5      [/        UR                  SS5      S.0O0 S9n[         R0                  " U	R2                  S9Ul        U R                  R7                  U5        U$  GN?7f)zUCancels a tuning job asynchronously.

Args:
  name (str): A TuningJob resource name.
r  Nr,   r  r   r  r   r  r   r   r  r  r  r  )r   r  r  r  r1   r  r  r.   r   r  r   r  r	   r  r  r;  r  r  r  r9   r6   r  r  r  r  r  r5   r  r  s               r#   r  AsyncTunings.cancel  s     66O   9
4l &))&1	))*:;8
4l &))&1	))*:;##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33L H 'mmBHMM1JM  :
m $$9
m 00?? ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! @ L$ &+%7%7  &L" 	%%l3Mr=  r  r   r   r   c                  #    [         R                  " UUUUS9nU R                  R                  (       d  [	        S5      e[        USU5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      n	U	(       a  U S[        U	5       3nUR                  SS5        Sn
UR                  b-  UR                  R                  b  UR                  R                  n
[        R                  " U5      n[        R                  " U5      nU R                  R                  S	XU
5      I Sh  vN nUR                   (       d  0 O["        R$                  " UR                   5      nU R                  R                  (       a  ['        USU5      n[         R(                  R+                  U[-        USS5      (       aG  S[-        UR                  S
S5      [-        UR                  SS5      [-        UR                  SS5      S.0O0 S9n[         R.                  " UR0                  S9Ul        U R                  R5                  U5        U$  GN7f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  r5   r  r  s                 r#   r  AsyncTunings._tune)  s:    & ==')	O $$5 
 A
4l &))&1	&&'78##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33L H 'mmBHMM1JM  ,
m ??11 ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! 2 L$ &+%7%7  &L" 	%%l3C   D9I;I<DIc                  #    [         R                  " UUUUS9nU R                  R                  (       a  [	        S5      e[        USU5      nUR                  S5      nU(       a  SR                  U5      nOSnUR                  S5      n	U	(       a  U S[        U	5       3nUR                  SS5        Sn
UR                  b-  UR                  R                  b  UR                  R                  n
[        R                  " U5      n[        R                  " U5      nU R                  R                  S	XU
5      I Sh  vN nUR                   (       d  0 O["        R$                  " UR                   5      nU R                  R                  (       d  ['        USU5      n[         R(                  R+                  U[-        USS5      (       aG  S[-        UR                  S
S5      [-        UR                  SS5      [-        UR                  SS5      S.0O0 S9n[         R.                  " UR0                  S9Ul        U R                  R5                  U5        U$  GN7f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  r5   r  r  s                 r#   r  AsyncTunings._tune_mldev  s<    & ==')	O   4 
 @
4l &))&1	''(89##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33L H 'mmBHMM1JM$$1
m ((77 ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! 8 L$ &+%7%7  &L" 	%%l3CrD  r  r  r  r  r<  ru   c                  #    [         R                  " UUUUUUS9nU R                  R                  (       d  [	        S5      e[        USU5      nUR                  S5      n	U	(       a  SR                  U	5      n
OSn
UR                  S5      nU(       a  U
 S[        U5       3n
UR                  SS5        SnUR                  b-  UR                  R                  b  UR                  R                  n[        R                  " U5      n[        R                  " U5      nU R                  R                  S	XU5      I Sh  vN nUR                   (       d  0 O["        R$                  " UR                   5      nU R                  R                  (       a  ['        USU5      n[         R(                  R+                  U[-        USS5      (       aG  S[-        UR                  S
S5      [-        UR                  SS5      [-        UR                  SS5      S.0O0 S9n[         R.                  " UR0                  S9Ul        U R                  R5                  U5        U$  GN7f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  r5   r  r  s                   r#   r  AsyncTunings.validate_reward  sJ    J 55'1 7O $$5 
 9
4l &))&1	CNN  	 G##H-LvQy./0dXt$04L*""//;$++88l**<8L66|DL%%33L H 'mmBHMM1JM  9
m //>> ?Hd33 #*#**,=t$ )0#**,BD) '.#**,@$'

 ! ? L$ &+%7%7  &L" 	%%l3Cs   D;I=I>DIc                *  #    U R                  XS9I S h  vN nUR                  (       ad  U R                  R                  (       aI  U R                  R                  b2  [
        R                  UR                  U R                  R                  S9  U$  N{7fr  r   r  s       r#   r  AsyncTunings.getX  sw      		t	3
3C%%$$0--^^""** .  J 4s   BBA<Br  c                T  #    U R                   R                  (       Ga  UR                  S5      (       aE  S nU(       a  [        USS 5      n[        R
                  " XS9nU R                  UUUS9I S h  vN nGOUGb  [        USS 5      Gb  [        US5      n[        U[        5      (       a  [        R                  " S0 UD6nUR                  (       a  UR                  (       d  [        S5      e[        [        UR                  5      5       H`  n[        UR                  U   [        5      (       d  M'  [        R                  R!                  UR                  U   5      UR                  U'   Mb     [        U[        5      (       a  XsS'   OXsl        U R                  UUUS9I S h  vN nOU R%                  UUUS9I S h  vN n	U	R&                  b   SU	R&                  ;   a  U	R&                  S   n
O6U	R(                  c  [        S	5      eU	R(                  R+                  S
5      S   n
[        R,                  " U
[        R.                  R0                  S9nUR(                  (       a8  U R                   R                  (       a  [2        R5                  UR(                  S9  U$  GN. N N7fr  r  )r  r   r   r   r
  r   r  rm   r  r  r	  s              r#   r  AsyncTunings.tunej  so        			{	+	+!&*I4P---'
  ::+- & 
 

  3T:F%f.AB
)400 % 6 6 K9J K#++&44  .6678a+33A6==-2\\-H-H#++A..''* 9
 %%*;&''8$::!- & 
 

 ((+ )  i
 
			'LI<N<N,N$--l;>>!89
9$>>33NCAF??//j 4++44//(oo 0  o
<
s?   A1J(3J!4B>J(6A1J('J$(J(J&C J($J(&J(c                l   #    U R                   n[        SUU R                  US9I Sh  vN U5      $  N	7f)a|  Lists `TuningJob` objects asynchronously.

Args:
  config: The configuration for the list request.

Returns:
  A Pager object that contains one page of tuning jobs. When iterating over
  the pager, it automatically fetches the next page if there are more.

Usage:

.. code-block:: python
    async for tuning_job in await client.aio.tunings.list():
        print(tuning_job.name)
r  r  N)r  r   r"  s      r#   r$  AsyncTunings.list  s<     & ::Ljjj''	  	(s   &42
4r  )$r&  r'  r(  r)  r*  r   r   r+  r  r  r,  r  r  r-  r  r  r.  r/  r0  r  r  r  r1  r2  r3  r4  r5  r  r  r  r	   r6  r  r   r$  r7  r  r%   r#   r9  r9     s    :>	^ ^ u556	^
 ^B EIH @ @AH##H\ =A	[ [ u889	[
 $$[@ #'=A<@[ 3-[   9 9:	[
 11[ u889[ [@ #'=A<@[ 3-[   9 9:	[
 11[ u889[ [J  ;?s s **	s
 55s %

;
;s  (

>
> s u778s ##sr :>	  u556	
 $ + =AG G 11	G
 u889G G	GT EI @ @A%//" r%   r9  c            
          \ rS rSr% Sr\" 5       r\\   \S'   \	S\
\\4   4S j5       r\	S\4S j5       r\	S\4S j5       r\	S\S	\\   S\4S
 j5       r\	 SS\S\S\\   SS4S jj5       r\	S\S\SS4S j5       r\	S\SS4S j5       rSrg)r  i  z6Temporary class to hold the IPython related functions.displayed_experimentsr   c                  n    SS K n SU R                  ;   a!  SSKJn  U" 5       R                  R
                  $ g)Nr   IPython)get_ipython )sysmodulesrR  rS  	__class__r&  )rU  rS  s     r#   _get_ipython_shell_name%_IpythonUtils._get_ipython_shell_name  s+    CKK%]$$---r%   c                  <    [        [        R                  5       5      $ )N)boolr  rX  r  r%   r#   is_ipython_available"_IpythonUtils.is_ipython_available  s    55788r%   c                      g)z8Returns the HTML style markup to support custom buttons.a  
    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
    <style>
      .view-vertex-resource,
      .view-vertex-resource:hover,
      .view-vertex-resource:visited {
        position: relative;
        display: inline-flex;
        flex-direction: row;
        height: 32px;
        padding: 0 12px;
          margin: 4px 18px;
        gap: 4px;
        border-radius: 4px;

        align-items: center;
        justify-content: center;
        background-color: rgb(255, 255, 255);
        color: rgb(51, 103, 214);

        font-family: Roboto,"Helvetica Neue",sans-serif;
        font-size: 13px;
        font-weight: 500;
        text-transform: uppercase;
        text-decoration: none !important;

        transition: box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1) 0s;
        box-shadow: 0px 3px 1px -2px rgba(0,0,0,0.2), 0px 2px 2px 0px rgba(0,0,0,0.14), 0px 1px 5px 0px rgba(0,0,0,0.12);
      }
      .view-vertex-resource:active {
        box-shadow: 0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12);
      }
      .view-vertex-resource:active .view-vertex-ripple::before {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 4px;
        pointer-events: none;

        content: '';
        background-color: rgb(51, 103, 214);
        opacity: 0.12;
      }
      .view-vertex-icon {
        font-size: 18px;
      }
    </style>
  r  r  r%   r#   _get_styles_IpythonUtils._get_styles  s    1r%   markerresource_partsc                     [        [        U5      5       H(  nX   U :X  d  M  US-   [        U5      :  d  M!  XS-      s  $    g)z,Returns the part after the marker text part.r   rT  )r  r  )ra  rb  r  s      r#   _parse_resource_name"_IpythonUtils._parse_resource_name  sE     3~&'		f	$Q^1D)D!e$$ ( r%   r   urliconNc                 ,   SnUR                  U5      (       d  [        SU S35      eSSKnS[        UR	                  5       5       3nS[
        R                  5        SU S	U S
U SU  S3nUSU SU SU S3-  nSSKJn  SSKJ	n  U" U" U5      5        g)a(  Creates and displays the link to open the Gemini Enterprise Agent Platform resource.

Args:
  text: The text displayed on the clickable button.
  url: The url that the button will lead to. Only cloud console URIs are
    allowed.
  icon: The icon name on the button (from material-icons library)
z https://console.cloud.google.comzOnly urls starting with z are allowed.r   Nzview-vertex-resource-z	
        z-
        <a class="view-vertex-resource" id="z" href="#view-z;">
          <span class="material-icons view-vertex-icon">z</span>
          <span>z</span>
        </a>
        z]
        <script>
          (function () {
            const link = document.getElementById('z');
            link.addEventListener('click', (e) => {
              if (window.google?.colab?.openUrl) {
                window.google.colab.openUrl('z8');
              } else {
                window.open('z', '_blank');
              }
              e.stopPropagation();
              e.preventDefault();
            });
          })();
        </script>
    )display)HTML)
r  r@   uuidr*  uuid4r  r_  IPython.displayri  rj  )	r   rf  rg  CLOUD_UI_URLrk  	button_idhtmlri  rj  s	            r#   _display_link_IpythonUtils._display_link$  s     6L>>,''1,}MNN'DJJL(9':;I			"	"	$% &--6K~i[ Q99= ? 		D 	 3 4=+ >. /2U 3!U # D" ($DJr%   r  r  c                 $   [         R                  5       (       a  U [         R                  ;   a  gU R                  S5      nUS   nUS   nSU SU S3-   SU 3-   n[         R	                  SUS	5        [         R                  R                  U 5        g)
aD  Function to generate a link bound to the Gemini Enterprise Agent Platform experiment.

Args:
  experiment: The Gemini Enterprise Agent Platform experiment name. Example
    format:
      projects/{project_id}/locations/{location}/metadataStores/default/contexts/{experiment_name}
  project: The project (alphanumeric) name.
N/   zAhttps://console.cloud.google.com/vertex-ai/experiments/locations/z/experiments/zruns?project=zView Experimentscience)r  r\  rP  splitrq  add)r  r  rb  locationexperiment_nameuris         r#   r  '_IpythonUtils.display_experiment_buttonX  s     ..00<<<  %%c*Na H$R(O 	LJmO#4A
6	7'
#	$ 
  13	B ''++J7r%   r  c                     [         R                  5       (       d  gU R                  S5      nUS   nUS   nUS   nSSU SU 3-   S	U 3-   n[         R                  S
US5        g)a  Function to generate a link bound to the Gemini Enterprise Agent Platform model tuning job.

Args:
  tuning_job_resource: The Gemini Enterprise Agent Platform tuning job name.
    Example format:
    projects/{project_id}/locations/{location}/tuningJobs/{tuning_job_id}
Nrt  r   ru  rv  z?https://console.cloud.google.com/vertex-ai/generative/language/z
locations/z/tuning/tuningJob/z	?project=zView Tuning Jobr  )r  r\  rx  rq  )r  rb  r  rz  tuning_job_idr|  s         r#   r  )_IpythonUtils.display_model_tuning_buttonw  s     --//(..s3NQGa H"2&M 	Jxj 2=/
B	CgY
	  
  13?r%   r  )open_in_new)r&  r'  r(  r)  __doc__setrP  r*  __annotations__staticmethodr   r   rX  r[  r\  r_  r$  rd  r   rq  r  r  r7  r  r%   r#   r  r    s&   >$'ES)5c?   9 9 9 3s 3 3j 3 S	 c   1>111!)#11 1f 8C 8# 8$ 8 8< @s @t @ @r%   r  )NN)Pr  loggingtypingr   r   r   urllib.parser   rT  r   r	   r
   r   r   r   r   r   r   pagersr   r   	getLoggerloggerr  r*  objectr$   r(   r.   r1   r6   r9   rA   rG   rJ   rP   rS   rX   r}   r   r   r   r   r   r   r   r   r   r    r'   r   r   r  r  r  r  rW   r2  r4  r:  r=  rE  rF   rI   r  r   ra  r   r   rt  r  r  r   r  r  rX  
BaseModuler  r9  r  r  r%   r#   <module>r     s[  $   ' ' "      . . %			1	2
 /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(^	. /3;?tCH~v-.DcN+ %S#X 678 
#s(^	. /3;?tCH~v-.DcN+ %S#X 678 
#s(^	. /3;?tCH~v-.DcN+ %S#X 678 
#s(^	. /3;?tCH~v-.DcN+ %S#X 678 
#s(^	0 /3;?ttCH~v-.tDcN+t %S#X 678t 
#s(^	tr /3;?DtCH~v-.DDcN+D %S#X 678D 
#s(^	DR /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(^	6 /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(^	?H /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;?tCH~v-.DcN+ %S#X 678 
#s(^	. /3;?jtCH~v-.jDcN+j %S#X 678j 
#s(^	j^ /3;?vtCH~v-.vDcN+v %S#X 678v 
#s(^	vv /3;?	tCH~v-.	DcN+	 %S#X 678	 
#s(^		 /3;?	tCH~v-.	DcN+	 %S#X 678	 
#s(^		 /3;?tCH~v-.DcN+ %S#X 678 
#s(^	6 /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;?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;?)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(^	B /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(^	B /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(^	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;?MtCH~v-.MDcN+M %S#X 678M 
#s(^	Md /3;?8tCH~v-.8DcN+8 %S#X 6788 
#s(^	8z /3;?rtCH~v-.rDcN+r %S#X 678r 
#s(^	rn /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(^	* /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(^	6r
k$$ r
jp
;)) p
fz@ z@r%   