From d41449331e3a87dc4e9eb44b1a8efeed3444c762 Mon Sep 17 00:00:00 2001 From: Kye Date: Mon, 15 Jan 2024 22:50:10 -0500 Subject: [PATCH] [CLEANUP] --- pyproject.toml | 2 +- swarms/structs/task.py | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4ce89fc3..65661841 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "swarms" -version = "3.5.9" +version = "3.6.3" description = "Swarms - Pytorch" license = "MIT" authors = ["Kye Gomez "] diff --git a/swarms/structs/task.py b/swarms/structs/task.py index ad86c18e..7d630b23 100644 --- a/swarms/structs/task.py +++ b/swarms/structs/task.py @@ -69,10 +69,12 @@ class Task: priority: int = 0 dependencies: List["Task"] = field(default_factory=list) - def execute(self): + def execute(self, *args, **kwargs): """ Execute the task by calling the agent or model with the arguments and - keyword arguments. + keyword arguments. You can add images to the agent by passing the + path to the image as a keyword argument. + Examples: >>> from swarms.structs import Task, Agent @@ -83,14 +85,13 @@ class Task: >>> task.result """ - try: if isinstance(self.agent, Agent): if self.condition is None or self.condition(): self.result = self.agent.run( task=self.description, - *self.args, - **self.kwargs, + *args, + **kwargs, ) self.history.append(self.result)