From 0469658b2c312d24cdb3aebf699f8d46f86b9f7d Mon Sep 17 00:00:00 2001 From: Kye Date: Sat, 29 Jul 2023 11:59:14 -0400 Subject: [PATCH] clean up --- swarms/swarms.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/swarms/swarms.py b/swarms/swarms.py index 5392b9cd..6e7e459e 100644 --- a/swarms/swarms.py +++ b/swarms/swarms.py @@ -66,7 +66,7 @@ class HierarchicalSwarm: self.logging_enabled = logging_enabled self.verbose = verbose - + self.logger = logging.getLogger() if not logging_enabled: @@ -135,6 +135,7 @@ class HierarchicalSwarm: logging.error(f"Failed to initialize vector store: {e}") return None + def initialize_worker_node(self, worker_tools, vectorstore, llm_class=ChatOpenAI): try: llm = self.initialize_llm(ChatOpenAI) @@ -203,6 +204,8 @@ class HierarchicalSwarm: assert worker_tools is not None, "worker_tools is not initialized" vectorstore = self.initialize_vectorstore() if self.use_vectorstore else None + assert vectorstore is not None, "vectorstore is not initialized" + worker_node = self.initialize_worker_node(worker_tools, vectorstore) boss_node = self.initialize_boss_node(vectorstore, worker_node)