
    iC                     (    d Z ddlZdad ZdefdZdS )a  Shared OpenRouter API client for Hermes tools.

Provides a single lazy-initialized AsyncOpenAI client that all tool modules
can share.  Routes through the centralized provider router in
agent/auxiliary_client.py so auth, headers, and API format are handled
consistently.
    Nc                  p    t           )ddlm}   | dd          \  }}|t          d          |a t           S )a  Return a shared async OpenAI-compatible client for OpenRouter.

    The client is created lazily on first call and reused thereafter.
    Uses the centralized provider router for auth and client construction.
    Raises ValueError if OPENROUTER_API_KEY is not set.
    Nr   )resolve_provider_client
openrouterT)
async_modez/OPENROUTER_API_KEY environment variable not set)_clientagent.auxiliary_clientr   
ValueError)r   client_models      </home/ubuntu/.hermes/hermes-agent/tools/openrouter_client.pyget_async_clientr      sR     BBBBBB00$OOO>NOOON    returnc                  D    t          t          j        d                    S )z0Check whether the OpenRouter API key is present.OPENROUTER_API_KEY)boolosgetenv r   r   check_api_keyr      s    	.//000r   )__doc__r   r   r   r   r   r   r   r   <module>r      sS     
			
  "1t 1 1 1 1 1 1r   