o
    iG                     @   s8  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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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eeef ef d	eeeef  d
eeef fd*d+Z dS )-    )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 )Nlanguage_codesz8language_codes parameter is not supported in Gemini API.getv
ValueErrorr
   r   	to_object r   W/home/livre-enfant/venv/lib/python3.10/site-packages/google/genai/_tokens_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 )Napi_keyapiKeyapi_key_configz8api_key_config parameter is not supported in Gemini API.	auth_typez3auth_type parameter is not supported in Gemini API.google_service_account_configzGgoogle_service_account_config parameter is not supported in Gemini API.http_basic_auth_configz@http_basic_auth_config parameter is not supported in Gemini API.oauth_configz6oauth_config parameter is not supported in Gemini API.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                    sb   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                    s   g | ]}t | qS r   )_Part_to_mldev.0itemr   r   r   
<listcomp>a   s    z%_Content_to_mldev.<locals>.<listcomp>role)r   r!   )r
   r   r   r.   r   _Content_to_mldevX   s   

	r1   
api_clientc                 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rRt|dgt| t |dg| t |dgd uret|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r2   r
   r   r   r   r   r   _CreateAuthTokenConfig_to_mldevm   s8   



r>   c                 C   s6   i }t |dgd urt|dgt| t |dg| |S )Nconfig)r   r!   r>   r=   r   r   r   #_CreateAuthTokenParameters_to_mldev   s   r@   c                 C   r   )Nr?   z/config parameter is not supported in Vertex AI.r   r   r   r   r   $_CreateAuthTokenParameters_to_vertex   r   rA   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   rD   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.will_continuez7will_continue parameter is not supported in Gemini API.r    r   r   r   r   _FunctionCall_to_mldev   s   rJ   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auth_config
authConfigenable_widgetenableWidget)r   r!   r"   r   r   r   r   _GoogleMaps_to_mldev   s   rO   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 not supported in Gemini API.exclude_domainsz9exclude_domains parameter is not supported in Gemini API.time_range_filtertimeRangeFilterr    r   r   r   r   _GoogleSearch_to_mldev   s    rV   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 ),Ngeneration_configsetupgenerationConfigresponse_modalities)rX   rY   responseModalitiestemperature)rX   rY   r\   top_p)rX   rY   topPtop_k)rX   rY   topKmax_output_tokens)rX   rY   maxOutputTokensmedia_resolution)rX   rY   mediaResolutionseed)rX   rY   re   speech_config)rX   rY   speechConfigthinking_config)rX   rY   thinkingConfigenable_affective_dialog)rX   rY   enableAffectiveDialogsystem_instructionsystemInstructiontoolsc                    s   g | ]}t t |qS r   )_Tool_to_mldevtt_toolr+   r2   r   r   r   r/   h  s    z/_LiveConnectConfig_to_mldev.<locals>.<listcomp>session_resumptionsessionResumptioninput_audio_transcriptioninputAudioTranscriptionoutput_audio_transcriptionoutputAudioTranscriptionrealtime_input_configrealtimeInputConfigcontext_window_compressioncontextWindowCompressionproactivityexplicit_vad_signalz=explicit_vad_signal parameter is not supported in Gemini API.history_confighistoryConfig)
r   r!   rp   t_live_speech_configr1   	t_contentt_tools!_SessionResumptionConfig_to_mldevr   r   )r2   r
   r   r   rr   r   _LiveConnectConfig_to_mldev  s  









	



r   c              	   C   sf   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 )NmodelrX   r?   )r   r!   rp   t_modelr   r=   r   r   r   r<     s    r<   c                 C   s2  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 |S )Nrc   rd   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!   rD   rJ   r(   r   r   r   r   r*     sp   


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_search
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      g | ]}|qS r   r   r+   r   r   r   r/   H      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_servers
mcpServersc                 S   r   r   r   r+   r   r   r   r/   ^  r   )r   r   r!   rV   rO   r   r   r   r   ro      sd   
ro   )N)!typingr   r   r    r   rp   _api_clientr   _commonr   r   r	   r!   dictstrobjectr   r"   r(   r1   r>   r@   rA   rD   rJ   rO   rV   r   r<   r*   r   ro   r   r   r   r   <module>   s  



$





,













 *



N


