Files
wehub-resource-sync e4dcfc49aa
Tests / Import Check (Python 3.13) (push) Has been cancelled
Tests / Import Check (Python 3.14) (push) Has been cancelled
Tests / Python Tests (Python 3.11) (push) Has been cancelled
Tests / Python Tests (Python 3.12) (push) Has been cancelled
Tests / Python Tests (Python 3.14) (push) Has been cancelled
Tests / Test Summary (push) Has been cancelled
Tests / Lint and Format (push) Has been cancelled
Tests / Web Node Tests (push) Has been cancelled
Tests / Import Check (Python 3.11) (push) Has been cancelled
Tests / Import Check (Python 3.12) (push) Has been cancelled
Tests / Python Tests (Python 3.13) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:00:43 +08:00

28 lines
977 B
Python

"""Video-generation adapter registry.
Adapters are stateless singletons keyed by the ``adapter`` field on the resolved
config. The async-task adapter covers the submit → poll → download lifecycle
shared by Volcengine Ark Seedance and similar providers; register bespoke
providers by adding new keys here.
"""
from __future__ import annotations
from deeptutor.services.generation_http import GenerationProviderError
from deeptutor.services.videogen.adapters.async_task import AsyncTaskVideogenAdapter
from deeptutor.services.videogen.base import BaseVideogenAdapter
VIDEOGEN_ADAPTERS: dict[str, BaseVideogenAdapter] = {
"async_task": AsyncTaskVideogenAdapter(),
}
def get_videogen_adapter(name: str) -> BaseVideogenAdapter:
adapter = VIDEOGEN_ADAPTERS.get(name or "async_task")
if adapter is None:
raise GenerationProviderError(f"Unsupported videogen adapter: {name!r}")
return adapter
__all__ = ["VIDEOGEN_ADAPTERS", "get_videogen_adapter"]