
    `gj$                     l    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       y)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y)_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                  j                  d      xs dj                         sy	 ddlm}  |d      }|xs g D ]g  }|j                  d      xs i }t        |t              r|j                  d      nd}t        |t              sLd	|v sQ|j                  d
      }|se|c S  y# t        $ r Y yw xY w)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           ]/root/.hermes/venv/lib/python3.12/site-packages/plugins/model-providers/deepinfra/__init__.pydefault_vision_modelz&_DeepInfraProfile.default_vision_model   s     	

239r@@B	H26:E KR 	$Dxx
+1rH+5h+E8<<'4D$%(d*:88D>#O	$   		s   B3 3	B?>B?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$   