o
    pkj/                     @   s  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 	dpdeeeef ef d	eeeef  d
eeef fddZ	dpdeeeef ef d	eeeef  d
eeef fddZ	dpdeeeef ef d	eeeef  d
eeef fddZ	dpdeeeef ef d	eeeef  d
eeef fddZ	dpdeeeef ef d	eeeef  d
eeef fddZ	dpdeeeef ef d	eeeef  d
eeef fddZ	dpdeeeef ef d	eeeef  d
eeef fddZ	dpdeeeef ef d	eeeef  d
eeef fddZ	dpdeeeef ef d	eeeef  d
eeef fddZ	dpdeeeef ef d	eeeef  d
eeef fddZ	dpdeeeef ef d	eeeef  d
eeef fdd Z	dpdeeeef ef d	eeeef  d
eeef fd!d"Z	dpd#edeeeef ef d	eeeef  d
eeef fd$d%Z	dpd#edeeeef ef d	eeeef  d
eeef fd&d'Z	dpdeeeef ef d	eeeef  d
eeef fd(d)Z	dpdeeeef ef d	eeeef  d
eeef fd*d+Z 	dpd#edeeeef ef d	eeeef  d
eeef fd,d-Z!	dpd#edeeeef ef d	eeeef  d
eeef fd.d/Z"	dpd#edeeeef ef d	eeeef  d
eeef fd0d1Z#	dpd#edeeeef ef d	eeeef  d
eeef fd2d3Z$	dpd#edeeeef ef d	eeeef  d
eeef fd4d5Z%	dpd#edeeeef ef d	eeeef  d
eeef fd6d7Z&	dpdeeeef ef d	eeeef  d
eeef fd8d9Z'	dpdeeeef ef d	eeeef  d
eeef fd:d;Z(	dpdeeeef ef d	eeeef  d
eeef fd<d=Z)	dpdeeeef ef d	eeeef  d
eeef fd>d?Z*	dpdeeeef ef d	eeeef  d
eeef fd@dAZ+	dpdeeeef ef d	eeeef  d
eeef fdBdCZ,	dpdeeeef ef d	eeeef  d
eeef fdDdEZ-	dpdeeeef ef d	eeeef  d
eeef fdFdGZ.	dpdeeeef ef d	eeeef  d
eeef fdHdIZ/	dpdeeeef ef d	eeeef  d
eeef fdJdKZ0	dpdeeeef ef d	eeeef  d
eeef fdLdMZ1	dpdeeeef ef d	eeeef  d
eeef fdNdOZ2	dpdeeeef ef d	eeeef  d
eeef fdPdQZ3	dpdeeeef ef d	eeeef  d
eeef fdRdSZ4	dpdeeeef ef d	eeeef  d
eeef fdTdUZ5	dpdeeeef ef d	eeeef  d
eeef fdVdWZ6	dpdeeeef ef d	eeeef  d
eeef fdXdYZ7	dpdeeeef ef d	eeeef  d
eeef fdZd[Z8	dpdeeeef ef d	eeeef  d
eeef fd\d]Z9	dpdeeeef ef d	eeeef  d
eeef fd^d_Z:	dpdeeeef ef d	eeeef  d
eeef fd`daZ;	dpdeeeef ef d	eeeef  d
eeef fdbdcZ<	dpdeeeef ef d	eeeef  d
eeef fdddeZ=	dpdeeeef ef d	eeeef  d
eeef fdfdgZ>	dpdeeeef ef d	eeeef  d
eeef fdhdiZ?	dpdeeeef ef d	eeeef  d
eeef fdjdkZ@	dpdeeeef ef d	eeeef  d
eeef fdldmZA	dpdeeeef ef d	eeeef  d
eeef fdndoZBdS )q    )AnyOptionalUnion   )_transformers)BaseApiClient)get_value_by_path)set_value_by_pathNfrom_objectparent_objectreturnc                 C   s   i }t | dgd urt|dgt | dg t | dgd ur!tdt | dgd ur-tdt | dgd ur9tdt | d	gd urEtd
t | dgd urQtdt | dgd ur]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_object r   [/home/djax/ivt_ai_plugin/venv/lib/python3.10/site-packages/google/genai/_live_converters.py_AuthConfig_to_mldev   s8   r   c                 C   sl   i }t | dgd urt|dgt | dg t | dgd ur!tdt | dgd ur4t|dgt | dg |S )Ndatadisplay_nametdisplay_name parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.	mime_typemimeTyper   r   r   r   r   _Blob_to_mldevI      r#   c                 C   s   i }t | dgd urt|dgt | dg t | dgd ur(t|dgt | dg t | dgd ur;t|dgt | dg t | dgd urGtd|S )Nenvironmentexcluded_predefined_functionsexcludedPredefinedFunctions!enable_prompt_injection_detectionenablePromptInjectionDetectiondisabled_safety_policieszdisabled_safety_policies parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.r   r   r   r   r   _ComputerUse_to_vertex]   s(   

r+   c                    b   i  t | dgd urt dg fddt | dgD  t | dgd ur/t dgt | dg  S )Npartsc                       g | ]}t | qS r   )_Part_to_mldev.0itemr   r   r   
<listcomp>       z%_Content_to_mldev.<locals>.<listcomp>roler   r   r
   r   r   r3   r   _Content_to_mldev|      

	r9   c                    r,   )Nr-   c                    r.   r   )_Part_to_vertexr0   r3   r   r   r4      r5   z&_Content_to_vertex.<locals>.<listcomp>r6   r7   r8   r   r3   r   _Content_to_vertex   r:   r<   c                 C   sl   i }t | dgd urtdt | dgd ur!t|dgt | dg t | dgd ur4t|dgt | dg |S )Nr   r    file_urifileUrir!   r"   )r   r   r   r   r   r   r   _FileData_to_mldev   s   r?   c                 C   s   i }t | dgd urt|dgt | dg t | dgd ur(t|dgt | dg t | dgd ur;t|dgt | dg t | dgd urGtdt | dgd urStd|S )Nidargsname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   r   r   r   _FunctionCall_to_mldev   s    rE   c                 C   s  i }t | dgd urt|dgt | dg t | dgd ur+t|dgtt | dg t | dgd ur>t|dgt | dg t | dgd urQt|dgt | dg t | d	gd urdt|d
gt | d	g t | dgd urwt|dgt | dg t | dgd urt|dgt | dg t | dgd urt|dgt | dg t | dgd urt|dgt | dg t | dgd urt|dgt | dg t | dgd urt|dgt | dg t | dgd urt|dgt | dg t | dgd urt|dgt | dg t | dgd urt|dgt | dg t | dgd ur$t|dgt | dg t | dgd ur8t|dgt | dg t | dgd urOt|d gtt | dg| t | d!gd urct|d"gt | d!g t | d#gd urwt|d#gt | d#g t | d$gd urt|d%gt | d$g t | d&gd urt|d'gt | d&g t | d(gd urt|d)gt | d(g t | d*gd urtd+t | d,gd urt|d-gd.d/ t | d,gD  t | d0gd urtd1t | d2gd urt|d3gt | d2g |S )4Nmodel_selection_configmodelConfigresponse_json_schemaresponseJsonSchemaaudio_timestampaudioTimestampcandidate_countcandidateCountenable_affective_dialogenableAffectiveDialogfrequency_penaltyfrequencyPenaltylogprobsmax_output_tokensmaxOutputTokensmedia_resolutionmediaResolutionpresence_penaltypresencePenaltyresponse_logprobsresponseLogprobsresponse_mime_typeresponseMimeTyperesponse_modalitiesresponseModalitiesresponse_schemaresponseSchemarouting_configroutingConfigseedspeech_configspeechConfigstop_sequencesstopSequencestemperaturethinking_configthinkingConfigtop_ktopKtop_ptopPenable_enhanced_civic_answerszenable_enhanced_civic_answers parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.response_formatresponseFormatc                 S      g | ]}|qS r   r   r0   r   r   r   r4   P      z/_GenerationConfig_to_vertex.<locals>.<listcomp>translation_configzztranslation_config parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.audio_transcription_configaudioTranscriptionConfig)r   r   tt_json_schema_SpeechConfig_to_vertexr   r   r   r   r   _GenerationConfig_to_vertex   s   






rz   c                 C   sr   i }t | dgd urt|dgtt | dg| t | dgd ur+t|dgt | dg t | dgd ur7td|S )Nauth_config
authConfigenable_widgetenableWidgetgrounding_typeszwgrounding_types parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.)r   r   r   r   r   r   r   r   _GoogleMaps_to_mldevc  s   r   c                 C   s   i }t | dgd urt|dgt | dg t | dgd ur!tdt | dgd ur-tdt | dgd ur@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   r   r   r   _GoogleSearch_to_mldev{  s    r   c                    b   i  t | dgd urt dg fddt | dgD  t | dgd ur/t dgt | dg  S )Nturnsc                    r.   r   )r9   r0   r3   r   r   r4     r5   z/_LiveClientContent_to_mldev.<locals>.<listcomp>turn_completeturnCompleter7   r8   r   r3   r   _LiveClientContent_to_mldev  r:   r   c                    r   )Nr   c                    r.   r   )r<   r0   r3   r   r   r4     r5   z0_LiveClientContent_to_vertex.<locals>.<listcomp>r   r   r7   r8   r   r3   r   _LiveClientContent_to_vertex  r:   r   
api_clientc                 C      i }t |dgd urt|dgt| t |dg| t |dgd ur/t|dgtt |dg| t |dgd urEt|dgtt |dg| t |dgd urXt|dgt |dg |S Nsetupclient_contentclientContentrealtime_inputrealtimeInputtool_responsetoolResponse)r   r   _LiveClientSetup_to_mldevr   !_LiveClientRealtimeInput_to_mldevr   r
   r   r   r   r   r   _LiveClientMessage_to_mldev  8   r   c                 C   r   r   )r   r   _LiveClientSetup_to_vertexr   "_LiveClientRealtimeInput_to_vertexr   r   r   r   _LiveClientMessage_to_vertex  r   r   c                    s,  i  t | dgd urt dg fddt | dgD  t | dgd ur2t dgtt | dg  t | dgd urEt dgt | dg t | dgd ur[t dgtt | dg  t | d	gd urnt d	gt | d	g t | d
gd urt dgt | d
g t | dgd urt dgt | dg  S )Nmedia_chunksmediaChunksc                    r.   r   r#   r0   r3   r   r   r4     r5   z5_LiveClientRealtimeInput_to_mldev.<locals>.<listcomp>audioaudio_stream_endaudioStreamEndvideotextactivity_startactivityStartactivity_endactivityEnd)r   r   r#   r8   r   r3   r   r     s<   

	r   c                 C   s  i }t | dgd urt|dgdd t | dgD  t | dgd ur-t|dgt | dg t | dgd ur9tdt | dgd urLt|dgt | dg t | d	gd ur_t|d	gt | d	g t | d
gd urrt|dgt | d
g t | dgd urt|dgt | dg |S )Nr   r   c                 S   rr   r   r   r0   r   r   r   r4   D  rs   z6_LiveClientRealtimeInput_to_vertex.<locals>.<listcomp>r   r   zxaudio_stream_end parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.r   r   r   r   r   r   r   r   r   r   r   r   ;  s,   r   c              
      s"  i t |dgd urtdgt |dg t |dgd ur(tdgt |dg t |dgd urAtdgttt |dg t |dgd ur`tdg fddt t |dgD  t |d	gd urvtd
gtt |d	g t |dgd urtdgt |dg t |dgd urtdgt |dg t |dgd urtdgt |dg t |dgd urtdgt |dg t |dgd urtdt |dgd urtdgt |dg t |dgd urtdgt |dg t |dgd urtdgfddt |dgD  S )Nmodelgeneration_configgenerationConfigsystem_instructionsystemInstructiontoolsc                       g | ]}t t |qS r   _Tool_to_mldevrw   t_toolr0   r   r   r   r   r4   |      z-_LiveClientSetup_to_mldev.<locals>.<listcomp>session_resumptionsessionResumptioncontext_window_compressioncontextWindowCompressioninput_audio_transcriptioninputAudioTranscriptionoutput_audio_transcriptionoutputAudioTranscriptionproactivityexplicit_vad_signal{explicit_vad_signal parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.history_confighistoryConfigavatar_configavatarConfigsafety_settingssafetySettingsc                    r.   r   _SafetySetting_to_mldevr0   r3   r   r   r4     r5   )r   r   r9   rw   	t_contentt_tools!_SessionResumptionConfig_to_mldevr   r   r
   r   r   r   r   r   _  s   
	




	r   c              
      s,  i t |dgd urtdgt |dg t |dgd ur+tdgtt |dg t |dgd urDtdgttt |dg t |dgd urctdg fddt t |dgD  t |d	gd urvtd
gt |d	g t |dgd urtdgt |dg t |dgd urtdgt |dg t |dgd urtdgt |dg t |dgd urtdgt |dg t |dgd urtdgt |dg t |dgd urtdgt |dg t |dgd urtdgt |dg t |dgd urtdgdd t |dgD  S )Nr   r   r   r   r   r   c                    r   r   _Tool_to_vertexrw   r   r0   r   r   r   r4     r   z._LiveClientSetup_to_vertex.<locals>.<listcomp>r   r   r   r   r   r   r   r   r   r   explicitVadSignalr   r   r   r   r   r   c                 S   rr   r   r   r0   r   r   r   r4     rs   )r   r   rz   r<   rw   r   r   r   r   r   r   r     s   	




r   c              
      s  i t |dgd urt|ddgt |dg t |dgd ur*t|g dt |dg t |dgd ur>t|g dt |dg t |dgd urRt|g d	t |dg t |d
gd urft|g dt |d
g t |dgd urzt|g dt |dg t |dgd urt|g dt |dg t |dgd urt|g dt |dg t |dgd urt|g dtt |dg t |dgd urt|g dt |dg t |dgd urt|g dt |dg t |dgd urt|ddgttt |dg t |dgd urt|ddg fddt t |dgD  t |dgd ur4t|ddgtt |dg t |dgd urIt|dd gt |dg t |d!gd ur^t|dd"gt |d!g t |d#gd urst|dd$gt |d#g t |d%gd urt|dd&gt |d%g t |d'gd urt|dd'gt |d'g t |d(gd urtd)t |d*gd urt|dd+gt |d*g t |d,gd urt|dd-gt |d,g t |d.gd urt|dd/gfd0dt |d.gD  t |d1gd urt|g d2t	t |d1g S )3Nr   r   r   r]   r   r   r^   rh   r   r   rh   rm   r   r   rn   rk   r   r   rl   rS   r   r   rT   rU   r   r   rV   rc   r   r   rc   rd   r   r   re   ri   r   r   rj   rN   r   r   rO   r   r   r   c                    r   r   r   r0   r   r   r   r4   x  r   z/_LiveConnectConfig_to_mldev.<locals>.<listcomp>r   r   r   r   r   r   realtime_input_configrealtimeInputConfigr   r   r   r   r   r   r   r   r   r   r   c                    r.   r   r   r0   r3   r   r   r4     r5   rt   r   r   translationConfig)
r   r   rw   t_live_speech_configr9   r   r   r   r   _TranslationConfig_to_mldevr   r   r   r   _LiveConnectConfig_to_mldev  s4  









	








	r   c              
      s(  i t |dgd urt|ddgtt |dg t |dgd ur-t|g dt |dg t |dgd urAt|g dt |dg t |dgd urUt|g d	t |dg t |d
gd urit|g dt |d
g t |dgd ur}t|g dt |dg t |dgd urt|g dt |dg t |dgd urt|g dt |dg t |dgd urt|g dttt |dg t |dgd urt|g dt |dg t |dgd urt|g dt |dg t |dgd urt|ddgttt |dg t |dgd ur#t|ddg fddt t |dgD  t |dgd ur8t|ddgt |dg t |dgd urMt|dd gt |dg t |d!gd urbt|dd"gt |d!g t |d#gd urwt|dd$gt |d#g t |d%gd urt|dd&gt |d%g t |d'gd urt|dd'gt |d'g t |d(gd urt|dd)gt |d(g t |d*gd urt|dd+gt |d*g t |d,gd urt|dd-gt |d,g t |d.gd urt|dd/gd0d t |d.gD  t |d1gd urt|g d2t	t |d1g S )3Nr   r   r   r]   r   rh   r   rm   r   rk   r   rS   r   rU   r   rc   r   rd   r   ri   r   rN   r   r   r   r   c                    r   r   r   r0   r   r   r   r4   :  r   z0_LiveConnectConfig_to_vertex.<locals>.<listcomp>r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   c                 S   rr   r   r   r0   r   r   r   r4     rs   rt   r   )
r   r   rz   ry   rw   r   r<   r   r   _TranslationConfig_to_vertexr   r   r   r   _LiveConnectConfig_to_vertex  s:  






	

	








r   c              	   C   f   i }t |dgd urt|ddgt| t |dg t |dgd ur1t|dgt| t |dg| |S Nr   r   config)r   r   rw   t_modelr   r   r   r   r   _LiveConnectParameters_to_mldev      r   c              	   C   r   r   )r   r   rw   r   r   r   r   r   r    _LiveConnectParameters_to_vertex  r   r   c                 C   sh   i }t | dgd urtdt | dgd urtdt | dgd ur&tdt | dgd ur2td|S )	Nr   zmsetup parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.r   zvclient_content parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.music_generation_configmusic_generation_config parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.playback_controlzxplayback_control parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.r   r   r   r   r   r   !_LiveMusicClientMessage_to_vertex  s$   r   c                 C   s0   i }t | dgd urt|ddgt | dg |S )Nr   r   r7   r   r   r   r   $_LiveMusicConnectParameters_to_mldev  s   r   c                 C       i }t | dgd urtd|S )Nr   zmmodel parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.r   r   r   r   r   %_LiveMusicConnectParameters_to_vertex     r   c                 C   s.   i }t | dgd urt|dgt | dg |S )Nr   musicGenerationConfigr7   r   r   r   r   &_LiveMusicSetConfigParameters_to_mldev  s   
r   c                 C   r   )Nr   r   r   r   r   r   r   '_LiveMusicSetConfigParameters_to_vertex  r   r   c                 C   s8   i }t | dgd urt|dgdd t | dgD  |S )Nweighted_promptsweightedPromptsc                 S   rr   r   r   r0   r   r   r   r4   #  rs   zC_LiveMusicSetWeightedPromptsParameters_to_mldev.<locals>.<listcomp>r7   r   r   r   r   /_LiveMusicSetWeightedPromptsParameters_to_mldev  s   r   c                 C   r   )Nr   zxweighted_prompts parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.r   r   r   r   r   0_LiveMusicSetWeightedPromptsParameters_to_vertex)  r   r   c              	      s>  i  t | dgd urt dg fddtt | dgD  t | dgd ur8t dgttt | dg  t | dgd urKt dgt | dg t | dgd urdt dgttt | dg  t | d	gd urwt d	gt | d	g t | d
gd urt dgt | d
g t | dgd urt dgt | dg  S )Nmediar   c                    r.   r   r   r0   r3   r   r   r4   @  r5   z=_LiveSendRealtimeInputParameters_to_mldev.<locals>.<listcomp>r   r   r   r   r   r   r   r   r   )r   r   rw   t_blobsr#   t_audio_blobt_image_blobr8   r   r3   r   )_LiveSendRealtimeInputParameters_to_mldev7  s<   
	r   c              	   C   s.  i }t | dgd urt|dgdd tt | dgD  t | dgd ur3t|dgtt | dg t | dgd urFt|dgt | dg t | dgd ur\t|dgtt | dg t | d	gd urot|d	gt | d	g t | d
gd urt|dgt | d
g t | dgd urt|dgt | dg |S )Nr   r   c                 S   rr   r   r   r0   r   r   r   r4   l  rs   z>_LiveSendRealtimeInputParameters_to_vertex.<locals>.<listcomp>r   r   r   r   r   r   r   r   r   )r   r   rw   r   r   r   r   r   r   r   *_LiveSendRealtimeInputParameters_to_vertexc  s(   r  c                 C   sd  i }t | dgd urt|dgt | dg t | dgd ur(t|dgt | dg t | dgd ur;t|dgt | dg t | dgd urNt|dgt | dg t | d	gd urat|d
gt | d	g t | dgd urtt|dgt | dg t | dgd urt|dgt | dg t | dgd urt|dgt | dg t | dgd urt|dgtt | dg| |S NsetupCompletesetup_completeserverContentserver_contenttoolCall	tool_calltoolCallCancellationtool_call_cancellationusageMetadatausage_metadatagoAwaygo_awaysessionResumptionUpdatesession_resumption_updatevoiceActivityDetectionSignalvoice_activity_detection_signalvoiceActivityvoice_activity)r   r   _VoiceActivity_from_mldevr   r   r   r   _LiveServerMessage_from_mldev  sL   


r  c                 C   sj  i }t | dgd urt|dgt | dg t | dgd ur(t|dgt | dg t | dgd ur;t|dgt | dg t | dgd urNt|dgt | dg t | d	gd urdt|d
gtt | d	g| t | dgd urwt|dgt | dg t | dgd urt|dgt | dg t | dgd urt|dgt | dg t | dgd urt|dgtt | dg| |S r  )r   r   _UsageMetadata_from_vertex_VoiceActivity_from_vertexr   r   r   r   _LiveServerMessage_from_vertex  sX   


r  c                 C   s8   i }t | dgd urtdt | dgd urtd|S )NrB   zlname parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.streamable_http_transportzstreamable_http_transport parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.r   r   r   r   r   _McpServer_to_vertex  s   r  c                    s<   i  t | dgd urt dg fddt | dgD   S )Nspeaker_voice_configsspeakerVoiceConfigsc                    r.   r   )_SpeakerVoiceConfig_to_vertexr0   r3   r   r   r4     r5   z6_MultiSpeakerVoiceConfig_to_vertex.<locals>.<listcomp>r7   r8   r   r3   r   "_MultiSpeakerVoiceConfig_to_vertex  s   

	r  c                 C   s  i }t | dgd urt|dgt | dg t | dgd ur(t|dgt | dg t | dgd ur;t|dgt | dg t | dgd urQt|dgtt | dg| t | d	gd urgt|d
gtt | d	g| t | dgd urzt|dgt | dg t | dgd urt|dgtt | dg| t | dgd urt|dgt | dg t | dgd urt|dgt | dg t | dgd urt|dgt | dg t | dgd urt|dgt | dg t | dgd urt|dgt | dg t | dgd urt|dgt | dg t | dgd urt|dgt | dg t | dgd ur+t|dgt | dg t | dgd ur?t|dgt | dg |S )NrU   rV   code_execution_resultcodeExecutionResultexecutable_codeexecutableCode	file_datafileDatafunction_callfunctionCallfunction_responsefunctionResponseinline_data
inlineDatar   thoughtthought_signaturethoughtSignaturevideo_metadatavideoMetadatar  r  r   r   part_metadatapartMetadataaudio_transcriptionaudioTranscriptionmedia_processingmediaProcessing)r   r   r?   rE   r#   r   r   r   r   r/     s   



r/   c                 C   sB  i }t | dgd urt|dgt | dg t | dgd ur(t|dgt | dg t | dgd ur;t|dgt | dg t | dgd urNt|dgt | dg t | d	gd urat|d
gt | d	g t | dgd urtt|dgt | dg t | dgd urt|dgt | dg t | dgd urt|dgt | dg t | dgd urt|dgt | dg t | dgd urt|dgt | dg t | dgd urt|dgt | dg t | dgd urtdt | dgd urtdt | dgd urtdt | dgd urt|dgt | dg t | dgd urt|dgt | dg |S )NrU   rV   r   r!  r"  r#  r$  r%  r&  r'  r(  r)  r*  r+  r   r,  r-  r.  r/  r0  r  zqtool_call parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.r   zutool_response parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.r1  zupart_metadata parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.r3  r4  r5  r6  r   r   r   r   r   r;   r  sx   



r;   c                 C   s   i }t | dgd urt|dgt | dg t | dgd ur(t|dgt | dg t | dgd ur4tdt | dgd ur@td|S )	Nr!   r"   voice_sample_audiovoiceSampleAudioconsent_audiozuconsent_audio parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.voice_consent_signaturezvoice_consent_signature parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.r   r   r   r   r    _ReplicatedVoiceConfig_to_vertex  s$   
r;  c                 C   sl   i }t | dgd urt|dgt | dg t | dgd ur!tdt | dgd ur4t|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   r   r   r   r     r$   r   c                 C   sF   i }t | dgd urt|dgt | dg t | dgd ur!td|S )Nhandletransparentzstransparent parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.r   r   r   r   r   r     s   r   c                 C   sZ   i }t | dgd urt|dgt | dg t | dgd ur+t|dgtt | dg| |S )Nspeakervoice_configvoiceConfig)r   r   _VoiceConfig_to_vertexr   r   r   r   r  
  s   r  c                 C   s   i }t | dgd urt|dgtt | dg| t | dgd ur+t|dgt | dg t | dgd urAt|dgtt | dg| |S )NrB  rC  language_codelanguageCodemulti_speaker_voice_configmultiSpeakerVoiceConfig)r   r   rD  r  r   r   r   r   ry     s$   ry   c                 C   s  i }t | dgd urtdt | dgd ur!t|dgt | dg t | dgd ur4t|dgt | dg t | dgd urJt|dgtt | dg| t | d	gd ur`t|d
gtt | d	g| t | dgd urst|dgt | dg t | dgd urtdt | dgd urt|dgdd t | dgD  t | dgd urt|dgt | dg t | dgd urtdt | dgd urt|dgt | dg t | dgd urt|dgdd t | dgD  t | dgd urt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                 S   rr   r   r   r0   r   r   r   r4   c  rs   z"_Tool_to_mldev.<locals>.<listcomp>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                 S   rr   r   r   r0   r   r   r   r4   z  rs   exa_ai_searchzuexa_ai_search parameter is only supported in Gemini Enterprise Agent Platform mode, not in Gemini Developer API mode.)r   r   r   r   r   r   r   r   r   r   7  sp   
r   c                    s  i  t | dgd urt dgt | dg t | dgd ur+t dgtt | dg  t | dgd ur7tdt | dgd urJt dgt | dg t | dgd ur]t d	gt | dg t | d
gd urpt dgt | d
g t | dgd urt dgt | dg t | dgd urt dgdd t | dgD  t | dgd urt dgt | dg t | dgd urt dgt | dg t | dgd urt dgt | dg t | dgd urt dg fddt | dgD  t | dgd urt dgt | dg  S )NrI  rJ  rK  rL  zsfile_search parameter is only supported in Gemini Developer API mode, not in Gemini Enterprise Agent Platform mode.rN  rO  rP  rQ  rR  rS  rT  enterpriseWebSearchrU  rV  c                 S   rr   r   r   r0   r   r   r   r4     rs   z#_Tool_to_vertex.<locals>.<listcomp>rW  rX  rY  parallelAiSearchrZ  r[  r\  r]  c                    r.   r   )r  r0   r3   r   r   r4     r5   r^  exaAiSearch)r   r   r+   r   r8   r   r3   r   r     sp   




	r   c                 C   T   i }t | dgd urt|dgt | dg t | dgd ur(t|dgt | dg |S Necho_target_languageechoTargetLanguagetarget_language_codetargetLanguageCoder7   r   r   r   r   r        

r   c                 C   rb  rc  r7   r   r   r   r   r     rh  r   c                 C   s  i }t | dgd urt|dgt | dg t | dgd ur(t|dgt | dg t | dgd ur;t|dgt | dg t | dgd urNt|dgt | dg t | d	gd urat|d
gt | d	g t | dgd urtt|dgt | dg t | dgd urt|dgdd t | dgD  t | dgd urt|dgdd t | dgD  t | dgd urt|dgdd t | dgD  t | dgd urt|dgdd t | dgD  t | dgd urt|dgt | dg |S )NpromptTokenCountprompt_token_countcachedContentTokenCountcached_content_token_countcandidatesTokenCountresponse_token_counttoolUsePromptTokenCounttool_use_prompt_token_countthoughtsTokenCountthoughts_token_counttotalTokenCounttotal_token_countpromptTokensDetailsprompt_tokens_detailsc                 S   rr   r   r   r0   r   r   r   r4   0  rs   z._UsageMetadata_from_vertex.<locals>.<listcomp>cacheTokensDetailscache_tokens_detailsc                 S   rr   r   r   r0   r   r   r   r4   7  rs   candidatesTokensDetailsresponse_tokens_detailsc                 S   rr   r   r   r0   r   r   r   r4   >  rs   toolUsePromptTokensDetailstool_use_prompt_tokens_detailsc                 S   rr   r   r   r0   r   r   r   r4   E  rs   trafficTypetraffic_typer7   r   r   r   r   r    s|   




r  c                 C   rb  Ntypevoice_activity_typeaudioOffsetaudio_offsetr7   r   r   r   r   r  N     r  c                 C   rb  r  r7   r   r   r   r   r  \  r  r  c                 C   sZ   i }t | dgd urt|dgtt | dg| t | dgd ur+t|dgt | dg |S )Nreplicated_voice_configreplicatedVoiceConfigprebuilt_voice_configprebuiltVoiceConfig)r   r   r;  r   r   r   r   rD  j  s    
rD  )N)Ctypingr   r   r    r   rw   _api_clientr   _commonr   r   r	   r   dictstrobjectr   r#   r+   r9   r<   r?   rE   rz   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r/   r;   r;  r   r   r  ry   r   r   r   r   r  r  r  rD  r   r   r   r   <module>   sP  

1



!









 









*

)

.

'

`

^

 A

 B





"













.

#

7

=





Z

W

 









Q

O





Q




