def build_algorithm(
    name: str,
    kwargs: Optional[dict[str, Any]] = None,
) -> Algorithm:
    """Builds an algorithm from the registry."""
    return construct_from_registry(
        name=name,
        registry=registry.algorithms,
        partial_function=True,
        pre_validation_function=Algorithm,
        post_validation_function=None,
        kwargs=kwargs,
    )
Builds an algorithm from the registry.
llmfoundry/utils/builders.py