
    +jn                       d dl Z d dlZd dlmZmZmZ d dlmZ ddlm	Z	 ddlm
Z
 ddlmZ ddlmZ dd	lmZ dd
lmZ ddl
mZ ddl
mZ ddl
mZ ddlmZmZ  ej        d          Z	 dLdeeeef         ef         deeeef                  deeef         fdZ	 dLdeeeef         ef         deeeef                  deeef         fdZ 	 dLdeeeef         ef         deeeef                  deeef         fdZ!	 dLdeeeef         ef         deeeef                  deeef         fdZ"	 dLdeeeef         ef         deeeef                  deeef         fdZ#	 dLdedeeeef         ef         deeeef                  deeef         fdZ$	 dLdeeeef         ef         deeeef                  deeef         fdZ%	 dLdeeeef         ef         deeeef                  deeef         fdZ&	 dLdeeeef         ef         deeeef                  deeef         fdZ'	 dLdeeeef         ef         deeeef                  deeef         fdZ(	 dLdedeeeef         ef         deeeef                  deeef         fdZ)	 dLdedeeeef         ef         deeeef                  deeef         fdZ*	 dLdeeeef         ef         deeeef                  deeef         fd Z+	 dLdeeeef         ef         deeeef                  deeef         fd!Z,	 dLdeeeef         ef         deeeef                  deeef         fd"Z-	 dLdeeeef         ef         deeeef                  deeef         fd#Z.	 dLdeeeef         ef         deeeef                  deeef         fd$Z/	 dLdedeeeef         ef         deeeef                  deeef         fd%Z0	 dLdedeeeef         ef         deeeef                  deeef         fd&Z1	 dLdeeeef         ef         deeeef                  deeef         fd'Z2	 dLdedeeeef         ef         deeeef                  deeef         fd(Z3	 dLdedeeeef         ef         deeeef                  deeef         fd)Z4	 dLdedeeeef         ef         deeeef                  deeef         fd*Z5	 dLdeeeef         ef         deeeef                  deeef         fd+Z6	 dLdeeeef         ef         deeeef                  deeef         fd,Z7	 dLdedeeeef         ef         deeeef                  deeef         fd-Z8	 dLdeeeef         ef         deeeef                  deeef         fd.Z9	 dLdedeeeef         ef         deeeef                  deeef         fd/Z:	 dLdeeeef         ef         deeeef                  deeef         fd0Z;	 dLdeeeef         ef         deeeef                  deeef         fd1Z<	 dLdeeeef         ef         deeeef                  deeef         fd2Z=	 dLdedeeeef         ef         deeeef                  deeef         fd3Z>	 dLdeeeef         ef         deeeef                  deeef         fd4Z?	 dLdedeeeef         ef         deeeef                  deeef         fd5Z@	 dLdedeeeef         ef         deeeef                  deeef         fd6ZA	 dLdeeeef         ef         deeeef                  deeef         fd7ZB	 dLdeeeef         ef         deeeef                  deeef         fd8ZC	 dLdeeeef         ef         deeeef                  deeef         fd9ZD	 dLdedeeeef         ef         deeeef                  deeef         fd:ZE	 dLdeeeef         ef         deeeef                  deeef         fd;ZF	 dLdeeeef         ef         deeeef                  deeef         fd<ZG	 dLdeeeef         ef         deeeef                  deeef         fd=ZH	 dLdeeeef         ef         deeeef                  deeef         fd>ZI	 dLdeeeef         ef         deeeef                  deeef         fd?ZJ	 dLdeeeef         ef         deeeef                  deeef         fd@ZK	 dLdeeeef         ef         deeeef                  deeef         fdAZL	 dLdeeeef         ef         deeeef                  deeef         fdBZM	 dLdeeeef         ef         deeeef                  deeef         fdCZN	 dLdeeeef         ef         deeeef                  deeef         fdDZO	 dLdeeeef         ef         deeeef                  deeef         fdEZP	 dLdeeeef         ef         deeeef                  deeef         fdFZQ	 dLdeeeef         ef         deeeef                  deeef         fdGZR G dH dIe	jS                  ZT G dJ dKe	jS                  ZUdS )M    N)AnyOptionalUnion)	urlencode   )_api_module)_common)_extra_utils)_transformers)types)BaseApiClient)get_value_by_path)move_value_by_path)set_value_by_path)
AsyncPagerPagerzgoogle_genai.batchesfrom_objectparent_objectreturnc                    i }t          | dg          !t          |dgt          | dg                     t          | dg          t          d          t          | dg          t          d          t          | dg          t          d          t          | d	g          t          d
          t          | dg          t          d          t          | dg          t          d          |S )Napi_keyapiKeyapi_key_configzvapi_key_config parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.	auth_typezqauth_type parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.google_service_account_configzgoogle_service_account_config parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.http_basic_auth_configz~http_basic_auth_config parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.oauth_configztoauth_config parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.oidc_configzsoidc_config parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.getvsetv
ValueErrorr   r   	to_objects      X/home/wildlama/visual-decline/.venv/lib/python3.11/site-packages/google/genai/batches.py_AuthConfig_to_mldevr&   %   sL    !)	+	{##/XJ[9+ > >???	+()**6
	<  
 
+}%%1
	<  
 
+7899E
	M  
 
+0122>
	M  
 
+'((4
	<  
 
+''3
	<  
 
    c           
      n   i t          | dg          !t          dgt          | dg                     t          | ddg          .t          dgfdt          | ddg          D                        t          | ddg          	 ,t          dgd t          | ddg          D                        S )	NresponsesFile	file_nameinlinedResponsesinlined_responsesc                 0    g | ]}t          |          S  )_InlinedResponse_from_mldev.0itemr$   s     r%   
<listcomp>z3_BatchJobDestination_from_mldev.<locals>.<listcomp>a   s3     	
 	
 	
 (i88	
 	
 	
r'   inlinedEmbedContentResponsesinlined_embed_content_responsesc                     g | ]}|S r.   r.   r1   r2   s     r%   r3   z3_BatchJobDestination_from_mldev.<locals>.<listcomp>p   s(     	
 	
 	
 	
 	
 	
r'   r    r!   r#   s     @r%   _BatchJobDestination_from_mldevr9   T   s!    !)	+())5[M4o5F#G#GHHH	+*,>?@@L		
 	
 	
 	
02DE 	
 	
 	
	 	 	 ;79KLMM 		*+	
 	
/1CD 	
 	
 	

 
 
 
r'   c           
         i }t          | dg          !t          |dgt          | dg                     t          | ddg          "t          |dgt          | ddg                     t          | ddg          "t          |dgt          | ddg                     t          | d	g          /t          |d
gt          t          | d	g          |                     |S )NpredictionsFormatformatgcsDestinationoutputUriPrefixgcs_uribigqueryDestination	outputUribigquery_uri"vertexMultimodalDatasetDestinationvertex_dataset)r    r!   /_VertexMultimodalDatasetDestination_from_vertexr#   s      r%    _BatchJobDestination_from_vertexrF   |   s#    !)	++,--9XJ[3F2G H HIII	+(*;<==I	[+->?@@   
+-{;<<H	[0+>??   
+<=>>J	7CDEEy	
 	
   
r'   c           
      z   i }t          | dg          !t          |dgt          | dg                     t          | dg          "t          |ddgt          | dg                     t          | dg          "t          |ddgt          | dg                     t          | d	g          t          d
          t          | dg          t          d          t          | dg          t          d          t          | dg          /t          |dgt          t          | dg          |                     |S )Nr<   r;   r?   r=   r>   rB   r@   rA   r*   qfile_name parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.r,   zyinlined_responses parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.r5   zinlined_embed_content_responses parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.rD   rC   )r    r!   r"   -_VertexMultimodalDatasetDestination_to_vertexr#   s      r%   _BatchJobDestination_to_vertexrJ      s    !)	+z"".()4hZ+H+HIII	+	{##/	,-[9+&&   
+'((4	,[>*++   
+}%%1
	9  
 
++,--9
	?  
 
+9:;;G
	M  
 
+()**6	-.5/0119	
 	
   
r'   c           	         i }t          | dg          !t          |dgt          | dg                     t          | ddg          "t          |dgt          | ddg                     t          | ddg          "t          |dgt          | ddg                     t          | d	d
g          	 "t          |dgt          | d	d
g                     |S )NinstancesFormatr<   	gcsSourceurisr?   bigquerySourceinputUrirB   vertexMultimodalDatasetSourcedatasetNamevertex_dataset_namer8   r#   s      r%   _BatchJobSource_from_vertexrT      s    !)	+)*++7XJ[3D2E F FGGG	+V,--9YKkK3H!I!IJJJ	+(*566B	[+Z899   ;8-HII 		[:MJKK   
r'   
api_clientc           	          i t          |dg          t          d          t          |dg          t          d          t          |dg          t          d          t          |dg          !t          dgt          |dg                     t          |d	g          /t          d
d
g fdt          |d	g          D                        t          |dg          t          d          S )Nr<   znformat parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.r?   zogcs_uri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.rB   ztbigquery_uri parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.r*   fileNameinlined_requestsrequestsc                 2    g | ]}t          |          S r.   )_InlinedRequest_to_mldevr1   r2   rU   r$   s     r%   r3   z,_BatchJobSource_to_mldev.<locals>.<listcomp>  s5     	
 	
 	
 %ZyAA	
 	
 	
r'   rS   z{vertex_dataset_name parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.r    r"   r!   rU   r   r   r$   s   `  @r%   _BatchJobSource_to_mldevr_      s_   
 !)	+z"".
	3  
 
+	{##/
	<  
 
+'((4
	<  
 
+}%%1ZL${[M"B"BCCC	+*+,,8	Z 	
 	
 	
 	
 	
[+=*>??	
 	
 	
   
+-.//;
	B  
 
r'   c                     i }t          | dg          !t          |dgt          | dg                     t          | dg          "t          |ddgt          | dg                     t          | dg          "t          |ddgt          | dg                     t          | d	g          t          d
          t          | dg          t          d          t          | dg          "t          |ddgt          | dg                     |S )Nr<   rL   r?   rM   rN   rB   rO   rP   r*   rH   rX   zxinlined_requests parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.rS   rQ   rR   r   r#   s      r%   _BatchJobSource_to_vertexra     sV    !)	+z"".&'kH:)F)FGGG	+	{##/[&)4i[+I+IJJJ	+'((4	:&[>*++   
+}%%1
	9  
 
+*+,,8
	?  
 
+-.//;	(-8[0122   
r'   c                    i }t          | dg          !t          |dgt          | dg                     t          | ddg          "t          |dgt          | ddg                     t          | ddg          4t          |dgt          j        t          | ddg                               t          | ddg          "t          |dgt          | ddg                     t          | ddg          "t          |d	gt          | ddg                     t          | dd
g          "t          |dgt          | dd
g                     t          | ddg          "t          |dgt          | ddg                     t          | ddg          Bt          |dgt	          t          j        t          | ddg                    |                     |S )NnamemetadatadisplayNamedisplay_namestate
createTimecreate_timeendTimeend_time
updateTimeupdate_timemodeloutputdest)r    r!   tt_job_stater9   t_recv_batch_job_destinationr#   s      r%   _BatchJob_from_mldevrt   G  s-    !)	+x  ,VHd;99:::	+
M233?	[:}566   
+
G,--9			d;W(=>>??   
+
L122>	[:|455   
+
I.//;ZL${Z4K"L"LMMM	+
L122>	[:|455   
+
G,--9WItK*g1FGGHHH	+
H-..:	'*[:x"899  		
 	
	 	 	 
r'   c                    i }t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          3t          |dgt          j        t          | dg                               t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |d	gt          | dg                     t          | d
g          !t          |dgt          | d
g                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          /t          |dgt	          t          | dg          |                     t          | dg          At          |dgt          t          j        t          | dg                    |                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     |S )Nrc   re   rf   rg   errorrh   ri   	startTime
start_timerj   rk   rl   rm   rn   inputConfigsrcoutputConfigrp   completionStatscompletion_stats
outputInfooutput_info)r    r!   rq   rr   rT   rF   rs   r#   s      r%   _BatchJob_from_vertexr     s    !)	+x  ,VHd;99:::	+''3^$d;&H&HIII	+y!!-WIq}T+y-I-IJJKKK	+y!!-WItK';;<<<	+~&&2]OT+~%F%FGGG	+}%%1\ND{m$D$DEEE	+	{##/ZL${YK"@"@AAA	+~&&2]OT+~%F%FGGG	+y!!-WItK';;<<<	+''3	#}o..		
 	
   
+'((4	(*4n=M+N+NOO	
 	
   
+)*++7&'k<M;N)O)O   
+~&&2]OT+~%F%FGGG	r'   c                    i }t          | dg          !t          |dgt          | dg                     t          | dg          t          d          t          | dg          !t          |dgt          | dg                     |S )Ndatarf   tdisplay_name parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.	mime_typemimeTyper   r#   s      r%   _Blob_to_mldevr     s     !)	+x  ,VHd;99:::	+'((4
	<  
 
+}%%1ZL${[M"B"BCCC	r'   c                     i }t          |dg          5t          |ddgt          j        | t          |dg                               |S Nrc   _urlr    r!   rq   t_batch_job_namer^   s       r%   "_CancelBatchJobParameters_to_mldevr     \    
 !)	+x  ,		:tK&'B'BCC   
r'   c                     i }t          |dg          5t          |ddgt          j        | t          |dg                               |S r   r   r^   s       r%   #_CancelBatchJobParameters_to_vertexr     r   r'   c           
      "   i }t          | dg          !t          |dgt          | dg                     t          | dg          /t          |dgt          t          | dg          |                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |d	gt          | dg                     t          | d
g          !t          |dgt          | d
g                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          +t          |dgd t          | dg          D                        t          | dg          !t          |dgt          | dg                     |S )NcontentcitationMetadatacitation_metadata
tokenCounttoken_countfinishReasonfinish_reasongroundingMetadatagrounding_metadataavgLogprobsavg_logprobsindexlogprobsResultlogprobs_resultsafetyRatingssafety_ratingsc                     g | ]}|S r.   r.   r7   s     r%   r3   z)_Candidate_from_mldev.<locals>.<listcomp>  s    ???$???r'   urlContextMetadataurl_context_metadata)r    r!   _CitationMetadata_from_mldevr#   s      r%   _Candidate_from_mldevr     sh    !)	+	{##/YKkI;!?!?@@@	+*+,,8	$1233Y	
 	
   
+~&&2]OT+~%F%FGGG	+'((4_%tK.9I'J'JKKK	++,--9	[./00   
+''3^$d;&H&HIII	+y!!-WItK';;<<<	+()**6&'k<L;M)N)NOOO	+())5	??${_,=>>???   
+,-..:	 [/011   
r'   c           	          i }t          | dg          +t          |dgd t          | dg          D                        |S )NcitationSources	citationsc                     g | ]}|S r.   r.   r7   s     r%   r3   z0_CitationMetadata_from_mldev.<locals>.<listcomp>3  s    AAA$AAAr'   r8   r#   s      r%   r   r   *  s^     !)	+)*++7	AA${->,?@@AAA   
r'   c           	          i t          | dg          -t          dgfdt          | dg          D                        t          | dg          !t          dgt          | dg                     S )Npartsc                 0    g | ]}t          |          S r.   )_Part_to_mldevr0   s     r%   r3   z%_Content_to_mldev.<locals>.<listcomp>B  s3     	
 	
 	
 4++	
 	
 	
r'   roler8   r#   s     @r%   _Content_to_mldevr   9  s     !)	+y!!-			
 	
 	
 	
[7)44	
 	
 	
   
+x  ,VHd;99:::	r'   c                    i }t          | dg          "t          |ddgt          | dg                     t          | dg          t          d          t          | dg          "t          |ddgt          | dg                     |S )Nrf   batchre   rp   zldest parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.webhook_configwebhookConfigr   r#   s      r%   _CreateBatchJobConfig_to_mldevr   N  s     !)	+'((4	- [>*++   
+x  ,
	3  
 
+()**6	/"[+,--   
r'   c                 R   i }t          | dg          !t          |dgt          | dg                     t          | dg          At          |dgt          t          j        t          | dg                    |                     t          | dg          t          d          |S )Nrf   re   rp   r{   r   zvwebhook_config parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.)r    r!   rJ   rq   t_batch_job_destinationr"   r#   s      r%   _CreateBatchJobConfig_to_vertexr   k  s     !)	+'((4kN;K)L)LMMM	+x  ,	&%d;&A&ABBI	
 	
   
+()**6
	?  
 
r'   c                    i }t          |dg          5t          |ddgt          j        | t          |dg                               t          |dg          Dt          |ddgt	          | t          j        | t          |dg                    |                     t          |dg          t          t          |dg          |           |S Nrn   r   rz   r   ry   config)r    r!   rq   t_modelr_   t_batch_job_sourcer   r^   s       r%   "_CreateBatchJobParameters_to_mldevr     s    
 !)	+y!!-			*d;	::;;   
+w+	-   T+w-G-GHH	
 	
   
+z""."4hZ#@#@)LLL	r'   c                    i }t          |dg          4t          |dgt          j        | t          |dg                               t          |dg          Bt          |dgt	          t          j        | t          |dg                    |                     t          |dg          t          t          |dg          |           |S )Nrn   rz   ry   r   )r    r!   rq   r   ra   r   r   r^   s       r%   #_CreateBatchJobParameters_to_vertexr     s    
 !)	+y!!-				*d;	::;;   
+w+	! T+w-G-GHH	
 	
   
+z"".#Dxj$A$A9MMM	r'   c                 p    i }t          | dg          "t          |ddgt          | dg                     |S )Nrf   r   re   r8   r#   s      r%   (_CreateEmbeddingsBatchJobConfig_to_mldevr     sQ     !)	+'((4	- [>*++   
r'   c                 z   i }t          |dg          5t          |ddgt          j        | t          |dg                               t          |dg          1t          |ddgt	          | t          |dg          |                     t          |dg          t          t          |dg          |           |S r   )r    r!   rq   r   "_EmbeddingsBatchJobSource_to_mldevr   r^   s       r%   ,_CreateEmbeddingsBatchJobParameters_to_mldevr     s    
 !)	+y!!-			*d;	::;;   
+w+	- *[5'22I	
 	
   
+z"".,[8*%%y   
r'   c                     i }t          |dg          5t          |ddgt          j        | t          |dg                               |S r   r   r^   s       r%   "_DeleteBatchJobParameters_to_mldevr     r   r'   c                     i }t          |dg          5t          |ddgt          j        | t          |dg                               |S r   r   r^   s       r%   #_DeleteBatchJobParameters_to_vertexr     r   r'   c                    i }t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     |S NsdkHttpResponsesdk_http_responserc   donerv   r8   r#   s      r%   _DeleteResourceJob_from_mldevr          !)	+)*++7'(${=N<O*P*P   
+x  ,VHd;99:::	+x  ,VHd;99:::	+y!!-WItK';;<<<	r'   c                    i }t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     |S r   r8   r#   s      r%   _DeleteResourceJob_from_vertexr   %  r   r'   c                 N   i }t          |dg          ?t          |g dd t          j        | t          |dg                    D                        t          |dg          At          |dgt	          t          |dg          |                     t          |ddi           |S )Ncontents)
requests[]requestr   c                     g | ]}|S r.   r.   r7   s     r%   r3   z/_EmbedContentBatch_to_mldev.<locals>.<listcomp>E  s(     	
 	
 	
 	
 	
 	
r'   r   _selfzrequests[].*zrequests[].request.*)r    r!   rq   t_contents_for_embed_EmbedContentConfig_to_mldevmovevr^   s       r%   _EmbedContentBatch_to_mldevr   ;  s    
 !)	+
|$$0,,,	
 	
.Dzl;; 	
 	
 	
	 	 	 
+z"".		$T+z%B%BINN  
 
)n&<=>>>	r'   c                 <   i }t          | dg          "t          |ddgt          | dg                     t          | dg          "t          |ddgt          | dg                     t          | dg          "t          |ddgt          | dg                     t          | dg          t          d          t          | d	g          t          d
          t          | dg          t          d          t          | dg          t          d          |S )N	task_typer   taskTypetitleoutput_dimensionalityoutputDimensionalityr   zqmime_type parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.auto_truncatezuauto_truncate parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.document_ocrztdocument_ocr parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.audio_track_extractionz~audio_track_extraction parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.r   r#   s      r%   r   r   W  sz    !)	+}%%1	z"[;-((   
+y!!-w/kG91M1MNNN	+/011=	-.[2344   
+}%%1
	<  
 
+())5
	<  
 
+'((4
	<  
 
+0122>
	M  
 
r'   c                     i }t          |dg          !t          |dgt          |dg                     t          |dg          0t          |dgt          | t          |dg          |                     |S )Nr*   rX   rY   )r    r!   r   r^   s       r%   r   r     s    
 !)	+}%%1[M4k]#C#CDDD	+*+,,8	#[+=*>??	
 	
   
r'   c                    i }t          | dg          t          d          t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     |S )Nrf   r   file_urifileUrir   r   r]   r#   s      r%   _FileData_to_mldevr     s     !)	+'((4
	<  
 
+
|$$0YKkJ<!@!@AAA	+}%%1ZL${[M"B"BCCC	r'   c                    i }t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          t          d          t          | dg          t          d          |S )Nidargsrc   partial_argsztpartial_args parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.will_continuezuwill_continue parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.r   r#   s      r%   _FunctionCall_to_mldevr     s     !)	+v*TFDtf55666	+x  ,VHd;99:::	+x  ,VHd;99:::	+'((4
	<  
 
+())5
	<  
 
r'   c                    i }t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          t          d          |S )Nallowed_function_namesallowedFunctionNamesmodestream_function_call_argumentszstream_function_call_arguments parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.r   r#   s      r%   _FunctionCallingConfig_to_mldevr     s     !)	+0122>	 [3455   
+x  ,VHd;99:::	+89::F
	M  
 
r'   c                     i t          |dg          At          |dgt          t          j        t          |dg                                         t          |dg          !t          dgt          |dg                     t          |dg          !t          dgt          |dg                     t          |dg          !t          dgt          |dg                     t          |dg          !t          d	gt          |dg                     t          |d
g          !t          dgt          |d
g                     t          |dg          !t          dgt          |dg                     t          |dg          !t          dgt          |dg                     t          |dg          !t          dgt          |dg                     t          |dg          !t          dgt          |dg                     t          |dg          !t          dgt          |dg                     t          |dg          !t          dgt          |dg                     t          |dg          !t          dgt          |dg                     t          |dg          4t          dgt          j         t          |dg                               t          |dg          !t          dgt          |dg                     t          |dg          t          d          t          |dg          t          d          t          |d g          -t          |d!gfd"t          |d g          D                        t          |d#g          At          |d#g fd$t          j         t          |d#g                    D                        t          |d%g          /t          |d&gt          t          |d%g                               t          |d'g          t          d(          t          |d)g          4t          |d*gt          j	         t          |d)g                               t          |d+g          !t          d,gt          |d+g                     t          |d-g          !t          d.gt          |d-g                     t          |d/g          3t          d0gt          j
        t          |d/g                               t          |d1g          t          d2          t          |d3g          !t          d4gt          |d3g                     t          |d5g          /t          d6gt          t          |d5g                               t          |d7g          !t          d8gt          |d7g                     t          |d9g          t          d:          t          |d;g          !t          |d<gt          |d;g                     S )=Nsystem_instructionsystemInstructiontemperaturetop_ptopPtop_ktopKcandidate_countcandidateCountmax_output_tokensmaxOutputTokensstop_sequencesstopSequencesresponse_logprobsresponseLogprobslogprobspresence_penaltypresencePenaltyfrequency_penaltyfrequencyPenaltyseedresponse_mime_typeresponseMimeTyperesponse_schemaresponseSchemaresponse_json_schemaresponseJsonSchemarouting_configzvrouting_config parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.model_selection_configz~model_selection_config parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.safety_settingssafetySettingsc                 0    g | ]}t          |          S r.   )_SafetySetting_to_mldevr0   s     r%   r3   z3_GenerateContentConfig_to_mldev.<locals>.<listcomp>H  s3     	
 	
 	
 $D)44	
 	
 	
r'   toolsc                 V    g | ]%}t          t          j        |                    &S r.   )_Tool_to_mldevrq   t_toolr\   s     r%   r3   z3_GenerateContentConfig_to_mldev.<locals>.<listcomp>R  s?     	
 	
 	
 18J55yAA	
 	
 	
r'   tool_config
toolConfiglabelsznlabels parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.cached_contentcachedContentresponse_modalitiesresponseModalitiesmedia_resolutionmediaResolutionspeech_configspeechConfigaudio_timestampzwaudio_timestamp parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.thinking_configthinkingConfigimage_configimageConfigenable_enhanced_civic_answersenableEnhancedCivicAnswersmodel_armor_configzzmodel_armor_config parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.service_tierserviceTier)r    r!   r   rq   	t_contentt_schemar"   t_tools_ToolConfig_to_mldevt_cached_content_namet_speech_config_ImageConfig_to_mldevr^   s   `  @r%   _GenerateContentConfig_to_mldevr8    s   
 !)	+,-..:	K[+?*@AABBI	
 	
   
+''3]OT+%G%GHHH	+y!!-VHd;	::;;;	+y!!-VHd;	::;;;	+)*++7%&[;L:M(N(NOOO	++,--9%&[;N:O(P(P   
+()**6_%tK:J9K'L'LMMM	++,--9	[./00   
+
|$$0ZL${ZL"A"ABBB	+*+,,8%&[;M:N(O(O   
++,--9	[./00   
+x  ,VHd;99:::	+,-..:	[/011   
+)*++7		
:tK2C1DEEFF   
+./00<	[1233   
+()**6
	<  
 
+0122>
	M  
 
+)*++7		
 	
 	
 	
[+<*=>>	
 	
 	
   
+y!!-			
 	
 	
 	
 	
	*d;	.J.JKK	
 	
 	
   
+''3	T+??KK   
+z"".
	3  
 
+()**6		[+;*<==	
 	
   
+-.//;	[0122   
+*+,,8%&[;M:N(O(O   
+())5		${_,=>>??   
+)*++7
	<  
 
+)*++7%&[;L:M(N(NOOO	+'((4	d;0@AA9MM   
+7899E	%&[:;<<   
+,-..:
	B  
 
+'((4kN;K)L)LMMM	r'   c           	         i t          | dg          !t          dgt          | dg                     t          | dg          -t          dgfdt          | dg          D                        t          | dg          !t          dgt          | dg                     t          | dg          !t          dgt          | dg                     t          | d	g          !t          d
gt          | d	g                     t          | dg          !t          dgt          | dg                     t          | dg          !t          dgt          | dg                     S )Nr   r   
candidatesc                 0    g | ]}t          |          S r.   )r   r0   s     r%   r3   z7_GenerateContentResponse_from_mldev.<locals>.<listcomp>  3     	
 	
 	
 "$	22	
 	
 	
r'   modelVersionmodel_versionpromptFeedbackprompt_feedback
responseIdresponse_idusageMetadatausage_metadatamodelStatusmodel_statusr8   r#   s     @r%   #_GenerateContentResponse_from_mldevrG    s    !)	+)*++7'(${=N<O*P*P   
+~&&2		
 	
 	
 	
[<.99	
 	
 	
   
+'((4_%tK.9I'J'JKKK	+()**6&'k<L;M)N)NOOO	+~&&2]OT+~%F%FGGG	+())5%&[?:K(L(LMMM	+''3^$d;&H&HIII	r'   c                     i }t          |dg          5t          |ddgt          j        | t          |dg                               |S r   r   r^   s       r%   _GetBatchJobParameters_to_mldevrI    r   r'   c                     i }t          |dg          5t          |ddgt          j        | t          |dg                               |S r   r   r^   s       r%    _GetBatchJobParameters_to_vertexrK    r   r'   c           
          i }t          | dg          /t          |dgt          t          | dg          |                     t          | dg          !t          |dgt          | dg                     |S )Nauth_config
authConfigenable_widgetenableWidget)r    r!   r&   r#   s      r%   _GoogleMaps_to_mldevrQ    s     !)	+''3	T+??KK   
+())5^$d;8I&J&JKKK	r'   c                 R   i }t          | dg          !t          |dgt          | dg                     t          | dg          t          d          t          | dg          t          d          t          | dg          !t          |dgt          | dg                     |S )	Nsearch_typessearchTypesblocking_confidencez{blocking_confidence parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.exclude_domainszwexclude_domains parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.time_range_filtertimeRangeFilterr   r#   s      r%   _GoogleSearch_to_mldevrY    s     !)	+'((4]OT+7G%H%HIII	+-.//;
	B  
 
+)*++7
	<  
 
++,--9%&[;N:O(P(P   
r'   c                    i }t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          t          d          t          | dg          t          d          t          | d	g          t          d
          t          | dg          t          d          t          | dg          t          d          |S )Naspect_ratioaspectRatio
image_size	imageSizeperson_generationzyperson_generation parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.prominent_peoplezxprominent_people parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.output_mime_typezxoutput_mime_type parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.output_compression_qualityzoutput_compression_quality parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.image_output_optionsz|image_output_options parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.r   r#   s      r%   r7  r7    s[    !)	+'((4]OT+7G%H%HIII	+~&&2[M4l^#D#DEEE	++,--9
	B  
 
+*+,,8
	B  
 
+*+,,8
	B  
 
+4566B
	M  
 
+./00<
	B  
 
r'   c                 D   i t          |dg          5t          ddgt          j        | t          |dg                               t          |dg          @t          ddgfdt          j        t          |dg                    D                        t          |dg          !t          dgt          |dg                     t          |dg          Bt          ddgt          | t          |dg          t          dgi                                S )	Nrn   r   r   c                 0    g | ]}t          |          S r.   )r   r0   s     r%   r3   z,_InlinedRequest_to_mldev.<locals>.<listcomp>U  s3     	
 	
 	
 dI..	
 	
 	
r'   rd   r   generationConfig)default_value)r    r!   rq   r   
t_contentsr8  r^   s      @r%   r[   r[   D  s`   
 !)	+y!!-	G		*d;	::;;   
+
|$$0	J	
 	
 	
 	
T+
|%D%DEE	
 	
 	
   
+
|$$0ZL${ZL"A"ABBB	+z"".	&''xj))YKr:::	
 	
   
r'   c           
      R   i }t          | dg          /t          |dgt          t          | dg          |                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     |S )Nresponserd   rv   )r    r!   rG  r#   s      r%   r/   r/   l  s     !)	+
|$$0	+zl++Y	
 	
   
+
|$$0ZL${ZL"A"ABBB	+y!!-WItK';;<<<	r'   c                    i }t          | dg          "t          |ddgt          | dg                     t          | dg          "t          |ddgt          | dg                     t          | dg          t          d          |S )N	page_size_querypageSize
page_token	pageTokenfilterznfilter parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.r   r#   s      r%   _ListBatchJobsConfig_to_mldevrr    s     !)	+}%%1*-tK+/O/O   
+~&&2	;[<.))   
+z"".
	3  
 
r'   c                 <   i }t          | dg          "t          |ddgt          | dg                     t          | dg          "t          |ddgt          | dg                     t          | dg          "t          |ddgt          | dg                     |S )Nrl  rm  rn  ro  rp  rq  r8   r#   s      r%   _ListBatchJobsConfig_to_vertexrt    s     !)	+}%%1*-tK+/O/O   
+~&&2	;[<.))   
+z"".8,d;
.K.KLLL	r'   c                 j    i }t          | dg          t          t          | dg          |           |S Nr   )r    rr  r#   s      r%   !_ListBatchJobsParameters_to_mldevrw    s=     !)	+z"".!${XJ"?"?KKK	r'   c                 j    i }t          | dg          t          t          | dg          |           |S rv  )r    rt  r#   s      r%   "_ListBatchJobsParameters_to_vertexry    s=     !)	+z""."4hZ#@#@)LLL	r'   c           	      P   i t          | dg          !t          dgt          | dg                     t          | dg          !t          dgt          | dg                     t          | dg          -t          dgfdt          | dg          D                        S )Nr   r   nextPageTokennext_page_token
operations
batch_jobsc                 0    g | ]}t          |          S r.   )rt   r0   s     r%   r3   z5_ListBatchJobsResponse_from_mldev.<locals>.<listcomp>  s3     	
 	
 	
 !y11	
 	
 	
r'   r8   r#   s     @r%   !_ListBatchJobsResponse_from_mldevr    s     !)	+)*++7'(${=N<O*P*P   
+())5&'kO;L)M)MNNN	+~&&2		
 	
 	
 	
[<.99	
 	
 	
   
r'   c           	      P   i t          | dg          !t          dgt          | dg                     t          | dg          !t          dgt          | dg                     t          | dg          -t          dgfdt          | dg          D                        S )Nr   r   r{  r|  batchPredictionJobsr~  c                 0    g | ]}t          |          S r.   )r   r0   s     r%   r3   z6_ListBatchJobsResponse_from_vertex.<locals>.<listcomp>  r<  r'   r8   r#   s     @r%   "_ListBatchJobsResponse_from_vertexr    s     !)	+)*++7'(${=N<O*P*P   
+())5&'kO;L)M)MNNN	+-.//;		
 	
 	
 	
[+@*ABB	
 	
 	
   
r'   c           
         i }t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          /t          |dgt          t          | dg          |                     t          | d	g          /t          |d
gt          t          | d	g          |                     t          | dg          !t          |dgt          | dg                     t          | dg          /t          |dgt	          t          | dg          |                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     |S )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_calltoolCalltool_responsetoolResponsepart_metadatapartMetadata)r    r!   r   r   r   r#   s      r%   r   r      s]    !)	+*+,,8%&[;M:N(O(O   
+/011=	[2344   
+)*++7%&[;L:M(N(NOOO	+}%%1	4k];;YGG   
+())5	tK/1BCCYOO   
++,--9	[./00   
+''3	tK-999EE   
+x  ,VHd;99:::	+	{##/YKkI;!?!?@@@	++,--9	[./00   
+()**6_%tK:J9K'L'LMMM	+}%%1ZL${[M"B"BCCC	+())5^$d;8I&J&JKKK	+())5^$d;8I&J&JKKK	r'   c                    i }t          | dg          !t          |dgt          | dg                     t          | dg          t          d          t          | dg          !t          |dgt          | dg                     |S )Ncategorymethodznmethod parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.	thresholdr   r#   s      r%   r  r  L  s     !)	+
|$$0ZL${ZL"A"ABBB	+z"".
	3  
 
+}%%1[M4k]#C#CDDD	r'   c           
      R   i }t          | dg          !t          |dgt          | dg                     t          | dg          /t          |dgt          t          | dg          |                     t          | dg          !t          |dgt          | dg                     |S )Nretrieval_configretrievalConfigfunction_calling_configfunctionCallingConfig$include_server_side_tool_invocations includeServerSideToolInvocations)r    r!   r   r#   s      r%   r4  r4  `  s     !)	+*+,,8%&[;M:N(O(O   
+1233?	 !'89::I	
 	
   
+>?@@L	+,[ABCC   
r'   c           
         i }t          | dg          t          d          t          | dg          !t          |dgt          | dg                     t          | dg          !t          |dgt          | dg                     t          | dg          /t          |dgt          t          | dg          |                     t          | d	g          /t          |d
gt	          t          | d	g          |                     t          | dg          !t          |dgt          | dg                     t          | dg          t          d          t          | dg          +t          |dgd t          | dg          D                        t          | dg          !t          |dgt          | dg                     t          | dg          t          d          t          | dg          !t          |dgt          | dg                     t          | dg          +t          |dgd t          | dg          D                        |S )N	retrievalzqretrieval parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.computer_usecomputerUsefile_search
fileSearchgoogle_searchgoogleSearchgoogle_maps
googleMapscode_executioncodeExecutionenterprise_web_searchz}enterprise_web_search parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.function_declarationsfunctionDeclarationsc                     g | ]}|S r.   r.   r7   s     r%   r3   z"_Tool_to_mldev.<locals>.<listcomp>  s    GGG$GGGr'   google_search_retrievalgoogleSearchRetrievalparallel_ai_searchzzparallel_ai_search parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.url_context
urlContextmcp_servers
mcpServersc                     g | ]}|S r.   r.   r7   s     r%   r3   z"_Tool_to_mldev.<locals>.<listcomp>  s    ===$===r'   )r    r"   r!   rY  rQ  r#   s      r%   r  r  }  s    !)	+}%%1
	<  
 
+'((4]OT+7G%H%HIII	+''3\ND}o$F$FGGG	+())5	tK/1BCCYOO   
+''3	T+??KK   
+()**6_%tK:J9K'L'LMMM	+/011=
	B  
 
+/011=	 GG${-D,EFFGGG   
+1233?	 ![4566   
+,-..:
	B  
 
+''3\ND}o$F$FGGG	+''3	==${]O<<===   
r'   c           	          i }t          | ddg          "t          |dgt          | ddg                     t          | dg          !t          |dgt          | dg                     |S )Nr@   rA   bigquery_destinationre   rf   r8   r#   s      r%   rE   rE     s     !)	+-{;<<H	 [0+>??   
+''3^$d;&H&HIII	r'   c                     i }t          | dg          "t          |ddgt          | dg                     t          | dg          !t          |dgt          | dg                     |S )Nr  r@   rA   rf   re   r8   r#   s      r%   rI   rI     s     !)	+./00<	,[1233   
+'((4]OT+7G%H%HIII	r'   c            	          e Zd Zddddee         deej        ej        f         deej	                 dej
        fdZddddee         dej        deej                 dej
        fdZdd	d
edeej                 dej
        fdZdd	d
edeej                 ddfdZdd	deej                 dej        fdZdd	d
edeej                 dej        fdZdd	dedej        deej	                 dej
        fdZdd	dedej        deej                 dej
        fdZdd	deej                 deej
                 fdZdS )BatchesNrn   r   rn   rz   r   r   c                |   t          j        |||          }| j        j        rEt	          | j        |          }|                    d          }|rd                    |          }nGd}nDt          | j        |          }|                    d          }|rd                    |          }nd}|                    d          }|r| dt          |           }|	                    dd            d }	|j
        |j
        j        |j
        j        }	t          j        |          }t          j        |          }| j                            d|||	          }
|
j        si nt#          j        |
j                  }| j        j        rt'          |          }| j        j        st)          |          }t           j                            |t/          |dd           rDdt/          |j
        d	d           t/          |j
        d
d           t/          |j
        dd           dini           }| j                            |           |S Nrn   rz   r   r   r  z{model}:batchGenerateContentrm  ?r   postr  r  include_all_fieldsr  r  r  rj  kwargs)r   _CreateBatchJobParameters_api_clientvertexair   get
format_mapr   r   popr   http_optionsr	   convert_to_dictencode_unserializable_typesr   bodyjsonloadsr   rt   BatchJob_from_responsegetattr_verify_responseselfrn   rz   r   parameter_modelrequest_dictrequest_url_dictpathquery_paramsr  rj  response_dictreturn_values                r%   _createzBatches._create  s    5  O   .8

O l &))&11	 %$//0@AA$7

O l &))&11	 .-889IJJ-##H--L 100y..00dXt$$$04L*"/;$+8l*<88L6|DDL''lL H 'mJBBHM1J1JM  ;+M::m$ :*=99m>00 ?Hd33#*#*,=t$ $ )0#*,BD) ) '.#*,@$' '
 

 
 ! 1  L& 	%%l333r'   c                   t          j        |||          }| j        j        rt	          d          t          | j        |          }|                    d          }|rd                    |          }nd}|                    d          }|r| dt          |           }|	                    dd            d }	|j
        |j
        j        |j
        j        }	t          j        |          }t          j        |          }| j                            d|||	          }
|
j        si nt#          j        |
j                  }| j        j        st'          |          }t           j                            |t-          |dd           rDdt-          |j
        d	d           t-          |j
        d
d           t-          |j
        dd           dini           }| j                            |           |S Nr  ziThis method is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.r   z{model}:asyncBatchEmbedContentrm  r  r   r  r  r  r  r  r  )r   #_CreateEmbeddingsBatchJobParametersr  r  r"   r   r  r  r   r  r   r  r	   r  r  r   r  r  r  rt   r  r  r  r  r  s                r%   _create_embeddingszBatches._create_embeddings?  sE    ?  O   04  
 B

O l &))&11	 0/::;KLL/##H--L 100y..00dXt$$$04L*"/;$+8l*<88L6|DDL''lL H 'mJBBHM1J1JM$ :*=99m>00 ?Hd33#*#*,=t$ $ )0#*,BD) ) '.#*,@$' '
 

 
 ! 1  L& 	%%l333r'   r   rc   c                z   t          j        ||          }| j        j        rEt	          | j        |          }|                    d          }|rd                    |          }nGd}nDt          | j        |          }|                    d          }|rd                    |          }nd}|                    d          }|r| dt          |           }|	                    dd           d}|j
        |j
        j        |j
        j        }t          j        |          }t          j        |          }| j                            d	|||          }	|	j        si nt#          j        |	j                  }
| j        j        rt'          |
          }
| j        j        st)          |
          }
t           j                            |
t/          |dd          rDdt/          |j
        d
d          t/          |j
        dd          t/          |j
        dd          dini           }| j                            |           |S )aW  Gets a batch job.

    Args:
      name (str): A fully-qualified BatchJob resource name or ID.
        Example: "projects/.../locations/.../batchPredictionJobs/456" or "456"
          when project and location are initialized in the Gemini Enterprise
          Agent Platform client. Or "batches/abc" using the Gemini Developer AI
          client.

    Returns:
      A BatchJob object that contains details about the batch job.

    Usage:

    .. code-block:: python

      batch_job = client.batches.get(name='123456789')
      print(f"Batch job: {batch_job.name}, state {batch_job.state}")
    rc   r   r   batchPredictionJobs/{name}batches/{name}rm  r  r   Nr  r  r  r  r  r  )r   _GetBatchJobParametersr  r  rK  r  r  rI  r   r  r   r  r	   r  r  r   r  r  r  r   rt   r  r  r  r  r  rc   r   r  r  r  r  r  r  rj  r  r  s               r%   r  zBatches.get  s   . 2  O    5

O l &))&11	 ,+667GHH+4

O l &))&11	  **+;<<##H--L 100y..00dXt$$$04L*"/;$+8l*<88L6|DDL''t\<PPH&mJBBHM1J1JM  ;+M::m$ :*=99m>00 ?Hd33#*#*,=t$ $ )0#*,BD) ) '.#*,@$' '
 

 
 ! 1  L& 	%%l333r'   c                   t          j        ||          }| j        j        rEt	          | j        |          }|                    d          }|rd                    |          }nGd}nDt          | j        |          }|                    d          }|rd                    |          }nd}|                    d          }|r| dt          |           }|	                    dd           d}|j
        |j
        j        |j
        j        }t          j        |          }t          j        |          }| j                            d	|||           dS )
a  Cancels a batch job.

    Only available for batch jobs that are running or pending.

    Args:
      name (str): A fully-qualified BatchJob resource name or ID.
        Example: "projects/.../locations/.../batchPredictionJobs/456" or "456"
          when project and location are initialized in the Vertex AI client. Or
          "batches/abc" using the Gemini Developer AI client.

    Usage:

    .. code-block:: python

      client.batches.cancel(name='123456789')
    r  r   !batchPredictionJobs/{name}:cancelbatches/{name}:cancelrm  r  r   Nr  )r   _CancelBatchJobParametersr  r  r   r  r  r   r   r  r   r  r	   r  r  r   	r  rc   r   r  r  r  r  r  r  s	            r%   cancelzBatches.cancel  s   . 5  O   '8

O l &))&11	 32==>NOO27

O l &))&11	 '&112BCC&##H--L 100y..00dXt$$$04L*"/;$+8l*<88L6|DDLVT<FFFFFr'   c                   t          j        |          }| j        j        r?t	          |          }|                    d          }|rd                    |          }nAd}n>t          |          }|                    d          }|rd                    |          }nd}|                    d          }|r| dt          |           }|	                    dd            d }|j
        |j
        j        |j
        j        }t          j        |          }t          j        |          }| j                            d|||          }|j        si nt#          j        |j                  }	| j        j        rt'          |	          }	| j        j        st)          |	          }	t           j                            |	t/          |dd           rDdt/          |j
        d	d           t/          |j
        d
d           t/          |j
        dd           dini           }
t          j        |j                  |
_        | j                            |
           |
S Nr  r   r  batchesrm  r  r   r  r  r  r  r  r  headers)r   _ListBatchJobsParametersr  r  ry  r  r  rw  r   r  r   r  r	   r  r  r   r  r  r  r  r  ListBatchJobsResponser  r  HttpResponser  r   r  r  r   r  r  r  r  r  r  rj  r  r  s              r%   _listzBatches._list-  s    4  O   7HHl%))&11	 %$//0@AA$6GGl%))&11	 ##$455##H--L 100y..00dXt$$$04L*"/;$+8l*<88L6|DDL''t\<PPH&mJBBHM1J1JM  H8GGm$ G7FFm.== ?Hd33#*#*,=t$ $ )0#*,BD) ) '.#*,@$' '
 

 
 ! >  L$ &+%7 & & &L" 	%%l333r'   c                   t          j        ||          }| j        j        rEt	          | j        |          }|                    d          }|rd                    |          }nGd}nDt          | j        |          }|                    d          }|rd                    |          }nd}|                    d          }|r| dt          |           }|	                    dd           d}|j
        |j
        j        |j
        j        }t          j        |          }t          j        |          }| j                            d	|||          }	|	j        si nt#          j        |	j                  }
| j        j        rt'          |
          }
| j        j        st)          |
          }
t           j                            |
t/          |dd          rDdt/          |j
        d
d          t/          |j
        dd          t/          |j
        dd          dini           }t          j        |	j                  |_        | j                            |           |S )a  Deletes a batch job.

    Args:
      name (str): A fully-qualified BatchJob resource name or ID.
        Example: "projects/.../locations/.../batchPredictionJobs/456" or "456"
          when project and location are initialized in the client.

    Returns:
      A DeleteResourceJob object that shows the status of the deletion.

    Usage:

    .. code-block:: python

      client.batches.delete(name='123456789')
    r  r   r  r  rm  r  r   Ndeleter  r  r  r  r  r  )r   _DeleteBatchJobParametersr  r  r   r  r  r   r   r  r   r  r	   r  r  r   r  r  r  r   r   DeleteResourceJobr  r  r  r  r   r  r  s               r%   r  zBatches.deletev  s   . 5  O    8

O l &))&11	 ,+667GHH+7

O l &))&11	  **+;<<##H--L 100y..00dXt$$$04L*"/;$+8l*<88L6|DDL''$l H 'mJBBHM1J1JM  D4]CCm$ C3MBBm*99 ?Hd33#*#*,=t$ $ )0#*,BD) ) '.#*,@$' '
 

 
 ! :  L$ &+%7 & & &L" 	%%l333r'   c                   t          j        | j        |          }t          j        |||          }| j        j        r2t          j        ||j                  }| 	                    |||          S | 	                    |||          S )a  Creates a batch job.

    Args:
      model (str): The model to use for the batch job.
      src: The source of the batch job. Currently Gemini Enterprise Agent
        Platform supports GCS URI(-s) or BigQuery URI. Example:
        "gs://path/to/input/data" or "bq://projectId.bqDatasetId.bqTableId".
        Gemini Developer API supports List of inlined_request, or file name.
        Example: "files/file_name".
      config (CreateBatchJobConfig): Optional configuration for the batch job.

    Returns:
      A BatchJob object that contains details about the batch job.

    Usage:

    .. code-block:: python

      batch_job = client.batches.create(
          model="gemini-2.0-flash-001",
          src="gs://path/to/input/data",
      )
      print(batch_job.state)
    r  
rq   r   r  r   r  r  r
   format_destinationr   r  r  rn   rz   r   r  s        r%   createzBatches.create  s    > 
t/
5
5C 5  O   ?.sO4JKKf\\3v\>>>\\3v\>>>r'   c                   ddl }|                    dt          j        d           t	          j        | j        |          }t          j        |||          }| j        j	        rt          d          |                     |||          S )a]  **Experimental** Creates an embedding batch job.

    Args:
      model (str): The model to use for the batch job.
      src: Gemini Developer API supports List of inlined_request, or file name.
        Example: "files/file_name".
      config (CreateBatchJobConfig): Optional configuration for the batch job.

    Returns:
      A BatchJob object that contains details about the batch job.

    Usage:

    .. code-block:: python

      batch_job = client.batches.create_embeddings(
          model="text-embedding-004",
          src="files/my_embedding_input",
      )
      print(batch_job.state)
    r   NJbatches.create_embeddings() is experimental and may change without notice.   r  
stacklevelr  lGemini Enterprise Agent Platform (previously known as Vertex AI) does not support batches.create_embeddings.)warningswarnr	   ExperimentalWarningrq   t_embedding_batch_job_sourcer  r   r  r  r"   r  )r  rn   rz   r   r  r  s         r%   create_embeddingszBatches.create_embeddings	  s    8 OOOMM	,	     
()93
?
?C ?  O   J9  
 $$5c&$IIIr'   c                \    | j         }t          d||                      |          |          S )a  Lists batch jobs.

    Args:
      config (ListBatchJobsConfig): Optional configuration for the list request.

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

    Usage:

    .. code-block:: python
      config = {'page_size': 10}
      for batch_job in client.batches.list(config):
        print(batch_job.name)
    r~  r  )r  r   r  r   list_requests      r%   listzBatches.list=	  s7    ( :L

&
!!	  r'   )__name__
__module____qualname__r   strr   r   BatchJobSourceUnionBatchJobSourceUnionDictCreateBatchJobConfigOrDictr  r  EmbeddingsBatchJobSourceOrDict$CreateEmbeddingsBatchJobConfigOrDictr  GetBatchJobConfigOrDictr  CancelBatchJobConfigOrDictr  ListBatchJobsConfigOrDictr  r  DeleteBatchJobConfigOrDictr  r  r  r  r   r  r.   r'   r%   r  r    sF       
 ";?Q Q Q c]Q *E,IIJ	Q
 u78Q ~Q Q Q Ql "EIJ J J c]J /	J
 uABJ ~J J J JZ MQ^ ^ ^^"*5+H"I^~^ ^ ^ ^H <@	@G @G @G @G u78	@G
 @G @G @G @GF DHG G G ?@G"G G G GZ <@	b b b b u78	b
 b b b bR <@,? ,? ,? ,? (	,?
 u78,? ~,? ,? ,? ,?f FJ3J 3J 3J 3J /	3J
 uAB3J ~3J 3J 3J 3Jl DH   ?@U^     r'   r  c            	          e Zd Zddddee         deej        ej        f         deej	                 dej
        fdZddddee         dej        deej                 dej
        fdZdd	d
edeej                 dej
        fdZdd	d
edeej                 ddfdZdd	deej                 dej        fdZdd	d
edeej                 dej        fdZdd	dedej        deej	                 dej
        fdZdd	dedej        deej                 dej
        fdZdd	deej                 deej
                 fdZdS )AsyncBatchesNr  rn   rz   r   r   c                  K   t          j        |||          }| j        j        rEt	          | j        |          }|                    d          }|rd                    |          }nGd}nDt          | j        |          }|                    d          }|rd                    |          }nd}|                    d          }|r| dt          |           }|	                    dd            d }	|j
        |j
        j        |j
        j        }	t          j        |          }t          j        |          }| j                            d|||	           d {V }
|
j        si nt#          j        |
j                  }| j        j        rt'          |          }| j        j        st)          |          }t           j                            |t/          |dd           rDdt/          |j
        d	d           t/          |j
        d
d           t/          |j
        dd           dini           }| j                            |           |S 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  s                r%   r  zAsyncBatches._create\	  s      5  O   .8

O l &))&11	 %$//0@AA$7

O l &))&11	 .-889IJJ-##H--L 100y..00dXt$$$04L*"/;$+8l*<88L6|DDL%33lL       H 'mJBBHM1J1JM  ;+M::m$ :*=99m>00 ?Hd33#*#*,=t$ $ )0#*,BD) ) '.#*,@$' '
 

 
 ! 1  L& 	%%l333r'   c                  K   t          j        |||          }| j        j        rt	          d          t          | j        |          }|                    d          }|rd                    |          }nd}|                    d          }|r| dt          |           }|	                    dd            d }	|j
        |j
        j        |j
        j        }	t          j        |          }t          j        |          }| j                            d|||	           d {V }
|
j        si nt#          j        |
j                  }| j        j        st'          |          }t           j                            |t-          |dd           rDdt-          |j
        d	d           t-          |j
        d
d           t-          |j
        dd           dini           }| j                            |           |S r  )r   r  r  r  r"   r   r  r  r   r  r   r  r	   r  r  r-  r  r  r  rt   r  r  r  r  r  s                r%   r  zAsyncBatches._create_embeddings	  sg      ?  O   04  
 B

O l &))&11	 0/::;KLL/##H--L 100y..00dXt$$$04L*"/;$+8l*<88L6|DDL%33lL       H 'mJBBHM1J1JM$ :*=99m>00 ?Hd33#*#*,=t$ $ )0#*,BD) ) '.#*,@$' '
 

 
 ! 1  L& 	%%l333r'   r  rc   c                  K   t          j        ||          }| j        j        rEt	          | j        |          }|                    d          }|rd                    |          }nGd}nDt          | j        |          }|                    d          }|rd                    |          }nd}|                    d          }|r| dt          |           }|	                    dd           d}|j
        |j
        j        |j
        j        }t          j        |          }t          j        |          }| j                            d	|||           d{V }	|	j        si nt#          j        |	j                  }
| j        j        rt'          |
          }
| j        j        st)          |
          }
t           j                            |
t/          |dd          rDdt/          |j
        d
d          t/          |j
        dd          t/          |j
        dd          dini           }| j                            |           |S )aa  Gets a batch job.

    Args:
      name (str): A fully-qualified BatchJob resource name or ID.
        Example: "projects/.../locations/.../batchPredictionJobs/456" or "456"
          when project and location are initialized in the Gemini Enterprise
          Agent Platform client. Or "batches/abc" using the Gemini Developer AI
          client.

    Returns:
      A BatchJob object that contains details about the batch job.

    Usage:

    .. code-block:: python

      batch_job = await client.aio.batches.get(name='123456789')
      print(f"Batch job: {batch_job.name}, state {batch_job.state}")
    r  r   r  r  rm  r  r   Nr  r  r  r  r  r  )r   r  r  r  rK  r  r  rI  r   r  r   r  r	   r  r  r-  r  r  r  r   rt   r  r  r  r  r  s               r%   r  zAsyncBatches.get	  s     . 2  O    5

O l &))&11	 ,+667GHH+4

O l &))&11	  **+;<<##H--L 100y..00dXt$$$04L*"/;$+8l*<88L6|DDL%33t\<       H 'mJBBHM1J1JM  ;+M::m$ :*=99m>00 ?Hd33#*#*,=t$ $ )0#*,BD) ) '.#*,@$' '
 

 
 ! 1  L& 	%%l333r'   c                  K   t          j        ||          }| j        j        rEt	          | j        |          }|                    d          }|rd                    |          }nGd}nDt          | j        |          }|                    d          }|rd                    |          }nd}|                    d          }|r| dt          |           }|	                    dd           d}|j
        |j
        j        |j
        j        }t          j        |          }t          j        |          }| j                            d	|||           d{V  dS )
a  Cancels a batch job.

    Only available for batch jobs that are running or pending.

    Args:
      name (str): A fully-qualified BatchJob resource name or ID.
        Example: "projects/.../locations/.../batchPredictionJobs/456" or "456"
          when project and location are initialized in the Vertex AI client. Or
          "batches/abc" using the Gemini Developer AI client.

    Usage:

    .. code-block:: python

      await client.aio.batches.cancel(name='123456789')
    r  r   r  r  rm  r  r   Nr  )r   r  r  r  r   r  r  r   r   r  r   r  r	   r  r  r-  r  s	            r%   r  zAsyncBatches.cancel]
  s     . 5  O   '8

O l &))&11	 32==>NOO27

O l &))&11	 '&112BCC&##H--L 100y..00dXt$$$04L*"/;$+8l*<88L6|DDL


(
(lL          r'   c                  K   t          j        |          }| j        j        r?t	          |          }|                    d          }|rd                    |          }nAd}n>t          |          }|                    d          }|rd                    |          }nd}|                    d          }|r| dt          |           }|	                    dd            d }|j
        |j
        j        |j
        j        }t          j        |          }t          j        |          }| j                            d|||           d {V }|j        si nt#          j        |j                  }	| j        j        rt'          |	          }	| j        j        st)          |	          }	t           j                            |	t/          |dd           rDdt/          |j
        d	d           t/          |j
        d
d           t/          |j
        dd           dini           }
t          j        |j                  |
_        | j                            |
           |
S r  )r   r   r  r  ry  r  r  rw  r   r  r   r  r	   r  r  r-  r  r  r  r  r  r  r  r  r  r  r   r  r  s              r%   r  zAsyncBatches._list
  s      4  O   7HHl%))&11	 %$//0@AA$6GGl%))&11	 ##$455##H--L 100y..00dXt$$$04L*"/;$+8l*<88L6|DDL%33t\<       H 'mJBBHM1J1JM  H8GGm$ G7FFm.== ?Hd33#*#*,=t$ $ )0#*,BD) ) '.#*,@$' '
 

 
 ! >  L$ &+%7 & & &L" 	%%l333r'   c                  K   t          j        ||          }| j        j        rEt	          | j        |          }|                    d          }|rd                    |          }nGd}nDt          | j        |          }|                    d          }|rd                    |          }nd}|                    d          }|r| dt          |           }|	                    dd           d}|j
        |j
        j        |j
        j        }t          j        |          }t          j        |          }| j                            d	|||           d{V }	|	j        si nt#          j        |	j                  }
| j        j        rt'          |
          }
| j        j        st)          |
          }
t           j                            |
t/          |dd          rDdt/          |j
        d
d          t/          |j
        dd          t/          |j
        dd          dini           }t          j        |	j                  |_        | j                            |           |S )a  Deletes a batch job.

    Args:
      name (str): A fully-qualified BatchJob resource name or ID.
        Example: "projects/.../locations/.../batchPredictionJobs/456" or "456"
          when project and location are initialized in the client.

    Returns:
      A DeleteResourceJob object that shows the status of the deletion.

    Usage:

    .. code-block:: python

      await client.aio.batches.delete(name='123456789')
    r  r   r  r  rm  r  r   Nr  r  r  r  r  r  r  )r   r  r  r  r   r  r  r   r   r  r   r  r	   r  r  r-  r  r  r  r   r   r  r  r  r  r  r   r  r  s               r%   r  zAsyncBatches.delete
  s     . 5  O    8

O l &))&11	 ,+667GHH+7

O l &))&11	  **+;<<##H--L 100y..00dXt$$$04L*"/;$+8l*<88L6|DDL%33$l       H 'mJBBHM1J1JM  D4]CCm$ C3MBBm*99 ?Hd33#*#*,=t$ $ )0#*,BD) ) '.#*,@$' '
 

 
 ! :  L$ &+%7 & & &L" 	%%l333r'   c                ,  K   t          j        | j        |          }t          j        |||          }| j        j        r8t          j        ||j                  }| 	                    |||           d{V S | 	                    |||           d{V S )a  Creates a batch job asynchronously.

    Args:
      model (str): The model to use for the batch job.
      src: The source of the batch job. Currently Gemini Enterprise Agent
        Platform supports GCS URI(-s) or BigQuery URI. Example:
        "gs://path/to/input/data" or "bq://projectId.bqDatasetId.bqTableId".
        Gemini Develop API supports List of inlined_request, or file name.
        Example: "files/file_name".
      config (CreateBatchJobConfig): Optional configuration for the batch job.

    Returns:
      A BatchJob object that contains details about the batch job.

    Usage:

    .. code-block:: python

      batch_job = await client.aio.batches.create(
          model="gemini-2.0-flash-001",
          src="gs://path/to/input/data",
      )
    r  Nr
  r  s        r%   r  zAsyncBatches.createP  s      < 
t/
5
5C 5  O   E.sO4JKKf<<eV<DDDDDDDDD<<eV<DDDDDDDDDr'   c                h  K   ddl }|                    dt          j        d           t	          j        | j        |          }t          j        |||          }d}|j	        |j	        j
        |j	        j
        }| j        j        rt          d          |                     |||           d{V S )ao  **Experimental** Creates an asynchronously embedding batch job.

    Args:
      model (str): The model to use for the batch job.
      src: Gemini Developer API supports inlined_requests, or file name.
        Example: "files/file_name".
      config (CreateBatchJobConfig): Optional configuration for the batch job.

    Returns:
      A BatchJob object that contains details about the batch job.

    Usage:

    .. code-block:: python

      batch_job = await client.aio.batches.create_embeddings(
          model="text-embedding-004",
          src="files/my_embedding_input",
      )
      print(batch_job.state)
    r   Nr  r  r  r  r  )r  r  r	   r  rq   r  r  r   r  r   r  r  r"   r  )r  rn   rz   r   r  r  r  s          r%   r  zAsyncBatches.create_embeddings}  s      8 OOOMM	,	     
()93
?
?C ?  O 15L*"/;$+8l  P9  
 **C*OOOOOOOOOr'   c                l   K   | j         }t          d||                      |           d{V |          S )a  Lists batch jobs asynchronously.

    Args:
      config (ListBatchJobsConfig): Optional configuration for the list request.

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

    Usage:

    .. code-block:: python
      async for batch_job in await client.aio.batches.list():
        print(batch_job.name)
    r~  r  N)r  r   r  s      r%   r  zAsyncBatches.list  sM      & :Ljjj''''''''	  r'   )r  r  r  r   r   r   r   r!  r"  r#  r  r  r$  r%  r  r&  r  r'  r  r(  r  r  r)  r  r  r  r  r   r  r.   r'   r%   r+  r+  Z	  sG       
 ";?Q Q Q c]Q *E,IIJ	Q
 u78Q ~Q Q Q Ql "EIJ J J c]J /	J
 uABJ ~J J J JZ MQ` ` ``"*5+H"I`~` ` ` `L <@	B B B B u78	B
 B B B BJ DHI I I ?@I"I I I I^ <@	b b b b u78	b
 b b b bR <@+E +E +E +E (	+E
 u78+E ~+E +E +E +Ed FJ:P :P :P :P /	:P
 uAB:P ~:P :P :P :Pz DH   ?@%.!     r'   r+  )N)Vr  loggingtypingr   r   r   urllib.parser    r   r	   r
   r   rq   r   r  r   r   r    r   r   r   r!   pagersr   r   	getLoggerloggerdictr   objectr&   r9   rF   rJ   rT   r_   ra   rt   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r8  rG  rI  rK  rQ  rY  r7  r[   r/   rr  rt  rw  ry  r  r  r   r  r4  r  rE   rI   
BaseModuler  r+  r.   r'   r%   <module>r@     s  $   ' ' ' ' ' ' ' ' ' ' " " " " " "                                     & & & & & & . . . . . . 0 0 0 0 0 0 . . . . . . % % % % % % % %		1	2	2
 /3, ,tCH~v-.,DcN+, 
#s(^, , , ,b /3% %tCH~v-.%DcN+% 
#s(^% % % %T /3 tCH~v-.DcN+ 
#s(^   H /31 1tCH~v-.1DcN+1 
#s(^1 1 1 1l /3 tCH~v-.DcN+ 
#s(^   D /3+ ++tCH~v-.+ DcN++ 
#s(^	+ + + +` /3% %tCH~v-.%DcN+% 
#s(^% % % %T /36 6tCH~v-.6DcN+6 
#s(^6 6 6 6v /3; ;tCH~v-.;DcN+; 
#s(^; ; ; ;@ /3 tCH~v-.DcN+ 
#s(^   . /3 tCH~v-. DcN+ 
#s(^	   & /3 tCH~v-. DcN+ 
#s(^	   $ /35 5tCH~v-.5DcN+5 
#s(^5 5 5 5t /3 tCH~v-.DcN+ 
#s(^   " /3 tCH~v-.DcN+ 
#s(^   . /3 tCH~v-.DcN+ 
#s(^   > /3 tCH~v-.DcN+ 
#s(^   < /3 tCH~v-. DcN+ 
#s(^	   B /3 tCH~v-. DcN+ 
#s(^	   > /3 tCH~v-.DcN+ 
#s(^   & /3 tCH~v-. DcN+ 
#s(^	   B /3 tCH~v-. DcN+ 
#s(^	   & /3 tCH~v-. DcN+ 
#s(^	   $ /3 tCH~v-.DcN+ 
#s(^   0 /3 tCH~v-.DcN+ 
#s(^   2 /3 tCH~v-. DcN+ 
#s(^	   < /3. .tCH~v-..DcN+. 
#s(^. . . .h /3 tCH~v-. DcN+ 
#s(^	   . /3 tCH~v-.DcN+ 
#s(^   , /3 tCH~v-.DcN+ 
#s(^   > /3 tCH~v-.DcN+ 
#s(^   6 /3{ {{tCH~v-.{ DcN+{ 
#s(^	{ { { {@ /3# #tCH~v-.#DcN+# 
#s(^# # # #R /3 tCH~v-. DcN+ 
#s(^	   & /3 tCH~v-. DcN+ 
#s(^	   $ /3 tCH~v-.DcN+ 
#s(^   ( /3 tCH~v-.DcN+ 
#s(^   < /3) )tCH~v-.)DcN+) 
#s(^) ) ) )^ /3% %%tCH~v-.% DcN+% 
#s(^	% % % %T /3 tCH~v-.DcN+ 
#s(^   2 /3 tCH~v-.DcN+ 
#s(^   : /3 tCH~v-.DcN+ 
#s(^   4 /3 tCH~v-.DcN+ 
#s(^    /3 tCH~v-.DcN+ 
#s(^    /3 tCH~v-.DcN+ 
#s(^   8 /3 tCH~v-.DcN+ 
#s(^   8 /3I ItCH~v-.IDcN+I 
#s(^I I I I\ /3 tCH~v-.DcN+ 
#s(^   , /3 tCH~v-.DcN+ 
#s(^   > /3F FtCH~v-.FDcN+F 
#s(^F F F FV /3 tCH~v-.DcN+ 
#s(^   ( /3 tCH~v-.DcN+ 
#s(^   $m	 m	 m	 m	 m	k$ m	 m	 m	`x	 x	 x	 x	 x	;) x	 x	 x	 x	 x	r'   