Skip to content

Commit

Permalink
clean up;
Browse files Browse the repository at this point in the history
Former-commit-id: 6671ad8
  • Loading branch information
kyegomez committed Jul 22, 2023
1 parent 135ba6d commit f3bc37c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
setup(
name = 'swarms',
packages = find_packages(exclude=[]),
version = '1.0.2',
version = '1.0.3',
license='MIT',
description = 'Swarms - Pytorch',
author = 'Kye Gomez',
Expand Down
5 changes: 3 additions & 2 deletions swarms/swarms.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
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")
Expand All @@ -25,6 +25,7 @@ def __init__(self, openai_api_key="", use_vectorstore=True, use_async=True):
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):
"""
Expand Down Expand Up @@ -107,7 +108,7 @@ def initialize_worker_node(self, worker_tools, vectorstore, llm_class=ChatOpenAI
# 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
Expand Down

0 comments on commit f3bc37c

Please sign in to comment.