From 93e844315c887182ecd6f84eab48109ef1d6fe42 Mon Sep 17 00:00:00 2001 From: Kye Date: Thu, 20 Jul 2023 10:44:17 -0400 Subject: [PATCH] deeper modularization Former-commit-id: 641d59731e04aa29b7e6d883bbf5f5fd9aa7f102 --- swarms/swarms.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/swarms/swarms.py b/swarms/swarms.py index 34d99e49..2b7bc849 100644 --- a/swarms/swarms.py +++ b/swarms/swarms.py @@ -13,13 +13,14 @@ logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %( from swarms.utils.task import Task class Swarms: - def __init__(self, openai_api_key=""): + def __init__(self, openai_api_key="", use_vectorstore=True): #openai_api_key: the openai key. Default is empty if not openai_api_key: logging.error("OpenAI key is not provided") raise ValueError("OpenAI API key is required") self.openai_api_key = openai_api_key + self.use_vectorstore = use_vectorstore def initialize_llm(self, llm_class, temperature=0.5): """ @@ -153,7 +154,7 @@ class Swarms: worker_tools = self.initialize_tools(OpenAI) assert worker_tools is not None, "worker_tools is not initialized" - vectorstore = self.initialize_vectorstore() + vectorstore = self.initialize_vectorstore() if self.use_vectorstore else None worker_node = self.initialize_worker_node(worker_tools, vectorstore) boss_node = self.initialize_boss_node(vectorstore, worker_node)