
    `gj              	       p    d Z ddlmZ ddlmZ ddlmZ  G d de      Z eddd	d
ddd      Z ee       y)u  Google Gemini provider profiles.

gemini:            Google AI Studio (API key) — uses GeminiNativeClient

Reports api_mode="chat_completions" but uses a custom native client
that bypasses the standard OpenAI transport. The profile captures auth
and endpoint metadata for auth.py / runtime_provider.py migration, and
carries the thinking_config translation hook so the transport's profile
path produces the same extra_body shape the legacy flag path did.
    )Any)register_provider)ProviderProfilec            	       :    e Zd ZdZdddedz  dedeeef   fdZy)GeminiProfileuG   Gemini — translate reasoning_config to thinking_config in extra_body.N)
session_idr   contextreturnc                $   ddl m}m}m} |j	                  d      xs d}|j	                  d      }|j	                  d      xs | j
                  } |||      }	|	si S i }
| j                  dk(  r ||      r ||	      }|r	dd	|ii|
d
<   |
S |	|
d	<   |
S )zEmit extra_body.thinking_config (native) or extra_body.extra_body.google.thinking_config
        (OpenAI-compat /openai subpath), mirroring the legacy path's behavior.
        r   )_build_gemini_thinking_config!_is_gemini_openai_compat_base_url"_snake_case_gemini_thinking_configmodel reasoning_configbase_urlgeminigooglethinking_config
extra_body)!agent.transports.chat_completionsr   r   r   getr   name)selfr   r	   r   r   r   r   r   r   raw_thinking_configbodyr   s               Z/root/.hermes/venv/lib/python3.12/site-packages/plugins/model-providers/gemini/__init__.pybuild_extra_bodyzGeminiProfile.build_extra_body   s    	
 	
 G$*";;'9:;;z*;dmm;ECST"I!99 %Fx%P@ATUO&.1BO0T%U\"  ':D"#    )__name__
__module____qualname____doc__strr   dictr    r   r   r   r      s3    Q +/ 4Z;>	c3hr   r   r   )r   zgoogle-geminizgoogle-ai-studiochat_completions)GOOGLE_API_KEYGEMINI_API_KEYz0https://generativelanguage.googleapis.com/v1betaapi_keyzgemini-3.5-flash)r   aliasesapi_modeenv_varsr   	auth_typedefault_aux_modelN)	r#   typingr   	providersr   providers.baser   r   r   r&   r   r   <module>r3      sM   	  ' *O B 
	;1?(
 & r   