diff --git a/example.py b/example.py index 0f82b7d5..1803f3b2 100644 --- a/example.py +++ b/example.py @@ -17,7 +17,7 @@ from swarms.tools.autogpt import ChatOpenAI workflow = Workflow(ChatOpenAI) workflow.add("What's the weather in miami") -workflow.add("Provide detauls for {{ parent_output }}") +workflow.add("Provide details for {{ parent_output }}") workflow.add("Summarize the above information: {{ parent_output}}") workflow.run() diff --git a/swarms/structs/task.py b/swarms/structs/task.py index 3da9bd31..f23d778a 100644 --- a/swarms/structs/task.py +++ b/swarms/structs/task.py @@ -28,7 +28,7 @@ class BaseTask(ABC): self.structure = None @property - @abstractmethod + # @abstractmethod def input(self): pass @@ -125,7 +125,7 @@ class BaseTask(ABC): self.output = None return self - @abstractmethod + # @abstractmethod def run(self): pass diff --git a/swarms/structs/workflow.py b/swarms/structs/workflow.py index d718123f..5e4aae15 100644 --- a/swarms/structs/workflow.py +++ b/swarms/structs/workflow.py @@ -5,23 +5,21 @@ from typing import Any, Dict, List, Optional from swarms.artifacts.error_artifact import ErrorArtifact from swarms.structs.task import BaseTask -from dataclasses import dataclass -@dataclass class StringTask(BaseTask): - task: str - + def __init__(self, task): + super().__init__() + self.task = task + def execute(self) -> Any: - prompt = self.task_string.replace( + prompt = self.task.replace( "{{ parent_input }}", self.parents[0].output if self.parents else "" ) - response = self.structure.llm.run(prompt) + response = self.structure.llm(prompt) self.output = response return response - - class Workflow: """ Workflows are ideal for prescriptive processes that need to be executed