hokusai/bulkgen/providers/__init__.py
Konstantin Fickel d0dac5b1bf
Some checks failed
Continuous Integration / Build Package (push) Successful in 30s
Continuous Integration / Lint, Check & Test (push) Failing after 38s
refactor: move model definitions into providers and extract resolve module
- Rename ImageProvider to BlackForestProvider, TextProvider to MistralProvider
- Add get_provided_models() abstract method to Provider base class
- Move model lists from models.py into each provider's get_provided_models()
- Add providers/registry.py to aggregate models from all providers
- Extract infer_required_capabilities and resolve_model from config.py to resolve.py
- Update tests to use new names and import paths
2026-02-15 11:03:57 +01:00

37 lines
1.1 KiB
Python

"""Provider abstraction for AI generation backends."""
from __future__ import annotations
import abc
from pathlib import Path
from bulkgen.config import TargetConfig
from bulkgen.providers.models import ModelInfo
class Provider(abc.ABC):
"""Abstract base for generation providers."""
@staticmethod
@abc.abstractmethod
def get_provided_models() -> list[ModelInfo]:
"""Return the models this provider supports."""
@abc.abstractmethod
async def generate(
self,
target_name: str,
target_config: TargetConfig,
resolved_prompt: str,
resolved_model: ModelInfo,
project_dir: Path,
) -> None:
"""Generate the target artifact and write it to *project_dir / target_name*.
Args:
target_name: Output filename (relative to project_dir).
target_config: The parsed target configuration.
resolved_prompt: The fully resolved prompt text.
resolved_model: The resolved model information.
project_dir: The project working directory.
"""