HKUDS/nanobot · error · ValueError
{cls.__name__} must set provider_name
Error message
{cls.__name__} must set provider_name What it means
Error "{cls.__name__} must set provider_name" thrown in HKUDS/nanobot.
Source
Thrown at nanobot/providers/image_generation.py:252
return f"data:{mime};base64,{encoded}"
# ---------------------------------------------------------------------------
# Registry
# ---------------------------------------------------------------------------
_IMAGE_GEN_PROVIDERS: dict[str, type[ImageGenerationProvider]] = {}
def register_image_gen_provider(cls: type[ImageGenerationProvider]) -> None:
"""Register an image provider at import time only.
The registry is populated by module side effects so provider discovery
stays lazy and consistent across the process.
"""
name = cls.provider_name
if not name:
raise ValueError(f"{cls.__name__} must set provider_name")
_IMAGE_GEN_PROVIDERS[name] = cls
def get_image_gen_provider(name: str) -> type[ImageGenerationProvider] | None:
return _IMAGE_GEN_PROVIDERS.get(name)
def image_gen_provider_names() -> tuple[str, ...]:
"""Return registered image generation provider names in registry order."""
return tuple(_IMAGE_GEN_PROVIDERS)
def image_gen_provider_configs(config: Config) -> dict[str, ProviderConfig]:
providers_cfg = config.providers
return {
name: pc
for name in _IMAGE_GEN_PROVIDERS
if (pc := getattr(providers_cfg, name, None)) is not NoneView on GitHub (pinned to 42f37dc4c0)
When it happens
Trigger: Thrown at nanobot/providers/image_generation.py:252 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of HKUDS/nanobot@42f37dc4c0 (2026-08-26).
Data as JSON: /api/errors/1f839d9eba08a2cb.
Report an issue: GitHub.