decorators¶
decorators ¶
Attributes¶
__all__ module-attribute ¶
Classes¶
DecoratedTask dataclass ¶
DecoratedTask(func: Callable[[ContextT], ContextT], _metadata: TaskMetadata = (lambda: TaskMetadata(name='task'))(), condition: Callable[[ContextT], bool] | None = None)
TaskGroup dataclass ¶
TaskGroup(tasks: list[TaskNode[ContextT]], mode: ExecutionMode, _metadata: TaskMetadata = (lambda: TaskMetadata(name='task_group'))())
Bases: Generic[ContextT]
Group of tasks with execution mode (sync version).
Attributes¶
Functions¶
execute ¶
Execute all tasks in the group (sync).
Source code in inferflow/workflow/decorators.py
Workflow ¶
Functions¶
task ¶
task(name: str | None = None, description: str | None = None, condition: Callable[[Any], bool] | None = None, timeout: float | None = None, retry: int = 0, skip_on_error: bool = False) -> Callable[[Callable[[ContextT], ContextT]], DecoratedTask[ContextT]]
Decorator to create a workflow task (sync version).