diff --git a/swarms/swarms.py b/swarms/swarms.py index 41c5decc..f23302b1 100644 --- a/swarms/swarms.py +++ b/swarms/swarms.py @@ -58,7 +58,7 @@ index = faiss.IndexFlatL2(embedding_size) vectorstore = FAISS(embeddings_model.embed_query, index, InMemoryDocstore({}), {}) # ---------- Worker Node ---------- -@tool("workerAgent", return_direct=True) +@tool("WorkerAgent", return_direct=True) class WorkerNode: def __init__(self, llm, tools, vectorstore): self.llm = llm @@ -82,6 +82,7 @@ class WorkerNode: """ self.agent.run([f"{tree_of_thoughts_prompt} {prompt}"]) + worker_node = WorkerNode(llm=llm, tools=tools, vectorstore=vectorstore) # ---------- Boss Node ---------- @@ -143,11 +144,7 @@ tool_names = [tool.name for tool in tools] agent = ZeroShotAgent(llm_chain=llm_chain, allowed_tools=tool_names) agent_executor = AgentExecutor.from_agent_and_tools(agent=agent, tools=tools, verbose=True) -# boss_node = BossNode(llm=llm, vectorstore=vectorstore, task_execution_chain=agent_executor, verbose=True, max_iterations=5) - - - - +boss_node = BossNode(llm=llm, vectorstore=vectorstore, task_execution_chain=agent_executor, verbose=True, max_iterations=5) class Swarms: