|
|
|
@ -25,7 +25,13 @@ class BaseWorkflow(BaseStructure):
|
|
|
|
|
super().__init__(*args, **kwargs)
|
|
|
|
|
self.task_pool = []
|
|
|
|
|
|
|
|
|
|
def add(self, task: Task = None, tasks: List[Task] = None, *args, **kwargs):
|
|
|
|
|
def add(
|
|
|
|
|
self,
|
|
|
|
|
task: Task = None,
|
|
|
|
|
tasks: List[Task] = None,
|
|
|
|
|
*args,
|
|
|
|
|
**kwargs,
|
|
|
|
|
):
|
|
|
|
|
"""
|
|
|
|
|
Adds a task or a list of tasks to the task pool.
|
|
|
|
|
|
|
|
|
@ -41,7 +47,9 @@ class BaseWorkflow(BaseStructure):
|
|
|
|
|
elif tasks:
|
|
|
|
|
self.task_pool.extend(tasks)
|
|
|
|
|
else:
|
|
|
|
|
raise ValueError("You must provide a task or a list of tasks")
|
|
|
|
|
raise ValueError(
|
|
|
|
|
"You must provide a task or a list of tasks"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
def run(self):
|
|
|
|
|
"""
|
|
|
|
@ -193,7 +201,6 @@ class BaseWorkflow(BaseStructure):
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def save_workflow_state(
|
|
|
|
|
self,
|
|
|
|
|
filepath: Optional[str] = "sequential_workflow_state.json",
|
|
|
|
|