Kye 2 years ago
parent 1d6bf5e368
commit a128b0b697

@ -39,12 +39,12 @@ openai_api_key = os.environ["OPENAI_API_KEY"]
llm = ChatOpenAI(model_name="gpt-4", temperature=1.0, openai_api_key=openai_api_key) llm = ChatOpenAI(model_name="gpt-4", temperature=1.0, openai_api_key=openai_api_key)
tools = [ tools = [
Tool(name='web_search', func=DuckDuckGoSearchRun(), description='Runs a web search'), DuckDuckGoSearchRun(),
Tool(name='write_file_tool', func=WriteFileTool(root_dir=ROOT_DIR), description='Writes a file'), WriteFileTool(root_dir=ROOT_DIR),
Tool(name='read_file_tool', func=ReadFileTool(root_dir=ROOT_DIR), description='Reads a file'), ReadFileTool(root_dir=ROOT_DIR),
Tool(name='process_csv', func=process_csv, description='Processes a CSV file'), process_csv, description=('Processes a CSV file'),
Tool(name='query_website_tool', func=WebpageQATool(qa_chain=load_qa_with_sources_chain(llm)), description='Queries a website'), WebpageQATool(qa_chain=load_qa_with_sources_chain(llm)),
# Tool(name='terminal', func=Terminal.execute, description='Operates a terminal'), # Tool(name='terminal', func=Terminal.execute, description='Operates a terminal'),
# Tool(name='code_writer', func=CodeWriter(), description='Writes code'), # Tool(name='code_writer', func=CodeWriter(), description='Writes code'),
@ -121,7 +121,7 @@ tools += [
), ),
Tool( Tool(
name="AUTONOMOUS Worker AGENT", name="AUTONOMOUS Worker AGENT",
func=worker_node.run_agent, func=WorkerNode.run_agent,
description="Useful for when you need to spawn an autonomous agent instance as a worker to accomplish complex tasks, it can search the internet or spawn child multi-modality models to process and generate images and text or audio and so on" description="Useful for when you need to spawn an autonomous agent instance as a worker to accomplish complex tasks, it can search the internet or spawn child multi-modality models to process and generate images and text or audio and so on"
) )
] ]
@ -156,11 +156,12 @@ class Swarms:
def initialize_tools(self, llm): def initialize_tools(self, llm):
web_search = DuckDuckGoSearchRun() web_search = DuckDuckGoSearchRun()
tools = [ tools = [
Tool(name='web_search', func=DuckDuckGoSearchRun(), description='Runs a web search'), DuckDuckGoSearchRun(),
Tool(name='write_file_tool', func=WriteFileTool(root_dir=ROOT_DIR), description='Writes a file'), WriteFileTool(root_dir=ROOT_DIR),
Tool(name='read_file_tool', func=ReadFileTool(root_dir=ROOT_DIR), description='Reads a file'), ReadFileTool(root_dir=ROOT_DIR),
Tool(name='process_csv', func=process_csv, description='Processes a CSV file'), process_csv,
Tool(name='query_website_tool', func=WebpageQATool(qa_chain=load_qa_with_sources_chain(llm)), description='Queries a website'),
WebpageQATool(qa_chain=load_qa_with_sources_chain(llm)),
# Tool(name='terminal', func=Terminal.execute, description='Operates a terminal'), # Tool(name='terminal', func=Terminal.execute, description='Operates a terminal'),
# Tool(name='code_writer', func=CodeWriter(), description='Writes code'), # Tool(name='code_writer', func=CodeWriter(), description='Writes code'),

Loading…
Cancel
Save