o
    Yi                     @   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 	d`deeeef ef d	eeeef  d
eeef fddZ	d`deeeef ef d	eeeef  d
eeef fddZ	d`deeeef ef d	eeeef  d
eeef fddZ	d`deeeef ef d	eeeef  d
eeef fddZ	d`deeeef ef d	eeeef  d
eeef fddZ	d`deeeef ef d	eeeef  d
eeef fddZ	d`deeeef ef d	eeeef  d
eeef fddZ	d`deeeef ef d	eeeef  d
eeef fddZ	d`deeeef ef d	eeeef  d
eeef fddZ	d`deeeef ef d	eeeef  d
eeef fddZ	d`deeeef ef d	eeeef  d
eeef fdd Z	d`deeeef ef d	eeeef  d
eeef fd!d"Z	d`deeeef ef d	eeeef  d
eeef fd#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&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(d)Z	d`deeeef ef d	eeeef  d
eeef fd*d+Z 	d`deeeef ef d	eeeef  d
eeef fd,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.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d0d1Z#	d`d%edeeeef ef d	eeeef  d
eeef fd2d3Z$	d`d%edeeeef ef d	eeeef  d
eeef fd4d5Z%	d`d%edeeeef ef d	eeeef  d
eeef fd6d7Z&	d`d%edeeeef ef d	eeeef  d
eeef fd8d9Z'	d`deeeef ef d	eeeef  d
eeef fd:d;Z(	d`deeeef ef d	eeeef  d
eeef fd<d=Z)	d`deeeef ef d	eeeef  d
eeef fd>d?Z*	d`deeeef ef d	eeeef  d
eeef fd@dAZ+	d`deeeef ef d	eeeef  d
eeef fdBdCZ,	d`deeeef ef d	eeeef  d
eeef fdDdEZ-	d`deeeef ef d	eeeef  d
eeef fdFdGZ.	d`deeeef ef d	eeeef  d
eeef fdHdIZ/	d`deeeef ef d	eeeef  d
eeef fdJdKZ0	d`deeeef ef d	eeeef  d
eeef fdLdMZ1	d`deeeef ef d	eeeef  d
eeef fdNdOZ2	d`deeeef ef d	eeeef  d
eeef fdPdQZ3	d`deeeef ef d	eeeef  d
eeef fdRdSZ4	d`deeeef ef d	eeeef  d
eeef fdTdUZ5	d`deeeef ef d	eeeef  d
eeef fdVdWZ6	d`deeeef ef d	eeeef  d
eeef fdXdYZ7	d`deeeef ef d	eeeef  d
eeef fdZd[Z8	d`deeeef ef d	eeeef  d
eeef fd\d]Z9	d`deeeef ef d	eeeef  d
eeef fd^d_Z:dS )a    )AnyOptionalUnion   )_transformers)BaseApiClient)get_value_by_path)set_value_by_pathNfrom_objectparent_objectreturnc                 C       i }t | dgd urtd|S )NZlanguage_codesz8language_codes parameter is not supported in Gemini API.getv
ValueErrorr
   r   	to_object r   W/home/kim/smarthome/.venv/lib/python3.10/site-packages/google/genai/_live_converters.py"_AudioTranscriptionConfig_to_mldev      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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 )NZapi_keyZapiKeyZapi_key_configz8api_key_config parameter is not supported in Gemini API.Z	auth_typez3auth_type parameter is not supported in Gemini API.Zgoogle_service_account_configzGgoogle_service_account_config parameter is not supported in Gemini API.Zhttp_basic_auth_configz@http_basic_auth_config parameter is not supported in Gemini API.Zoauth_configz6oauth_config parameter is not supported in Gemini API.Zoidc_configz5oidc_config parameter is not supported in Gemini API.r   setvr   r   r   r   r   _AuthConfig_to_mldev%   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datadisplay_name6display_name parameter is not supported in Gemini API.	mime_typemimeTyper   r   r   r   r   _Blob_to_mldevG   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>a       z%_Content_to_mldev.<locals>.<listcomp>roler   r   r
   r   r   r'   r   _Content_to_mldevX      

	r-   c                    r    )Nr!   c                    r"   r   )_Part_to_vertexr$   r'   r   r   r(   v   r)   z&_Content_to_vertex.<locals>.<listcomp>r*   r+   r,   r   r'   r   _Content_to_vertexm   r.   r0   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   Zfile_uriZfileUrir   r   )r   r   r   r   r   r   r   _FileData_to_mldev   s   r1   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_argsz6partial_args parameter is not supported in Gemini API.Zwill_continuez7will_continue parameter is not supported in Gemini API.r   r   r   r   r   _FunctionCall_to_mldev   s   r6   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
|S )Ndescriptionr4   
parametersZparameters_json_schemaZparametersJsonSchemaresponseresponse_json_schemaresponseJsonSchemaZbehaviorz1behavior parameter is not supported in Vertex AI.r   r   r   r   r   _FunctionDeclaration_to_vertex   s0   

r<   c                 C   sx  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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r5t|dgt | dg t | dgd urIt|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 | 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+|S ),NZmodel_selection_configZmodelConfigr:   r;   Zaudio_timestampZaudioTimestampZcandidate_countZcandidateCountenable_affective_dialogenableAffectiveDialogZfrequency_penaltyZfrequencyPenaltyZlogprobsmax_output_tokensmaxOutputTokensmedia_resolutionmediaResolutionZpresence_penaltyZpresencePenaltyZresponse_logprobsZresponseLogprobsZresponse_mime_typeZresponseMimeTyperesponse_modalitiesresponseModalitiesZresponse_schemaZresponseSchemaZrouting_configZroutingConfigseedspeech_configspeechConfigZstop_sequencesZstopSequencestemperaturethinking_configthinkingConfigtop_ktopKtop_ptopPZenable_enhanced_civic_answerszFenable_enhanced_civic_answers parameter is not supported in Vertex AI.r   r   r   r   r   _GenerationConfig_to_vertex   s   






rO   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 )NZauth_configZ
authConfigZenable_widgetZenableWidget)r   r   r   r   r   r   r   _GoogleMaps_to_mldev@  s   rP   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 )	NZsearch_typesZsearchTypesZblocking_confidencez=blocking_confidence parameter is not supported in Gemini API.Zexclude_domainsz9exclude_domains parameter is not supported in Gemini API.Ztime_range_filterZtimeRangeFilterr   r   r   r   r   _GoogleSearch_to_mldevR  s    rQ   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   )r-   r$   r'   r   r   r(   u  r)   z/_LiveClientContent_to_mldev.<locals>.<listcomp>turn_completeturnCompleter+   r,   r   r'   r   _LiveClientContent_to_mldevl  r.   rV   c                    rR   )NrS   c                    r"   r   )r0   r$   r'   r   r   r(     r)   z0_LiveClientContent_to_vertex.<locals>.<listcomp>rT   rU   r+   r,   r   r'   r   _LiveClientContent_to_vertex  r.   rW   
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_contentZclientContentZrealtime_inputZrealtimeInputtool_responsetoolResponse)r   r   _LiveClientSetup_to_mldevrV   !_LiveClientRealtimeInput_to_mldevrX   r
   r   r   r   r   r   _LiveClientMessage_to_mldev  8   rb   c                 C   rY   rZ   )r   r   _LiveClientSetup_to_vertexrW   "_LiveClientRealtimeInput_to_vertexra   r   r   r   _LiveClientMessage_to_vertex  rc   rf   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   r$   r'   r   r   r(     r)   z5_LiveClientRealtimeInput_to_mldev.<locals>.<listcomp>audioaudio_stream_endaudioStreamEndvideotextactivity_startactivityStartactivity_endactivityEnd)r   r   r   r,   r   r'   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 )Nrg   rh   c                 S      g | ]}|qS r   r   r$   r   r   r   r(         z6_LiveClientRealtimeInput_to_vertex.<locals>.<listcomp>rj   rk   z9audio_stream_end parameter is not supported in Vertex AI.rm   rn   ro   rp   rq   rr   r   r   r   r   r   re     s,   re   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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t |dgd urtdgt |dg S )Nmodelgeneration_configgenerationConfigsystem_instructionsystemInstructiontoolsc                       g | ]}t t |qS r   _Tool_to_mldevtt_toolr$   rX   r   r   r   r(   P      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 not supported in Gemini API.history_confighistoryConfig)	r   r   r-   r~   	t_contentt_tools!_SessionResumptionConfig_to_mldevr   r   rX   r
   r   r   r   r   r_   3  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S )Nru   rv   rw   rx   ry   rz   c                    r{   r   _Tool_to_vertexr~   r   r$   r   r   r   r(     r   z._LiveClientSetup_to_vertex.<locals>.<listcomp>r   r   r   r   r   r   r   r   r   r   explicitVadSignalr   7history_config parameter is not supported in Vertex AI.)r   r   rO   r0   r~   r   r   r   r   r   r   r   rd     s|   	




rd   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rLt|dd gtt |dg t |d!gd urdt|dd"gtt |d!g t |d#gd uryt|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 S ),Nrv   r[   rw   rC   r[   rw   rD   rH   r[   rw   rH   rM   r[   rw   rN   rK   r[   rw   rL   r?   r[   rw   r@   rA   r[   rw   rB   rE   r[   rw   rE   rF   r[   rw   rG   rI   r[   rw   rJ   r=   r[   rw   r>   rx   ry   rz   c                    r{   r   r|   r$   r   r   r   r(   8  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~   t_live_speech_configr-   r   r   r   r   r   r   r   r   r   _LiveConnectConfig_to_mldev  s  









	



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 |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 |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d)gt |d(g t |d*gd urtd+S ),Nrv   r[   rw   rC   r   rH   r   rM   r   rK   r   r?   r   rA   r   rE   r   rF   r   rI   r   r=   r   rx   ry   rz   c                    r{   r   r   r$   r   r   r   r(     r   z0_LiveConnectConfig_to_vertex.<locals>.<listcomp>r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )	r   r   rO   r~   r   r0   r   r   r   r   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 Nru   r[   config)r   r   r~   t_modelr   ra   r   r   r   _LiveConnectParameters_to_mldev      r   c              	   C   r   r   )r   r   r~   r   r   ra   r   r   r    _LiveConnectParameters_to_vertex6  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[   z.setup parameter is not supported in Vertex AI.r\   z7client_content parameter is not supported in Vertex AI.music_generation_config@music_generation_config parameter is not supported in Vertex AI.Zplayback_controlz9playback_control parameter is not supported in Vertex AI.r   r   r   r   r   !_LiveMusicClientMessage_to_vertexO  s   r   c                 C   s0   i }t | dgd urt|ddgt | dg |S )Nru   r[   r+   r   r   r   r   $_LiveMusicConnectParameters_to_mldevg  s   r   c                 C   r   )Nru   z.model parameter is not supported in Vertex AI.r   r   r   r   r   %_LiveMusicConnectParameters_to_vertexr  r   r   c                 C   .   i }t | dgd urt|dgt | dg |S )Nr   ZmusicGenerationConfigr+   r   r   r   r   &_LiveMusicSetConfigParameters_to_mldev}  s   
r   c                 C   r   )Nr   r   r   r   r   r   r   '_LiveMusicSetConfigParameters_to_vertex     r   c                 C   s8   i }t | dgd urt|dgdd t | dgD  |S )Nweighted_promptsZweightedPromptsc                 S   rs   r   r   r$   r   r   r   r(     rt   zC_LiveMusicSetWeightedPromptsParameters_to_mldev.<locals>.<listcomp>r+   r   r   r   r   /_LiveMusicSetWeightedPromptsParameters_to_mldev  s   r   c                 C   r   )Nr   z9weighted_prompts parameter is not supported in Vertex AI.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mediarh   c                    r"   r   ri   r$   r'   r   r   r(     r)   z=_LiveSendRealtimeInputParameters_to_mldev.<locals>.<listcomp>rj   rk   rl   rm   rn   ro   rp   rq   rr   )r   r   r~   t_blobsr   t_audio_blobt_image_blobr,   r   r'   r   )_LiveSendRealtimeInputParameters_to_mldev  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   rh   c                 S   rs   r   r   r$   r   r   r   r(     rt   z>_LiveSendRealtimeInputParameters_to_vertex.<locals>.<listcomp>rj   rk   rl   rm   rn   ro   rp   rq   rr   )r   r   r~   r   r   r   r   r   r   r   *_LiveSendRealtimeInputParameters_to_vertex  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 NZsetupCompleteZsetup_completeZserverContentZserver_contenttoolCall	tool_callZtoolCallCancellationZtool_call_cancellationZusageMetadataZusage_metadataZgoAwayZgo_awayZsessionResumptionUpdateZsession_resumption_updateZvoiceActivityDetectionSignalZvoice_activity_detection_signalZvoiceActivityZ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_vertex7  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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 |S )NrA   rB   code_execution_resultcodeExecutionResultexecutable_codeexecutableCode	file_datafileDatafunction_callfunctionCallfunction_responsefunctionResponseinline_data
inlineDatarn   thoughtthought_signaturethoughtSignaturevideo_metadatavideoMetadatar   r   r]   r^   )r   r   r1   r6   r   r   r   r   r   r#   r  sl   


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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|S )NrA   rB   r   r   r   r   r   r   r   r   r   r   r   r   rn   r   r   r   r   r   r   z2tool_call parameter is not supported in Vertex AI.r]   z6tool_response parameter is not supported in Vertex AI.r   r   r   r   r   r/     sT   


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transparentz5transparent parameter is not supported in Gemini API.r   r   r   r   r   r     s   r   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  |S )N	retrievalz3retrieval parameter is not supported in Gemini API.computer_usecomputerUsefile_searchZ
fileSearchgoogle_searchgoogleSearchgoogle_maps
googleMapscode_executioncodeExecutionenterprise_web_searchz?enterprise_web_search parameter is not supported in Gemini API.function_declarationsfunctionDeclarationsc                 S   rs   r   r   r$   r   r   r   r(   .  rt   z"_Tool_to_mldev.<locals>.<listcomp>google_search_retrievalgoogleSearchRetrievalparallel_ai_searchz<parallel_ai_search parameter is not supported in Gemini API.url_context
urlContextmcp_serversZ
mcpServersc                 S   rs   r   r   r$   r   r   r   r(   D  rt   )r   r   r   rQ   rP   r   r   r   r   r}     sd   
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r4tdt | dgd urGt dgt | dg t | dgd urZt d	gt | dg t | d
gd urmt 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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 S )Nr   r   r   r   z4file_search parameter is not supported in Vertex AI.r   r   r   r   r   r   r   ZenterpriseWebSearchr   r   c                    r"   r   )r<   r$   r'   r   r   r(   l  r)   z#_Tool_to_vertex.<locals>.<listcomp>r   r   r   ZparallelAiSearchr   r   r   z4mcp_servers parameter is not supported in Vertex AI.r   r,   r   r'   r   r   J  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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 )NZpromptTokenCountZprompt_token_countZcachedContentTokenCountZcached_content_token_countZcandidatesTokenCountZresponse_token_countZtoolUsePromptTokenCountZtool_use_prompt_token_countZthoughtsTokenCountZthoughts_token_countZtotalTokenCountZtotal_token_countZpromptTokensDetailsZprompt_tokens_detailsc                 S   rs   r   r   r$   r   r   r   r(     rt   z._UsageMetadata_from_vertex.<locals>.<listcomp>ZcacheTokensDetailsZcache_tokens_detailsc                 S   rs   r   r   r$   r   r   r   r(     rt   ZcandidatesTokensDetailsZresponse_tokens_detailsc                 S   rs   r   r   r$   r   r   r   r(     rt   ZtoolUsePromptTokensDetailsZtool_use_prompt_tokens_detailsc                 S   rs   r   r   r$   r   r   r   r(     rt   ZtrafficTypeZtraffic_typer+   r   r   r   r   r     s|   




r   c                 C   r   NtypeZvoice_activity_typer+   r   r   r   r   r        r   c                 C   r   r   r+   r   r   r   r   r     r   r   )N);typingr   r   r    r   r~   Z_api_clientr   _commonr   r   r	   r   dictstrobjectr   r   r   r-   r0   r1   r6   r<   rO   rP   rQ   rV   rW   rb   rf   r`   re   r_   rd   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   <module>   s  



$











'

s









*

)

.

&

V

T

 *

 $



















.

#

7

=

K

?



F

A

Q


