Skip to content

Factory

mighty.mighty_runners.factory #

Factory for creating runners based on config.

get_runner_class #

get_runner_class(agent_type: str) -> type[MightyRunner]

Transforms config keyword for agents to class.

Source code in mighty/mighty_runners/factory.py
def get_runner_class(agent_type: str) -> type[MightyRunner]:
    """Transforms config keyword for agents to class."""
    agent_class = None
    if agent_type in VALID_RUNNER_TYPES:
        agent_class = RUNNER_CLASSES[agent_type]
    else:
        raise ValueError(f"Unknown agent_type {agent_type}.")

    return agent_class