From af40e4643665648aee9f135f4714cd199eaf7bef Mon Sep 17 00:00:00 2001 From: Kye Date: Wed, 5 Jul 2023 16:56:16 -0400 Subject: [PATCH] swarms --- swarms/swarms.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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: