Ë
    âß²j
  ã                  ó~   — d Z ddlmZ ddlZddlmZmZmZ ddlm	Z	  ej                  e«      Z G d„ de	«      Zd	d„Zy)
uÂ  DeepInfra video generation backend.

DeepInfra serves video over the OpenAI-compatible ``/v1/openai/videos`` endpoint (``create`` â†’ poll â†’
``download_content``), so all SDK plumbing lives in :class:`agent.video_gen_provider.OpenAICompatibleVideoGenProvider`.
This plugin only declares identity, credentials, and live model discovery â€” no hardcoded model ids, so retired
models drop out without a patch. Mirrors ``plugins/image_gen/deepinfra``.
é    )ÚannotationsN)ÚAnyÚDictÚList)Ú OpenAICompatibleVideoGenProviderc                  ó8   — e Zd ZdZdZdZdZdZd
d„Zdd„Z	dd„Z
y	)ÚDeepInfraVideoGenProviderzGText-to-video and image-to-video via DeepInfra's OpenAI-compatible API.Ú	deepinfraÚ	DeepInfraÚDEEPINFRA_API_KEYz#https://api.deepinfra.com/v1/openaic           	     óX  — 	 ddl m}  |d«      xs g D �cg c][  }|j                  d«      rH|d   |d   j                  d«      d   |j                  d	i «      xs i j                  d
«      xs ddd dœ‘Œ] c}S # t        $ r"}t        j	                  d|«       g cY d}~S d}~ww xY wc c}w )zj``video-gen``-tagged models from the live catalog; empty when unreachable (nothing beats a retired model).r   )Ú_fetch_deepinfra_models_by_tagz0Cannot import _fetch_deepinfra_models_by_tag: %sNz	video-genÚidú/éÿÿÿÿÚmetadataÚdescriptionÚ éP   )r   ÚdisplayÚ	strengths)Úhermes_cli.modelsr   Ú	ExceptionÚloggerÚdebugÚgetÚsplit)Úselfr   ÚexcÚitems       úI/home/ubuntu/.hermes/hermes-agent/plugins/video_gen/deepinfra/__init__.pyÚlist_modelsz%DeepInfraVideoGenProvider.list_models   s»   € ð	ÝHñ <¸KÓHÒNÈBöcàÐSW×S[ÑS[Ð\`ÔSað ˜D‘z¨d°4©j×.>Ñ.>¸sÓ.CÀBÑ.GØ $§¡¨°RÓ 8Ò >¸B×CÑCÀMÓRÒXÐVXÐZ]Ð[]Ð^ó`ò cð 	cøô ò 	Ü�L‰LÐKÈSÔQØ�Iûð	üòcs#   ‚A9 –A B'Á9	B$ÂBÂB$ÂB$c                ó(   — ddgg d¢g d¢ddddddd	d
œ
S )NÚtextÚimage)z16:9z9:16z1:1)Ú480pÚ720pÚ1080pé
   é   FTr   )
Ú
modalitiesÚaspect_ratiosÚresolutionsÚmax_durationÚmin_durationÚsupports_audioÚsupports_negative_promptÚsupports_seedÚsupports_upscaleÚmax_reference_images© ©r   s    r!   Úcapabilitiesz&DeepInfraVideoGenProvider.capabilities&   s2   € Ø% wÐ/ÒBYò  kDØ "°AÈÐlpØ!%¸5ÐZ[ñ]ð 	]ó    c                ó   — dddddddœgdœS )	Nr   ÚpaiduY   Wan, p-video, â€¦ â€” live catalog from api.deepinfra.com; text-to-video & image-to-videor   zDeepInfra API keyz#https://deepinfra.com/dash/api_keys)ÚkeyÚpromptÚurl)ÚnameÚbadgeÚtagÚenv_varsr5   r6   s    r!   Úget_setup_schemaz*DeepInfraVideoGenProvider.get_setup_schema+   s/   € Ø#¨fØrØ%8ÐDWð  aFñ  Gð  HñIð 	Ir8   N)ÚreturnzList[Dict[str, Any]])rC   zDict[str, Any])Ú__name__Ú
__module__Ú__qualname__Ú__doc__r>   Údisplay_nameÚ_env_keyÚ_default_base_urlr"   r7   rB   r5   r8   r!   r	   r	      s,   „ ÙQà€DØ€LØ"€HØ=Ðó	có]ô
Ir8   r	   c                ó6   — | j                  t        «       «       y)uL   Plugin entry point â€” wire ``DeepInfraVideoGenProvider`` into the registry.N)Úregister_video_gen_providerr	   )Úctxs    r!   ÚregisterrN   1   s   € à×#Ñ#Ô$=Ó$?Õ@r8   )rC   ÚNone)rG   Ú
__future__r   ÚloggingÚtypingr   r   r   Úagent.video_gen_providerr   Ú	getLoggerrD   r   r	   rN   r5   r8   r!   ú<module>rU      sB   ðñõ #ã ß "Ñ "å Eà	ˆ×	Ñ	˜8Ó	$€ôIÐ @ô Iô<Ar8   