|
|
@ -6,18 +6,28 @@ from langchain.agents import Tool
|
|
|
|
from langchain.chat_models import ChatOpenAI
|
|
|
|
from langchain.chat_models import ChatOpenAI
|
|
|
|
from langchain.docstore import InMemoryDocstore
|
|
|
|
from langchain.docstore import InMemoryDocstore
|
|
|
|
from langchain.embeddings import OpenAIEmbeddings
|
|
|
|
from langchain.embeddings import OpenAIEmbeddings
|
|
|
|
from langchain_experimental.autonomous_agents import AutoGPT
|
|
|
|
|
|
|
|
from langchain.vectorstores import FAISS
|
|
|
|
from langchain.vectorstores import FAISS
|
|
|
|
|
|
|
|
from langchain_experimental.autonomous_agents import AutoGPT
|
|
|
|
|
|
|
|
|
|
|
|
from swarms.agents.tools.autogpt import (
|
|
|
|
from swarms.agents.tools.autogpt import (
|
|
|
|
|
|
|
|
DuckDuckGoSearchRun,
|
|
|
|
FileChatMessageHistory,
|
|
|
|
FileChatMessageHistory,
|
|
|
|
ReadFileTool,
|
|
|
|
ReadFileTool,
|
|
|
|
WebpageQATool,
|
|
|
|
WebpageQATool,
|
|
|
|
WriteFileTool,
|
|
|
|
WriteFileTool,
|
|
|
|
DuckDuckGoSearchRun,
|
|
|
|
|
|
|
|
load_qa_with_sources_chain,
|
|
|
|
load_qa_with_sources_chain,
|
|
|
|
process_csv,
|
|
|
|
process_csv,
|
|
|
|
web_search,
|
|
|
|
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/"
|
|
|
|
ROOT_DIR = "./data/"
|
|
|
|
|
|
|
|
|
|
|
@ -223,6 +233,13 @@ class WorkerNode:
|
|
|
|
ReadFileTool(root_dir=ROOT_DIR),
|
|
|
|
ReadFileTool(root_dir=ROOT_DIR),
|
|
|
|
process_csv,
|
|
|
|
process_csv,
|
|
|
|
WebpageQATool(qa_chain=load_qa_with_sources_chain(llm)),
|
|
|
|
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:
|
|
|
|
if not tools:
|
|
|
|
logging.error("Tools are not initialized")
|
|
|
|
logging.error("Tools are not initialized")
|
|
|
|