Skip to content

Commit 1848529

Browse files
authored
Merge pull request #1205 from aparekh02/swarmsapi2
[BUG-FIX] Reflexion Agent task attribute error
2 parents 7e5974b + 822d81f commit 1848529

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

swarms/agents/reasoning_agents.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,12 @@ def run(self, task: str, *args, **kwargs):
284284
The result of the reasoning process (format depends on agent and output_type).
285285
"""
286286
try:
287-
swarm = self.select_swarm()
288-
return swarm.run(task=task, *args, **kwargs)
287+
if self.swarm_type == "ReflexionAgent":
288+
swarm = self.select_swarm()
289+
return swarm.run(tasks=[task], *args, **kwargs)
290+
else:
291+
swarm = self.select_swarm()
292+
return swarm.run(task=task, *args, **kwargs)
289293
except Exception as e:
290294
raise ReasoningAgentExecutorError(
291295
f"ReasoningAgentRouter Error: {e} Traceback: {traceback.format_exc()} If the error persists, please check the agent's configuration and try again. If you would like support book a call with our team at https://cal.com/swarms"

0 commit comments

Comments
 (0)