From 07aee705bca635c71b0f94233c61dfef9dce60fb Mon Sep 17 00:00:00 2001 From: Kye Gomez Date: Tue, 25 Feb 2025 13:43:08 -0800 Subject: [PATCH] fix sequential workflow outputs --- pyproject.toml | 2 +- swarm_router.py | 8 ++++++-- swarms/structs/sequential_workflow.py | 11 +++-------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3979d080..161b4679 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "swarms" -version = "7.4.5" +version = "7.4.6" description = "Swarms - TGSC" license = "MIT" authors = ["Kye Gomez "] diff --git a/swarm_router.py b/swarm_router.py index acec8d55..ee320aca 100644 --- a/swarm_router.py +++ b/swarm_router.py @@ -22,6 +22,10 @@ agents = [ ), ] -router = SwarmRouter(agents=agents, swarm_type="SequentialWorkflow") +router = SwarmRouter(agents=agents, swarm_type="SequentialWorkflow", output_type="dict", return_entire_history=False) -print(router.run("How are you doing?")) +output = router.run("How are you doing?") + +print(output) + +print(type(output)) diff --git a/swarms/structs/sequential_workflow.py b/swarms/structs/sequential_workflow.py index 8d3d9cb4..8778fcfb 100644 --- a/swarms/structs/sequential_workflow.py +++ b/swarms/structs/sequential_workflow.py @@ -139,12 +139,6 @@ class SequentialWorkflow: result = self.agent_rearrange.run( task=task, img=img, - device=device, - all_cores=all_cores, - device_id=device_id, - all_gpus=all_gpus, - no_use_clusterops=no_use_clusterops, - output_type=self.output_type, *args, **kwargs, ) @@ -156,8 +150,9 @@ class SequentialWorkflow: result = self.agent_rearrange.conversation.return_messages_as_list() elif self.output_type == "str" or self.return_json: result = self.agent_rearrange.conversation.get_str() - else: - return result + + + return result except Exception as e: logger.error( f"An error occurred while executing the task: {e}"