diff --git a/autocommit.py b/autocommit.py new file mode 100644 index 00000000..38d97806 --- /dev/null +++ b/autocommit.py @@ -0,0 +1,32 @@ +import os +import datetime +import time + +# Configure your repository details +repo_path = '.' +file_path = 'example.py' +commit_message = 'swarm' + +def make_change_and_commit(repo_path, file_path, commit_message): + # Change to the repository directory + os.chdir(repo_path) + + # Make a change in the file + with open(file_path, 'a') as file: + file.write('.') # Appending a dot to the file + + # Add the file to staging + os.system('git add ' + file_path) + + # Commit the change + current_time = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S") + os.system(f'git commit -m "{commit_message} at {current_time}"') + + # Push the commit + os.system('git push') + +if __name__ == "__main__": + while True: + make_change_and_commit(repo_path, file_path, commit_message) + print("Commit made. Waiting 10 seconds for the next commit.") + time.sleep(10) # Wait for 10 seconds before the next iteration diff --git a/playground/demos/autoswarm/autoswarm.py b/playground/demos/autoswarm/autoswarm.py new file mode 100644 index 00000000..86bbcb07 --- /dev/null +++ b/playground/demos/autoswarm/autoswarm.py @@ -0,0 +1,23 @@ +import os +from dotenv import load_dotenv +from swarms.models import OpenAIChat +from swarms.structs import Agent +import swarms.prompts.autoswarm as sdsp + +# Load environment variables and initialize the OpenAI Chat model +load_dotenv() +api_key = os.getenv("OPENAI_API_KEY") +llm = OpenAIChat(model_name = "gpt-4", openai_api_key=api_key) + +user_idea = "screenplay writing team" + +role_identification_agent = Agent(llm=llm, sop=sdsp.AGENT_ROLE_IDENTIFICATION_AGENT_PROMPT, max_loops=1) +agent_configuration_agent = Agent(llm=llm, sop=sdsp.AGENT_CONFIGURATION_AGENT_PROMPT, max_loops=1) +swarm_assembly_agent = Agent(llm=llm, sop=sdsp.SWARM_ASSEMBLY_AGENT_PROMPT, max_loops=1) +testing_optimization_agent = Agent(llm=llm, sop=sdsp.TESTING_OPTIMIZATION_AGENT_PROMPT, max_loops=1) + +# Process the user idea through each agent +role_identification_output = role_identification_agent.run(user_idea) +agent_configuration_output = agent_configuration_agent.run(role_identification_output) +swarm_assembly_output = swarm_assembly_agent.run(agent_configuration_output) +testing_optimization_output = testing_optimization_agent.run(swarm_assembly_output) diff --git a/playground/demos/swarm_daddy/swarm_daddy.py b/swarm_daddy.py similarity index 90% rename from playground/demos/swarm_daddy/swarm_daddy.py rename to swarm_daddy.py index 7c28e895..a4e6354f 100644 --- a/playground/demos/swarm_daddy/swarm_daddy.py +++ b/swarm_daddy.py @@ -7,9 +7,9 @@ import swarms.prompts.swarm_daddy as sdsp # Load environment variables and initialize the OpenAI Chat model load_dotenv() api_key = os.getenv("OPENAI_API_KEY") -llm = OpenAIChat(model_name = "gpt-4", openai_api_key=api_key) +llm = OpenAIChat(temperature = 0.8, model_name = "gpt-4", openai_api_key=api_key) -user_idea = "screenplay writing team" +user_idea = "party planning" role_identification_agent = Agent(llm=llm, sop=sdsp.AGENT_ROLE_IDENTIFICATION_AGENT_PROMPT, max_loops=1) agent_configuration_agent = Agent(llm=llm, sop=sdsp.AGENT_CONFIGURATION_AGENT_PROMPT, max_loops=1) diff --git a/swarms/prompts/swarm_daddy.py b/swarms/prompts/autoswarm.py similarity index 100% rename from swarms/prompts/swarm_daddy.py rename to swarms/prompts/autoswarm.py