diff --git a/.gitignore b/.gitignore index 1313d98b..a4e3cc2d 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ package-lock.json scripts/auto_gpt_workspace/* *.mpeg .env +last_run_ai_settings.yaml \ No newline at end of file diff --git a/scripts/ai_config.py b/scripts/ai_config.py index 2529628f..945fcfb2 100644 --- a/scripts/ai_config.py +++ b/scripts/ai_config.py @@ -1,14 +1,18 @@ import yaml import data + class AIConfig: def __init__(self, ai_name="", ai_role="", ai_goals=[]): self.ai_name = ai_name self.ai_role = ai_role self.ai_goals = ai_goals + # Soon this will go in a folder where it remembers more stuff about the run(s) + SAVE_FILE = "last_run_ai_settings.yaml" + @classmethod - def load(cls, config_file="config.yaml"): + def load(cls, config_file=SAVE_FILE): # Load variables from yaml file if it exists try: with open(config_file) as file: @@ -22,10 +26,10 @@ class AIConfig: return cls(ai_name, ai_role, ai_goals) - def save(self, config_file="config.yaml"): + def save(self, config_file=SAVE_FILE): config = {"ai_name": self.ai_name, "ai_role": self.ai_role, "ai_goals": self.ai_goals} with open(config_file, "w") as file: - documents = yaml.dump(config, file) + yaml.dump(config, file) def construct_full_prompt(self): prompt_start = """Your decisions must always be made independently without seeking user assistance. Play to your strengths as an LLM and pursue simple strategies with no legal complications.""" diff --git a/scripts/main.py b/scripts/main.py index 40f8f4c4..ef4ba587 100644 --- a/scripts/main.py +++ b/scripts/main.py @@ -172,7 +172,11 @@ def construct_prompt(): Fore.GREEN, "Let's continue our journey.", speak_text=True) - should_continue = input(f"Continue with the last settings? (Settings: {config.ai_name}, {config.ai_role}, {config.ai_goals}) (Y/n): ") + should_continue = input(f"""Continue with the last settings? +Name: {config.ai_name} +Role: {config.ai_role} +Goals: {config.ai_goals} +Continue (Y/n): """) if should_continue.lower() == "n": config = AIConfig()