o
    PL
j
                  	   @   sv   d Z ddlmZ ddlmZ ddlmZ G dd deZeddd	d
ddddZeddd	ddddZ	ee ee	 dS )u  Google Gemini provider profiles.

gemini:            Google AI Studio (API key) — uses GeminiNativeClient
google-gemini-cli: Google Cloud Code Assist (OAuth) — uses GeminiCloudCodeClient

Both report api_mode="chat_completions" but use custom native clients
that bypass 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                	   @   s8   e Zd ZdZdddedB dedeeef fddZdS )	GeminiProfileuG   Gemini — translate reasoning_config to thinking_config in extra_body.N)
session_idr   contextreturnc                K   s   ddl m}m}m} |dpd}|d}|dp| j}|||}	|	s'i S i }
| jdkrB||rB||	}|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    r   K/home/kuhnn/.hermes/hermes-agent/plugins/model-providers/gemini/__init__.pybuild_extra_body   s   

zGeminiProfile.build_extra_body)__name__
__module____qualname____doc__strr   dictr   r   r   r   r   r      s    
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-flash-preview)r   aliasesapi_modeenv_varsr   	auth_typedefault_aux_modelzgoogle-gemini-cli)z
gemini-clizgemini-oauthr   zcloudcode-pa://googleoauth_external)r   r'   r(   r)   r   r*   N)
r    typingr   	providersr   providers.baser   r   r   google_gemini_clir   r   r   r   <module>   s0    !
	