From b06d1e1fdbfc24bad0faed5fb88b8e0e2f3f6f26 Mon Sep 17 00:00:00 2001 From: Kye Date: Tue, 4 Jul 2023 10:13:16 -0400 Subject: [PATCH] clean up file structure + example --- DOCUMENTATION.md => DOCS/DOCUMENTATION.md | 0 DOCKERFILE => Docker/Dockerfile | 0 .../docker-compose.yml | 0 example.py | 26 +++---------------- swarms/tools/main.py | 2 -- 5 files changed, 4 insertions(+), 24 deletions(-) rename DOCUMENTATION.md => DOCS/DOCUMENTATION.md (100%) rename DOCKERFILE => Docker/Dockerfile (100%) rename docker-compose.yml => Docker/docker-compose.yml (100%) diff --git a/DOCUMENTATION.md b/DOCS/DOCUMENTATION.md similarity index 100% rename from DOCUMENTATION.md rename to DOCS/DOCUMENTATION.md diff --git a/DOCKERFILE b/Docker/Dockerfile similarity index 100% rename from DOCKERFILE rename to Docker/Dockerfile diff --git a/docker-compose.yml b/Docker/docker-compose.yml similarity index 100% rename from docker-compose.yml rename to Docker/docker-compose.yml diff --git a/example.py b/example.py index e3347678..bd37a9a1 100644 --- a/example.py +++ b/example.py @@ -1,31 +1,13 @@ from swarms import Swarms # Retrieve your API key from the environment or replace with your actual key -api_key = os.getenv("OPENAI_API_KEY") +api_key = "api" # Initialize Swarms with your API key -swarm = Swarms(api_key) - -# Initialize lower level models and tools -llm = swarm.initialize_llm() -tools = swarm.initialize_tools(llm) - -# Initialize vector store -vectorstore = swarm.initialize_vectorstore() - -# Initialize the worker node -worker_node = swarm.initialize_worker_node(llm, tools, vectorstore) -worker_node.create_agent("AI Assistant", "Assistant", True, {}) +swarm = Swarms(openai_api_key=api_key) # Define an objective objective = "Find 20 potential customers for a Swarms based AI Agent automation infrastructure" -# Initialize the boss node -boss_node = swarm.initialize_boss_node(llm, vectorstore, agent_executor) - -# Create and execute a task -task = boss_node.create_task(objective) -boss_node.execute_task(task) - -# Use the worker agent to perform a task -worker_node.run_agent(objective) +# Run Swarms +swarm.run_swarms(objective) \ No newline at end of file diff --git a/swarms/tools/main.py b/swarms/tools/main.py index 4f9c6e45..4ae46272 100644 --- a/swarms/tools/main.py +++ b/swarms/tools/main.py @@ -2278,6 +2278,4 @@ math_tool = Tool( #####==========================================================================> TOOLS from langchain.tools.human.tool import HumanInputRun -from langchain.tools.file_management.read import ReadFileTool -from langchain.tools.file_management.write import WriteFileTool from langchain.tools import BaseTool, DuckDuckGoSearchRun