diff --git a/setup.py b/setup.py index a21e6325..176c57fb 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup, find_packages setup( name = 'swarms', packages = find_packages(exclude=[]), - version = '1.0.2', + version = '1.0.3', license='MIT', description = 'Swarms - Pytorch', author = 'Kye Gomez', diff --git a/swarms/swarms.py b/swarms/swarms.py index 72be779b..5dcefdeb 100644 --- a/swarms/swarms.py +++ b/swarms/swarms.py @@ -16,7 +16,7 @@ logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %( from swarms.utils.task import Task class Swarms: - def __init__(self, openai_api_key="", use_vectorstore=True, use_async=True): + def __init__(self, openai_api_key="", use_vectorstore=True, use_async=True, human_in_the_loop=True): #openai_api_key: the openai key. Default is empty if not openai_api_key: logging.error("OpenAI key is not provided") @@ -25,6 +25,7 @@ class Swarms: self.openai_api_key = openai_api_key self.use_vectorstore = use_vectorstore self.use_async = use_async + self.human_in_the_loop = human_in_the_loop def initialize_llm(self, llm_class, temperature=0.5): """ @@ -107,7 +108,7 @@ class Swarms: # Initialize worker node llm = self.initialize_llm(ChatOpenAI) worker_node = WorkerNodeInitializer(llm=llm, tools=worker_tools, vectorstore=vectorstore) - worker_node.create_agent(ai_name=ai_name, ai_role="Assistant", human_in_the_loop=False, search_kwargs={}, human_in_the_loop=human_in_the_loop) # add search kwargs + worker_node.create_agent(ai_name=ai_name, ai_role="Assistant", human_in_the_loop=False, search_kwargs={}, human_in_the_loop=self.human_in_the_loop) # add search kwargs worker_node_tool = Tool(name="WorkerNode AI Agent", func=worker_node.run, description="Input: an objective with a todo list for that objective. Output: your task completed: Please be very clear what the objective and task instructions are. The Swarm worker agent is Useful for when you need to spawn an autonomous agent instance as a worker to accomplish any complex tasks, it can search the internet or write code or spawn child multi-modality models to process and generate images and text or audio and so on") return worker_node_tool