
    `gjC                     &    d Z ddlZdad ZdefdZy)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                  ^    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.
    r   )resolve_provider_client
openrouterT)
async_modez/OPENROUTER_API_KEY environment variable not set)_clientagent.auxiliary_clientr   
ValueError)r   client_models      J/root/.hermes/venv/lib/python3.12/site-packages/tools/openrouter_client.pyget_async_clientr      s7     B0$O>NOON    returnc                  >    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0r   )__doc__r   r   r   r   r   r   r   r   <module>r      s%    

"1t 1r   