Skip to content

registry

Class info

Classes

Name Children Inherits
Job
llmling_agent.models.task
A task is a piece of work that can be executed by an agent.
    JobRegistrationError
    llmling_agent.tasks.exceptions
    Task could not get registered.
      TaskRegistry
      llmling_agent.tasks.registry
      Registry for managing tasks.

        🛈 DocStrings

        Task definition and registry for agents.

        TaskRegistry

        Bases: BaseRegistry[str, Job[Any, Any]]

        Registry for managing tasks.

        Source code in src/llmling_agent/tasks/registry.py
        13
        14
        15
        16
        17
        18
        19
        20
        21
        22
        23
        24
        25
        26
        27
        28
        29
        30
        31
        32
        class TaskRegistry(BaseRegistry[str, Job[Any, Any]]):
            """Registry for managing tasks."""
        
            @property
            def _error_class(self) -> type[JobRegistrationError]:
                return JobRegistrationError
        
            def _validate_item(self, item: Any) -> Job[Any, Any]:
                if not isinstance(item, Job):
                    msg = f"Expected Job, got {type(item)}"
                    raise self._error_class(msg)
                return item
        
            def register(self, name: str, task: Job[Any, Any], replace: bool = False):
                """Register a task with name.
        
                Creates a copy of the task with the name set.
                """
                task_copy = task.model_copy(update={"name": name})
                super().register(name, task_copy, replace)
        

        register

        register(name: str, task: Job[Any, Any], replace: bool = False)
        

        Register a task with name.

        Creates a copy of the task with the name set.

        Source code in src/llmling_agent/tasks/registry.py
        26
        27
        28
        29
        30
        31
        32
        def register(self, name: str, task: Job[Any, Any], replace: bool = False):
            """Register a task with name.
        
            Creates a copy of the task with the name set.
            """
            task_copy = task.model_copy(update={"name": name})
            super().register(name, task_copy, replace)