
    LiY8                        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eeeef   ef   d	eeeef      d
eeef   fdZ	 ddeeeef   ef   d	eeeef      d
eeef   fdZ	 ddedeeeef   ef   d	eeeef      d
eeef   fdZ	 ddedeeeef   ef   d	eeeef      d
eeef   fdZ	 ddeeeef   ef   d	eeeef      d
eeef   fdZ	 ddeeeef   ef   d	eeeef      d
eeef   fdZ	 ddeeeef   ef   d	eeeef      d
eeef   fdZ	 ddeeeef   ef   d	eeeef      d
eeef   fdZ	 ddedeeeef   ef   d	eeeef      d
eeef   fdZ	 ddedeeeef   ef   d	eeeef      d
eeef   fdZ	 ddeeeef   ef   d	eeeef      d
eeef   fdZ	 ddeeeef   ef   d	eeeef      d
eeef   fdZ	 ddeeeef   ef   d	eeeef      d
eeef   fdZy)    )AnyOptionalUnion   )_transformers)BaseApiClient)get_value_by_path)set_value_by_pathN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gt        | dg             |S )Ndatadisplay_name6display_name parameter is not supported in Gemini API.	mime_typemimeTypegetvsetv
ValueErrorr   r   	to_objects      ]/var/www/html/eduruby.in/venv/lib/python3.12/site-packages/google/genai/_tokens_converters.py_Blob_to_mldevr      sw     !)	+x ,VHd;9:	+'(4
M
NN	+}%1ZL${[M"BC	    c                     i }t        | dg      1t        |dgt        | dg      D cg c]  }t        ||       c}       t        | dg      t        |dgt        | dg             |S c c}w )Npartsrole)r   r   _Part_to_mldevr   r   r   items       r   _Content_to_mldevr#   +   s     !)	+y!-		 [7)4	
 4+	
 
+x ,VHd;9:		
s   A)
api_clientc                    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        |dg             |S )
Nexpire_time
expireTimenew_session_expire_timenewSessionExpireTimeuseslive_connect_constraintsbidiGenerateContentSetuplock_additional_fields	fieldMask)r   r    _LiveConnectConstraints_to_mldevr$   r   r   r   s       r   _CreateAuthTokenConfig_to_mldevr1   @   s    
 !)	+'3[=/(JK	+123?	 [456 
+x ,${VH"=>	+234@	#$(9:;	
 
+012>	[345 
r   c                 l    i }t        |dg      $t        |dgt        | t        |dg      |             |S )Nconfig)r   r   r1   r0   s       r   #_CreateAuthTokenParameters_to_mldevr4   i   sH    
 !)	+z".	
'[8*5y	
 
r   c                 :    i }t        | dg      t        d      |S )Nr3   z/config parameter is not supported in Vertex AI.)r   r   r   s      r   $_CreateAuthTokenParameters_to_vertexr6   {   s*     !)	+z".
F
GG	r   c                     i }t        | dg      t        d      t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             |S )Nr   r   file_urifileUrir   r   r   r   r   r   s      r   _FileData_to_mldevr;      sw     !)	+'(4
M
NN	+
|$0YKkJ<!@A	+}%1ZL${[M"BC	r   c                     i }t        | dg      t        d      t        | dg      t        |dgt        | dg             |S )Nauth_configz5auth_config parameter is not supported in Gemini API.enable_widgetenableWidgetr:   r   s      r   _GoogleMaps_to_mldevr@      sS     !)	+'3
L
MM	+()5^$d;8I&JK	r   c                     i }t        | dg      t        d      t        | dg      t        d      t        | dg      t        |dgt        | dg             |S )Nexclude_domainsz9exclude_domains parameter is not supported in Gemini API.blocking_confidencez=blocking_confidence parameter is not supported in Gemini API.time_range_filtertimeRangeFilterr:   r   s      r   _GoogleSearch_to_mldevrF      s     !)	+)*+7
C  
+-./;
G  
++,-9%&[;N:O(P 
r   c                    i }t        |dg      t        |ddgt        |dg             t        |dg      t        |g dt        |dg             t        |dg      t        |g dt        |dg             t        |dg      t        |g d	t        |dg             t        |d
g      t        |g dt        |d
g             t        |dg      t        |g dt        |dg             t        |dg      t        |g dt        |dg             t        |dg      t        |g dt        |dg             t        |dg      -t        |g dt        j                  t        |dg                   t        |dg      t        |g dt        |dg             t        |dg      t        |g dt        |dg             t        |dg      7t        |ddgt	        t        j
                  t        |dg            |             t        |dg      Zt        |ddgt        j                  | t        |dg            D cg c]"  }t        t        j                  | |      |      $ c}       t        |dg      $t        |ddgt        t        |dg      |             t        |dg      t        |ddgt        |dg             t        |dg      t        |dd gt        |dg             t        |d!g      t        |dd"gt        |d!g             t        |d#g      t        |dd$gt        |d#g             t        |d%g      t        |dd%gt        |d%g             |S c c}w )&Ngeneration_configsetupgenerationConfigresponse_modalities)rI   rJ   responseModalitiestemperature)rI   rJ   rM   top_p)rI   rJ   topPtop_k)rI   rJ   topKmax_output_tokens)rI   rJ   maxOutputTokensmedia_resolution)rI   rJ   mediaResolutionseed)rI   rJ   rV   speech_config)rI   rJ   speechConfigthinking_config)rI   rJ   thinkingConfigenable_affective_dialog)rI   rJ   enableAffectiveDialogsystem_instructionsystemInstructiontoolssession_resumptionsessionResumptioninput_audio_transcriptioninputAudioTranscriptionoutput_audio_transcriptionoutputAudioTranscriptionrealtime_input_configrealtimeInputConfigcontext_window_compressioncontextWindowCompressionproactivity)
r   r   tt_live_speech_configr#   	t_contentt_tools_Tool_to_mldevt_tool!_SessionResumptionConfig_to_mldev)r$   r   r   r   r"   s        r   _LiveConnectConfig_to_mldevrr      s   
 !)	++,-9	$%[./0 
+-./;;[012 
+'34[=/* 
+y!--[7)$ 
+y!--[7)$ 
++,-98[./0 
+*+,88[-./ 
+x ,-[6(# 
+()55	tK/1BCD 
+)*+77[,-. 
+123?>[456 
+,-.:	%&KK[+?*@ABI	
 
+y!-	' 		*d;	.JK	
 188J5yA	
 
+,-.:	%&)345y	
 
+345A	+,[678 
+456B	,-[789 
+/01=	'([234 
+456B	,-[789 
+'3	- [=/* 
e	
s    'M$c                     i }t        |dg      .t        |ddgt        j                  | t        |dg                   t        |dg      $t        |dgt	        | t        |dg      |             |S )NmodelrI   r3   )r   r   rk   t_modelrr   r0   s       r   r/   r/   R  s    
 !)	+y!-	'			*d;	:; 
+z".	
#[8*5y	
 
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        | 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             |S )Nfunction_callfunctionCallcode_execution_resultcodeExecutionResultexecutable_codeexecutableCode	file_datafileDatafunction_responsefunctionResponseinline_data
inlineDatatextthoughtthought_signaturethoughtSignaturevideo_metadatavideoMetadata)r   r   r;   r   r   s      r   r    r    k  s    !)	+()5^$d;8I&JK	+/01=	[234 
+)*+7%&[;L:M(NO	+}%1	4k];YG 
++,-9	[./0 
+'3	tK-99E 
+x ,VHd;9:	+	{#/YKkI;!?@	++,-9	[./0 
+()*6_%tK:J9K'LM	r   c                     i }t        | dg      t        |dgt        | dg             t        | dg      t        d      |S )Nhandletransparentz5transparent parameter is not supported in Gemini API.r   r   s      r   rq   rq     sP     !)	+z".XJ[8* =>	+'3
L
MM	r   c           
         i }t        | dg      't        |dgt        | dg      D cg c]  }| c}       t        | dg      t        d      t        | dg      t        |dgt        | dg             t        | dg      t        |dgt        | dg             t        | d	g      t        |d
gt        | d	g             t        | dg      t        |dgt        | dg             t        | dg      t        d      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             |S c c}w )Nfunction_declarationsfunctionDeclarations	retrievalz3retrieval parameter is not supported in Gemini API.google_search_retrievalgoogleSearchRetrievalcomputer_usecomputerUsefile_search
fileSearchcode_executioncodeExecutionenterprise_web_searchz?enterprise_web_search parameter is not supported in Gemini API.google_maps
googleMapsgoogle_searchgoogleSearchurl_context
urlContext)r   r   r   r@   rF   r!   s       r   ro   ro     s    !)	+/01=	 {-D,EFG$G 
+}%1
J
KK	+123?	 ![456 
+'(4]OT+7G%HI	+'3\ND}o$FG	+()*6_%tK:J9K'LM	+/01=
I  
+'3	T+?K 
+()5	tK/1BCYO 
+'3\ND}o$FG	Y 	Hs   	F)N)typingr   r   r    r   rk   _api_clientr   _commonr	   r   r
   r   dictstrobjectr   r#   r1   r4   r6   r;   r@   rF   rr   r/   r    rq   ro    r   r   <module>r      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(^	&X /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(^4 /3SStCH~v-.S DcN+S 
#s(^	Sr /3tCH~v-. DcN+ 
#s(^	6 /37tCH~v-.7DcN+7 
#s(^7x /3tCH~v-.DcN+ 
#s(^  /35tCH~v-.5DcN+5 
#s(^5r   