From 0ecfd5870724998740b29cff4f229c8c7a1fabd6 Mon Sep 17 00:00:00 2001 From: Kye Date: Wed, 5 Jul 2023 23:26:10 -0400 Subject: [PATCH] assetions --- swarms/swarms.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/swarms/swarms.py b/swarms/swarms.py index 8ba4689e..accee8ff 100644 --- a/swarms/swarms.py +++ b/swarms/swarms.py @@ -24,6 +24,7 @@ class Swarms: process_csv, WebpageQATool(qa_chain=load_qa_with_sources_chain(llm)), ] + assert tools is not None, "tools is not initialized" return tools def initialize_vectorstore(self): @@ -60,9 +61,12 @@ class Swarms: def run_swarms(self, objective): # Run the swarm with the given objective worker_tools = self.initialize_tools(OpenAI) + assert worker_tools is not None, "worker_tools is not initialized" + vectorstore = self.initialize_vectorstore() worker_node = self.initialize_worker_node(worker_tools, vectorstore) boss_node = self.initialize_boss_node(vectorstore, worker_node) + task = boss_node.create_task(objective) boss_node.execute_task(task) worker_node.run_agent(objective)