diff --git a/playground/agents/multion_examples/ multion_example.py b/ multion_example.py similarity index 82% rename from playground/agents/multion_examples/ multion_example.py rename to multion_example.py index 43ca622f..6a3c22ed 100644 --- a/playground/agents/multion_examples/ multion_example.py +++ b/ multion_example.py @@ -8,10 +8,7 @@ def run_model(api_key): api_key=api_key, max_steps=500, url="https://x.com" ) out = model.run( - """ - click on the 'Tweet' button to start a new tweet and post it saying: $pip3 install swarms - - """ + "" ) print(out) diff --git a/README.md b/README.md index d071f5d6..ac338dbb 100644 --- a/README.md +++ b/README.md @@ -1127,122 +1127,6 @@ mv = MajorityVoting( # Start the majority voting mv.run("What is your stance on healthcare?") ``` - -### Real-World Deployment - -### Multi-Agent Swarm for Logistics -Here's a production grade swarm ready for real-world deployment in a factory and logistics settings like warehouses. This swarm can automate 3 costly and inefficient workflows, safety checks, productivity checks, and warehouse security. - - -```python -import os - -from dotenv import load_dotenv - -from swarms.models import GPT4VisionAPI -from swarms.prompts.logistics import ( - Efficiency_Agent_Prompt, - Health_Security_Agent_Prompt, - Productivity_Agent_Prompt, - Quality_Control_Agent_Prompt, - Safety_Agent_Prompt, - Security_Agent_Prompt, - Sustainability_Agent_Prompt, -) -from swarms.structs import Agent - -# Load ENV -load_dotenv() -api_key = os.getenv("OPENAI_API_KEY") - -# GPT4VisionAPI -llm = GPT4VisionAPI(openai_api_key=api_key) - -# Image for analysis -factory_image = "factory_image1.jpg" - -# Initialize agents with respective prompts -health_security_agent = Agent( - llm=llm, - sop=Health_Security_Agent_Prompt, - max_loops=1, - multi_modal=True, -) - -# Quality control agent -quality_control_agent = Agent( - llm=llm, - sop=Quality_Control_Agent_Prompt, - max_loops=1, - multi_modal=True, -) - - -# Productivity Agent -productivity_agent = Agent( - llm=llm, - sop=Productivity_Agent_Prompt, - max_loops=1, - multi_modal=True, -) - -# Initiailize safety agent -safety_agent = Agent(llm=llm, sop=Safety_Agent_Prompt, max_loops=1, multi_modal=True) - -# Init the security agent -security_agent = Agent( - llm=llm, sop=Security_Agent_Prompt, max_loops=1, multi_modal=True -) - - -# Initialize sustainability agent -sustainability_agent = Agent( - llm=llm, - sop=Sustainability_Agent_Prompt, - max_loops=1, - multi_modal=True, -) - - -# Initialize efficincy agent -efficiency_agent = Agent( - llm=llm, - sop=Efficiency_Agent_Prompt, - max_loops=1, - multi_modal=True, -) - -# Run agents with respective tasks on the same image -health_analysis = health_security_agent.run( - "Analyze the safety of this factory", factory_image -) -quality_analysis = quality_control_agent.run( - "Examine product quality in the factory", factory_image -) -productivity_analysis = productivity_agent.run( - "Evaluate factory productivity", factory_image -) -safety_analysis = safety_agent.run( - "Inspect the factory's adherence to safety standards", - factory_image, -) -security_analysis = security_agent.run( - "Assess the factory's security measures and systems", - factory_image, -) -sustainability_analysis = sustainability_agent.run( - "Examine the factory's sustainability practices", factory_image -) -efficiency_analysis = efficiency_agent.run( - "Analyze the efficiency of the factory's manufacturing process", - factory_image, -) -``` ---- - - - - ## Build your own LLMs, Agents, and Swarms! ### Swarms Compliant Model Interface diff --git a/playground/demos/plant_biologist_swarm/bad_tomato.jpg b/bad_tomato.jpg similarity index 100% rename from playground/demos/plant_biologist_swarm/bad_tomato.jpg rename to bad_tomato.jpg diff --git a/json_log_cleanup.py b/json_log_cleanup.py index 463f582e..6daf1620 100644 --- a/json_log_cleanup.py +++ b/json_log_cleanup.py @@ -31,4 +31,4 @@ def cleanup_json_logs(name: str = None): # Call the function -cleanup_json_logs("arifacts_swarmm_o1") +cleanup_json_logs("agriculture_swarm") diff --git a/jamba_swarm/api.py b/playground/demos/jamba_swarm/api.py similarity index 100% rename from jamba_swarm/api.py rename to playground/demos/jamba_swarm/api.py diff --git a/jamba_swarm/api_schemas.py b/playground/demos/jamba_swarm/api_schemas.py similarity index 100% rename from jamba_swarm/api_schemas.py rename to playground/demos/jamba_swarm/api_schemas.py diff --git a/jamba_swarm/jamba_llm.py b/playground/demos/jamba_swarm/jamba_llm.py similarity index 100% rename from jamba_swarm/jamba_llm.py rename to playground/demos/jamba_swarm/jamba_llm.py diff --git a/jamba_swarm/main.ipynb b/playground/demos/jamba_swarm/main.ipynb similarity index 100% rename from jamba_swarm/main.ipynb rename to playground/demos/jamba_swarm/main.ipynb diff --git a/jamba_swarm/main.py b/playground/demos/jamba_swarm/main.py similarity index 100% rename from jamba_swarm/main.py rename to playground/demos/jamba_swarm/main.py diff --git a/jamba_swarm/prompts.py b/playground/demos/jamba_swarm/prompts.py similarity index 100% rename from jamba_swarm/prompts.py rename to playground/demos/jamba_swarm/prompts.py diff --git a/jamba_swarm/simple_jamba_swarm.py b/playground/demos/jamba_swarm/simple_jamba_swarm.py similarity index 100% rename from jamba_swarm/simple_jamba_swarm.py rename to playground/demos/jamba_swarm/simple_jamba_swarm.py diff --git a/playground/swarms_example.ipynb b/playground/swarms_example.ipynb index 734687f1..ece6101d 100644 --- a/playground/swarms_example.ipynb +++ b/playground/swarms_example.ipynb @@ -8,7 +8,7 @@ }, "outputs": [], "source": [ - "!pip3 install -U swarms" + "!pip3 install -U swarms python-dotenv" ] }, { @@ -49,7 +49,7 @@ "\n", "# Initialize the language model\n", "llm = OpenAIChat(\n", - " temperature=0.5, model_name=\"gpt-4\", openai_api_key=api_key, max_tokens=4000\n", + " temperature=0.5, openai_api_key=api_key, max_tokens=4000\n", ")\n", "\n", "\n", @@ -95,7 +95,8 @@ "metadata": {}, "outputs": [], "source": [ - "from swarms import Agent, ChromaDB, OpenAIChat\n", + "from swarms import Agent, OpenAIChat\n", + "from playground.memory.chromadb_example import ChromaDB\n", "\n", "# Making an instance of the ChromaDB class\n", "memory = ChromaDB(\n", diff --git a/pyproject.toml b/pyproject.toml index 46551071..ac7207ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "swarms" -version = "5.2.3" +version = "5.2.5" description = "Swarms - Pytorch" license = "MIT" authors = ["Kye Gomez "] diff --git a/playground/demos/plant_biologist_swarm/swarm_workers_agents.py b/swarm_workers_agents.py similarity index 93% rename from playground/demos/plant_biologist_swarm/swarm_workers_agents.py rename to swarm_workers_agents.py index 2df24758..e35b0048 100644 --- a/playground/demos/plant_biologist_swarm/swarm_workers_agents.py +++ b/swarm_workers_agents.py @@ -28,7 +28,7 @@ api_key = os.environ.get("OPENAI_API_KEY") # llm = llm, -llm = GPT4o(max_tokens=200, openai_api_key=os.getenv("OPENAI_API_KEY")) +llm = GPT4o(max_tokens=3000, openai_api_key=os.getenv("OPENAI_API_KEY")) # Initialize Diagnoser Agent diagnoser_agent = Agent( @@ -42,6 +42,7 @@ diagnoser_agent = Agent( # saved_state_path="diagnoser.json", multi_modal=True, autosave=True, + streaming_on=True, ) # Initialize Harvester Agent @@ -56,6 +57,7 @@ harvester_agent = Agent( # saved_state_path="harvester.json", multi_modal=True, autosave=True, + streaming_on=True, ) # Initialize Growth Predictor Agent @@ -70,6 +72,7 @@ growth_predictor_agent = Agent( # saved_state_path="growth_predictor.json", multi_modal=True, autosave=True, + streaming_on=True, ) # Initialize Treatment Recommender Agent @@ -84,6 +87,7 @@ treatment_recommender_agent = Agent( # saved_state_path="treatment_recommender.json", multi_modal=True, autosave=True, + streaming_on=True, ) # Initialize Disease Detector Agent @@ -98,6 +102,7 @@ disease_detector_agent = Agent( # saved_state_path="disease_detector.json", multi_modal=True, autosave=True, + streaming_on=True, ) agents = [ diagnoser_agent, @@ -108,7 +113,7 @@ agents = [ ] task = "Conduct a diagnosis on the plants's symptoms, this wasn't grown in dirt, it grew from hydroponics" -img = "tomato.jpg" +img = "bad_tomato.jpg" loop = 0 for i in range(len(agents)):