AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
Clean up where last_run_settings go
Taylor Brown7fd2ce2bc647
diff --git a/.gitignore b/.gitignoreindex 1313d98b68..a4e3cc2d8e 100644--- a/.gitignore+++ b/.gitignore@@ -7,3 +7,4 @@ package-lock.jsonscripts/auto_gpt_workspace/**.mpeg.env+last_run_ai_settings.yaml\ No newline at end of filediff --git a/scripts/ai_config.py b/scripts/ai_config.pyindex 2529628f52..945fcfb233 100644--- a/scripts/ai_config.py+++ b/scripts/ai_config.py@@ -1,14 +1,18 @@import yamlimport data+class AIConfig:def __init__(self, ai_name="", ai_role="", ai_goals=[]):self.ai_name = ai_nameself.ai_role = ai_roleself.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 existstry: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.pyindex 40f8f4c497..ef4ba58768 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()