fix: append new tasks to the end of the list (#2737)
fix: append new tasks to the end of the list
This commit is contained in:
parent
402f1f6c53
commit
e5856b3036
1 changed files with 5 additions and 5 deletions
|
|
@ -54,7 +54,7 @@ class SequentialTaskComponent(Component):
|
||||||
]
|
]
|
||||||
|
|
||||||
def build_task(self) -> list[SequentialTask]:
|
def build_task(self) -> list[SequentialTask]:
|
||||||
tasks = []
|
tasks: list[SequentialTask] = []
|
||||||
task = SequentialTask(
|
task = SequentialTask(
|
||||||
description=self.task_description,
|
description=self.task_description,
|
||||||
expected_output=self.expected_output,
|
expected_output=self.expected_output,
|
||||||
|
|
@ -65,8 +65,8 @@ class SequentialTaskComponent(Component):
|
||||||
tasks.append(task)
|
tasks.append(task)
|
||||||
self.status = task
|
self.status = task
|
||||||
if self.task:
|
if self.task:
|
||||||
if isinstance(self.task, list):
|
if isinstance(self.task, list) and all(isinstance(task, SequentialTask) for task in self.task):
|
||||||
tasks.extend(self.task)
|
tasks = self.task + tasks
|
||||||
else:
|
elif isinstance(self.task, SequentialTask):
|
||||||
tasks.append(self.task)
|
tasks = [self.task] + tasks
|
||||||
return tasks
|
return tasks
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue