From df328fdd7db5e883b2f98cda4c92047ca83930a7 Mon Sep 17 00:00:00 2001 From: Kye Date: Tue, 15 Aug 2023 18:27:43 -0400 Subject: [PATCH] devlopers tools Former-commit-id: e3837d80d1b00f99dad525ae9c524a02c6714d19 --- swarms/swarms/swarms.py | 2 +- swarms/workers/worker_node.py | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/swarms/swarms/swarms.py b/swarms/swarms/swarms.py index 3f10b3ec..b284c47a 100644 --- a/swarms/swarms/swarms.py +++ b/swarms/swarms/swarms.py @@ -47,7 +47,7 @@ class HierarchicalSwarm: self.boss_node = BossNode( api_key=self.openai_api_key, - # worker_node=self.worker_node, + worker_node=self.worker_node, llm_class=OpenAI, max_iterations=self.max_iterations, verbose=self.verbose diff --git a/swarms/workers/worker_node.py b/swarms/workers/worker_node.py index bcbbb641..bd833c5a 100644 --- a/swarms/workers/worker_node.py +++ b/swarms/workers/worker_node.py @@ -6,18 +6,28 @@ from langchain.agents import Tool from langchain.chat_models import ChatOpenAI from langchain.docstore import InMemoryDocstore from langchain.embeddings import OpenAIEmbeddings -from langchain_experimental.autonomous_agents import AutoGPT from langchain.vectorstores import FAISS +from langchain_experimental.autonomous_agents import AutoGPT + from swarms.agents.tools.autogpt import ( + DuckDuckGoSearchRun, FileChatMessageHistory, ReadFileTool, WebpageQATool, WriteFileTool, - DuckDuckGoSearchRun, load_qa_with_sources_chain, process_csv, web_search, ) +from swarms.agents.tools.developer import ( + code_editor_append, + code_editor_delete, + code_editor_patch, + code_editor_read, + code_editor_summary, + code_editor_write, + terminal_execute, +) ROOT_DIR = "./data/" @@ -223,6 +233,13 @@ class WorkerNode: ReadFileTool(root_dir=ROOT_DIR), process_csv, WebpageQATool(qa_chain=load_qa_with_sources_chain(llm)), + code_editor_append, + code_editor_delete, + code_editor_patch, + code_editor_read, + code_editor_summary, + code_editor_write, + terminal_execute, ] if not tools: logging.error("Tools are not initialized")