diff --git a/examples/README.md b/playground/examples/README.md similarity index 100% rename from examples/README.md rename to playground/examples/README.md diff --git a/examples/Screenshot from 2024-02-20 05-55-34.png b/playground/examples/Screenshot from 2024-02-20 05-55-34.png similarity index 100% rename from examples/Screenshot from 2024-02-20 05-55-34.png rename to playground/examples/Screenshot from 2024-02-20 05-55-34.png diff --git a/examples/example_agent.py b/playground/examples/example_agent.py similarity index 100% rename from examples/example_agent.py rename to playground/examples/example_agent.py diff --git a/examples/example_anthropic.py b/playground/examples/example_anthropic.py similarity index 100% rename from examples/example_anthropic.py rename to playground/examples/example_anthropic.py diff --git a/examples/example_concurrentworkflow.py b/playground/examples/example_concurrentworkflow.py similarity index 100% rename from examples/example_concurrentworkflow.py rename to playground/examples/example_concurrentworkflow.py diff --git a/examples/example_dalle3.py b/playground/examples/example_dalle3.py similarity index 100% rename from examples/example_dalle3.py rename to playground/examples/example_dalle3.py diff --git a/examples/example_gpt4vison.py b/playground/examples/example_gpt4vison.py similarity index 100% rename from examples/example_gpt4vison.py rename to playground/examples/example_gpt4vison.py diff --git a/examples/example_huggingfacellm.py b/playground/examples/example_huggingfacellm.py similarity index 100% rename from examples/example_huggingfacellm.py rename to playground/examples/example_huggingfacellm.py diff --git a/examples/example_idefics.py b/playground/examples/example_idefics.py similarity index 100% rename from examples/example_idefics.py rename to playground/examples/example_idefics.py diff --git a/examples/example_kosmos.py b/playground/examples/example_kosmos.py similarity index 100% rename from examples/example_kosmos.py rename to playground/examples/example_kosmos.py diff --git a/examples/example_logistics.py b/playground/examples/example_logistics.py similarity index 100% rename from examples/example_logistics.py rename to playground/examples/example_logistics.py diff --git a/examples/example_mixtral.py b/playground/examples/example_mixtral.py similarity index 100% rename from examples/example_mixtral.py rename to playground/examples/example_mixtral.py diff --git a/examples/example_qwenvlmultimodal.py b/playground/examples/example_qwenvlmultimodal.py similarity index 100% rename from examples/example_qwenvlmultimodal.py rename to playground/examples/example_qwenvlmultimodal.py diff --git a/examples/example_recursiveworkflow.py b/playground/examples/example_recursiveworkflow.py similarity index 100% rename from examples/example_recursiveworkflow.py rename to playground/examples/example_recursiveworkflow.py diff --git a/examples/example_sequentialworkflow.py b/playground/examples/example_sequentialworkflow.py similarity index 100% rename from examples/example_sequentialworkflow.py rename to playground/examples/example_sequentialworkflow.py diff --git a/examples/example_simple_conversation_agent.py b/playground/examples/example_simple_conversation_agent.py similarity index 100% rename from examples/example_simple_conversation_agent.py rename to playground/examples/example_simple_conversation_agent.py diff --git a/examples/example_swarmnetwork.py b/playground/examples/example_swarmnetwork.py similarity index 100% rename from examples/example_swarmnetwork.py rename to playground/examples/example_swarmnetwork.py diff --git a/examples/example_swarms.md b/playground/examples/example_swarms.md similarity index 100% rename from examples/example_swarms.md rename to playground/examples/example_swarms.md diff --git a/examples/example_task.py b/playground/examples/example_task.py similarity index 100% rename from examples/example_task.py rename to playground/examples/example_task.py diff --git a/examples/example_toolagent.py b/playground/examples/example_toolagent.py similarity index 100% rename from examples/example_toolagent.py rename to playground/examples/example_toolagent.py diff --git a/examples/example_worker.py b/playground/examples/example_worker.py similarity index 100% rename from examples/example_worker.py rename to playground/examples/example_worker.py diff --git a/examples/example_zeroscopetv.py b/playground/examples/example_zeroscopetv.py similarity index 100% rename from examples/example_zeroscopetv.py rename to playground/examples/example_zeroscopetv.py diff --git a/run_examples.sh b/run_examples.sh index e41c7e1f..3378d4af 100644 --- a/run_examples.sh +++ b/run_examples.sh @@ -3,7 +3,7 @@ # Define a file to keep track of successfully executed scripts SUCCESS_LOG="successful_runs.log" -for f in examples/example_*.py; do +for f in /home/v/swarms/playground/examples/example_*.py; do # Check if the script has been logged as successful if grep -Fxq "$f" "$SUCCESS_LOG"; then echo "Skipping ${f} as it ran successfully in a previous run." diff --git a/scripts/run_examples.sh b/scripts/run_examples.sh new file mode 100644 index 00000000..e41c7e1f --- /dev/null +++ b/scripts/run_examples.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# Define a file to keep track of successfully executed scripts +SUCCESS_LOG="successful_runs.log" + +for f in examples/example_*.py; do + # Check if the script has been logged as successful + if grep -Fxq "$f" "$SUCCESS_LOG"; then + echo "Skipping ${f} as it ran successfully in a previous run." + else + # Run the script if not previously successful + if /home/kye/miniconda3/envs/swarms/bin/python "$f" 2>>errors.txt; then + echo "(${f}) ran successfully without errors." + # Log the successful script execution + echo "$f" >> "$SUCCESS_LOG" + else + echo "Error encountered in ${f}. Check errors.txt for details." + break + fi + fi + echo "##############################################################################" +done