§
    øžyjQ  ã            	       ó„   — 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¦  «         dS )uÞ  Google Vertex AI provider profile.

vertex: Gemini models via Google Cloud's OpenAI-compatible endpoint.

Auth is OAuth2 â€” short-lived access tokens minted from a service-account JSON
or Application Default Credentials (ADC), NOT a static API key. Token
resolution and refresh live in ``agent/vertex_adapter.py``; runtime_provider.py
calls it to obtain a fresh ``(token, base_url)`` pair, then hands the token to
the standard OpenAI client as ``api_key``. Because the wire format is the
OpenAI-compatible chat/completions surface, no message translation is needed â€”
the only Gemini-specific concern is the ``thinking_config`` reasoning hook,
which is emitted here exactly as the ``gemini`` provider does for its
OpenAI-compat subpath (``extra_body.google.thinking_config``).

``auth_type="vertex"`` marks this as an OAuth-token provider (resolved
specially, like bedrock's ``aws_sdk``) so it is never treated as an
api_key provider that would mistake a credentials-file path for a key.
é    )Ú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dddd	œd
edz  dedz  dede	e         dz  fd„Z
dS )ÚVertexProfileuH   Vertex AI â€” reuse Gemini's thinking_config translation for extra_body.N)Ú
session_idr   ÚcontextÚreturnc                ó¸   — ddl m}m} |                     d¦  «        pd}|                     d¦  «        } |||¦  «        }|si S  ||¦  «        }|si S ddd|iiiS )	z�Emit ``extra_body.google.thinking_config`` for the OpenAI-compat
        Vertex surface, mirroring the ``gemini`` provider's behavior.
        r   )Ú_build_gemini_thinking_configÚ"_snake_case_gemini_thinking_configÚmodelÚ Úreasoning_configÚ
extra_bodyÚgoogleÚthinking_config)Ú!agent.transports.chat_completionsr   r   Úget)	Úselfr   r	   r   r   r   r   Úraw_thinking_configr   s	            úM/home/ragecks/.hermes/hermes-agent/plugins/model-providers/vertex/__init__.pyÚbuild_extra_bodyzVertexProfile.build_extra_body   sª   € ð	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð
 —’˜GÑ$Ô$Ð*¨ˆØ"Ÿ;š;Ð'9Ñ:Ô:Ðà;Ð;¸EÐCSÑTÔTÐØ"ð 	ØˆIà<Ð<Ð=PÑQÔQˆØð 	ØˆIØ˜xÐ*;¸_Ð)MÐNÐOÐOó    g       @)Úapi_keyÚbase_urlÚtimeoutr   r   r   c                ó   — dS )z›Vertex's OpenAI-compat endpoint has no ``/models`` listing route;
        model discovery is not available. The setup wizard ships a curated list.
        N© )r   r   r   r   s       r   Úfetch_modelszVertexProfile.fetch_models4   s	   € ð ˆtr   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ústrr   Údictr   ÚfloatÚlistr    r   r   r   r   r      sÌ   € € € € € ØRÐRð +/ðPð Pð PØ  4™ZðPØ;>ðPà	ˆc�3ˆhŒðPð Pð Pð Pð4 #Ø#Øð
ð 
ð 
ð �t‘ð
ð ˜‘*ð	
ð
 ð
ð 
ˆcŒ�TÑ	ð
ð 
ð 
ð 
ð 
ð 
r   r   Úvertex)zgoogle-vertexz	vertex-aiz
gcp-vertexÚchat_completionsr   z!https://aiplatform.googleapis.comzgoogle/gemini-3.6-flash)ÚnameÚaliasesÚapi_modeÚenv_varsr   Ú	auth_typeÚdefault_aux_modelN)	r$   Útypingr   Ú	providersr   Úproviders.baser   r   r)   r   r   r   ú<module>r4      s¸   ððð ð& Ð Ð Ð Ð Ð à 'Ð 'Ð 'Ð 'Ð 'Ð 'Ø *Ð *Ð *Ð *Ð *Ð *ð$ð $ð $ð $ð $�Oñ $ô $ð $ðN 
ˆØ	Ø8ØØØ0ØØ/ð
ñ 
ô 
€ð Ð �&Ñ Ô Ð Ð Ð r   