From 241b99ec27b0a134e03082bd34fe65a9bd9d47c6 Mon Sep 17 00:00:00 2001 From: Kye Date: Sun, 16 Jul 2023 14:29:21 -0400 Subject: [PATCH] clean up Former-commit-id: ffcce48cbad94f580417d03ec3bd75b5cb0c05c7 --- swarms/agents/boss/BossNode.py | 6 +++--- swarms/swarms.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/swarms/agents/boss/BossNode.py b/swarms/agents/boss/BossNode.py index 5b85b05e..8ebf7e7e 100644 --- a/swarms/agents/boss/BossNode.py +++ b/swarms/agents/boss/BossNode.py @@ -6,7 +6,7 @@ from swarms.tools.agent_tools import * logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') # ---------- Boss Node ---------- -class BossNode: +class BossNodeInitializer: """ The BossNode class is responsible for creating and executing tasks using the BabyAGI model. It takes a language model (llm), a vectorstore for memory, an agent_executor for task execution, and a maximum number of iterations for the BabyAGI model. @@ -72,7 +72,7 @@ class BossNode: raise ValueError("Objective cannot be empty.") return {"objective": objective} - def execute_task(self, task): + def run(self, task): """ Executes a task using the BabyAGI model. """ @@ -89,7 +89,7 @@ class BossNode: # from swarms import BossNode, OpenAI, LLMChain, Tool, ZeroShotAgent, AgentExecutor, PromptTemplate -def boss_node(objective, api_key=None, vectorstore=None, worker_node=None, llm_class=OpenAI, max_iterations=5, verbose=False): +def BossNode(objective, api_key=None, vectorstore=None, worker_node=None, llm_class=OpenAI, max_iterations=5, verbose=False): """ Wrapper function to initialize and use BossNode with given parameters. API key can be passed as argument or set as an environment variable. diff --git a/swarms/swarms.py b/swarms/swarms.py index e4c25f69..eea1fe02 100644 --- a/swarms/swarms.py +++ b/swarms/swarms.py @@ -3,7 +3,7 @@ import asyncio from swarms.tools.agent_tools import * from swarms.agents.workers.WorkerNode import WorkerNode, worker_node -from swarms.agents.boss.BossNode import BossNode +from swarms.agents.boss.BossNode import BossNodeInitializer as BossNode from swarms.agents.workers.WorkerUltraNode import WorkerUltra logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') @@ -159,7 +159,7 @@ class Swarms: task = boss_node.create_task(objective) logging.info(f"Running task: {task}") - result = await boss_node.execute_task(task) + result = await boss_node.run(task) logging.info(f"Completed tasks: {task}") return result except Exception as e: