From 5580ae3eb3f19e36035c049252801a4ec3d80453 Mon Sep 17 00:00:00 2001 From: Kye Date: Fri, 30 Jun 2023 15:27:31 -0400 Subject: [PATCH] clean up for init of main boss and worker classes --- example.py | 79 +++-------------------------------------------- worker_example.py | 13 ++------ 2 files changed, 7 insertions(+), 85 deletions(-) diff --git a/example.py b/example.py index bb45ba1c..b5491af7 100644 --- a/example.py +++ b/example.py @@ -1,79 +1,8 @@ -from swarms.agents.swarms import BossNode +from swarms import boss_node -# Initialize boss node with given parameters -boss_node = BossNode +#create a task +task = boss_node.create_task(objective="Write a research paper on the impact of climate change on global agriculture") -# Create and execute a task -task = boss_node.create_task("Write a weather report for SF today") +#execute the teask boss_node.execute_task(task) - - - - - - - - - - - - - - - - - - -###################################====================> -# from swarms.agents.workers.auto_agent import agent -# from swarms.agents.boss.babyagi_agent import baby_agi - -# OBJECTIVE = "Write a weather report for SF today" - -# baby_agi({"objective": OBJECTIVE}) - - - - - - - - -###################################====================> - -########### just autogpt agent, worker node -# agent.chain.verbose = True - - - -# tree_of_thoughts_prompt = """ - -# Imagine three different experts are answering this question. All experts will write down each chain of thought of each step of their thinking, then share it with the group. Then all experts will go on to the next step, etc. If any expert realises they're wrong at any point then they leave. The question is... - - -# """ - - -# #Input problem -# input_problem = """ - - -# Input: 2 8 8 14 -# Possible next steps: -# 2 + 8 = 10 (left: 8 10 14) -# 8 / 2 = 4 (left: 4 8 14) -# 14 + 2 = 16 (left: 8 8 16) -# 2 * 8 = 16 (left: 8 14 16) -# 8 - 2 = 6 (left: 6 8 14) -# 14 - 8 = 6 (left: 2 6 8) -# 14 / 2 = 7 (left: 7 8 8) -# 14 - 2 = 12 (left: 8 8 12) -# Input: use 4 numbers and basic arithmetic operations (+-*/) to obtain 24 in 1 equation -# Possible next steps: - - -# """ - -# agent.run([f"{tree_of_thoughts_prompt} {input_problem}"]) - diff --git a/worker_example.py b/worker_example.py index ce928cd7..75a8404c 100644 --- a/worker_example.py +++ b/worker_example.py @@ -1,14 +1,7 @@ -from swarms import WorkerNode, tools, vectorstore, llm -#define tools (assuming process csv) +from swarms import worker_node - - -#inti worker node with llm -worker_node = WorkerNode(llm=llm, tools=tools, vectorstore=vectorstore) - -#create an agent within the worker node -worker_node.create_agent(ai_name="AI Assistant", ai_role="Assistant", human_in_the_loop=True, search_kwargs={}) +#cretae an agent +worker_node.create_agent(ai_name="Workerx", ai_role="Assistant", human_in_the_loop=True, search_kwargs={"k": 8}) #use the agent to perform a task worker_node.run_agent("Find 20 potential customers for a Swarms based AI Agent automation infrastructure") -