Skip to content

Agent

dandy.agent.BaseAgent

Bases: BaseProcessor, ABC

plan_time_limit_seconds = settings.DEFAULT_AGENT_PLAN_TIME_LIMIT_SECONDS class-attribute instance-attribute

plan_task_count_limit = settings.DEFAULT_AGENT_PLAN_TASK_COUNT_LIMIT class-attribute instance-attribute

processors instance-attribute

__init_subclass__

Source code in dandy/agent/agent.py
def __init_subclass__(cls, **kwargs):
    if cls.processors is None or len(cls.processors) == 0:
        raise AgentCriticalException(
            f'{cls.__name__} must have a sequence of "BaseProcessor" sub classes defined on the "processors" class attribute.'
        )

    if cls._processors_strategy_class is None:
        raise AgentCriticalException(
            f'{cls.__name__} must have a "BaseProcessorsStrategy" sub class defined on the "_processors_strategy_class" class attribute.'
        )

    else:
        cls._processors_strategy = cls._processors_strategy_class(
            cls.processors
        )