From ffa47016618a300b87dead5f2575ac224fedf7af Mon Sep 17 00:00:00 2001 From: Kye Date: Thu, 13 Jul 2023 13:56:15 -0400 Subject: [PATCH] make sure agent key is present Former-commit-id: 5c2e7b5b7b4e6b7ce0348216ae0cfdd00817d8c2 --- swarms/agents/utils/AgentManager.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/swarms/agents/utils/AgentManager.py b/swarms/agents/utils/AgentManager.py index bfeea916..34e87c79 100644 --- a/swarms/agents/utils/AgentManager.py +++ b/swarms/agents/utils/AgentManager.py @@ -84,7 +84,10 @@ class AgentManager: callback_manager=callback_manager, verbose=True, ) + if 'agent' not in executor.__dict__: + executor.__dict__['agent'] = agent self.executors[session] = executor + return executor except Exception as e: logging.error(f"Error while creating executor: {str(e)}")