[CODE QUALITY]

pull/343/head
Kye 1 year ago
parent 2f48cfc071
commit db2dbf36db

@ -1,6 +1,7 @@
from swarms.structs.agent import Agent
from swarms.structs.autoscaler import AutoScaler
from swarms.structs.base_swarm import AbstractSwarm
from swarms.structs.base_workflow import BaseWorkflow
from swarms.structs.concurrent_workflow import ConcurrentWorkflow
from swarms.structs.conversation import Conversation
from swarms.structs.groupchat import GroupChat, GroupChatManager
@ -49,4 +50,5 @@ __all__ = [
"ConcurrentWorkflow",
"RecursiveWorkflow",
"NonlinearWorkflow",
"BaseWorkflow",
]

@ -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",

Loading…
Cancel
Save