From 556e213b1ff0aea81b560a40ee16396b8e070868 Mon Sep 17 00:00:00 2001 From: Kye Date: Sat, 15 Jul 2023 00:01:30 -0400 Subject: [PATCH] clean up with tasks Former-commit-id: d5463133cae73bee1984e4ed2525a41ca0deb4c5 --- swarms/swarms.py | 3 +++ swarms/utils/task.py | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 swarms/utils/task.py diff --git a/swarms/swarms.py b/swarms/swarms.py index a2628e53..674254ba 100644 --- a/swarms/swarms.py +++ b/swarms/swarms.py @@ -8,6 +8,9 @@ from swarms.agents.workers.WorkerUltraNode import WorkerUltra logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') + +from swarms.utils.task import Task + class Swarms: def __init__(self, openai_api_key=""): #openai_api_key: the openai key. Default is empty diff --git a/swarms/utils/task.py b/swarms/utils/task.py new file mode 100644 index 00000000..2d7f56e0 --- /dev/null +++ b/swarms/utils/task.py @@ -0,0 +1,11 @@ +import uuid + +class Task: + def __init__(self, objective, priority=0, schedule=None, dependencies=None): + self.id = uuid.uuid4() + self.objective = objective + self.priority = priority + self.schedule = schedule + self.dependencies = dependencies or [] + self.status = "pending" +