From 8b552badba3a6ab6f82671c7ded8ddb236659597 Mon Sep 17 00:00:00 2001 From: Sambhav Dixit <94298612+sambhavnoobcoder@users.noreply.github.com> Date: Sun, 27 Oct 2024 18:43:38 +0530 Subject: [PATCH] edit run return - edit "run" return type with condition on how to return if output type is JSON . --- swarms/structs/agent.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/swarms/structs/agent.py b/swarms/structs/agent.py index 33f63e8b..c70fe201 100644 --- a/swarms/structs/agent.py +++ b/swarms/structs/agent.py @@ -998,7 +998,10 @@ class Agent: # return self.agent_output_type(all_responses) - return concat_strings(all_responses) + if self.output_type == "json": + return asdict(self.agent_output) + else: + return concat_strings(all_responses) except Exception as error: logger.info(