Merge branch 'master' of https://github.com/elder-plinius/p-swarms
commit
01e17138da
@ -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
|
@ -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)
|
Loading…
Reference in new issue