
    [j$                         d Z ddlmZ ddlmZ  G d de          Z edddd	d
dddddd          Z ee           dS )u  DeepInfra provider profile.

DeepInfra is an OpenAI-compatible inference gateway that hosts 100+ open
models (Step, GLM, Kimi, DeepSeek, MiniMax, Nemotron, Mistral, Qwen, …) as
well as image-gen / TTS / STT / embedding endpoints. The chat surface is
wired in through this profile; non-chat surfaces are wired in through
their respective plugin subsystems (``plugins/image_gen/deepinfra`` and
the TTS/STT dispatchers in ``tools/``).
    )register_provider)ProviderProfilec                       e Zd ZdZd ZdS )_DeepInfraProfilea<  DeepInfra profile with live vision-default discovery.

    Owns its own vision default so shared vision resolution in
    ``agent/auxiliary_client.py`` stays provider-agnostic (a
    ``default_vision_model()`` hook call instead of an ``if provider ==
    "deepinfra"`` branch reaching into the catalog helpers).
    c                    ddl }|j                            d          pd                                sdS 	 ddlm}  |d          }n# t          $ r Y dS w xY w|pg D ]y}|                    d          pi }t          |t                    r|                    d          nd}t          |t                    rd	|v r|                    d
          }|r|c S zdS )a|  First vision-capable *chat* model from the live catalog, or None.

        Key-gated so a box without ``DEEPINFRA_API_KEY`` never pays the
        catalog round-trip. Requires the ``chat`` surface tag (not just the
        ``vision`` capability) so an image-gen/edit model that merely carries
        a ``vision`` tag can't be picked as a chat-completions vision backend.
        r   NDEEPINFRA_API_KEY )_fetch_deepinfra_models_by_tagchatmetadatatagsvisionid)
osenvirongetstriphermes_cli.modelsr
   	Exception
isinstancedictlist)selfr   r
   itemsitemr   r   model_ids           L/home/ice/.hermes/hermes-agent/plugins/model-providers/deepinfra/__init__.pydefault_vision_modelz&_DeepInfraProfile.default_vision_model   s    				
2339r@@BB 	4	HHHHHH226::EE 	 	 	44	KR 	$ 	$Dxx
++1rH+5h+E+EO8<<'''4D$%% $(d*:*:88D>> $#OOOts   A 
AAN)__name__
__module____qualname____doc__r        r   r   r      s-             r$   r   	deepinfra)z
deep-infrazdeepinfra-ai	DeepInfrau+   DeepInfra — 100+ open models, pay-per-usez#https://deepinfra.com/dash/api_keys)r   DEEPINFRA_BASE_URLz#https://api.deepinfra.com/v1/openaiapi_keyNzdeepseek-ai/DeepSeek-V4-Flashr#   )namealiasesdisplay_namedescription
signup_urlenv_varsbase_url	auth_typedefault_max_tokensdefault_aux_modelfallback_models)r"   	providersr   providers.baser   r   r%   r#   r$   r   <module>r6      s     ( ' ' ' ' ' * * * * * *! ! ! ! ! ! ! !H 	*=482  6 7  	<  )     r$   