clean up workflow

Former-commit-id: ee82439d0e
group-chat
Kye 1 year ago
parent e31a55377b
commit 73d91a51f8

@ -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()

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

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

Loading…
Cancel
Save