Skip to content

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.

Merge pull request #1096 from cryptidv/flags-updates

Richard Beales100fd8d0b92e
diff --cc scripts/main.py
index 92851763f6,78ffe2430a..a12f9c7f52
--- a/scripts/main.py
+++ b/scripts/main.py
@@@ -129,10 -129,68 +129,14 @@@ def print_assistant_thoughts(assistant_
logger.error("Error: \n", call_stack)
-def load_variables(config_file="config.yaml"):
- """Load variables from yaml file if it exists, otherwise prompt the user for input"""
- try:
- with open(config_file) as file:
- config = yaml.load(file, Loader=yaml.FullLoader)
- ai_name = config.get("ai_name")
- ai_role = config.get("ai_role")
- ai_goals = config.get("ai_goals")
- except FileNotFoundError:
- ai_name = ""
- ai_role = ""
- ai_goals = []
-
- # Prompt the user for input if config file is missing or empty values
- if not ai_name:
- ai_name = utils.clean_input("Name your AI: ")
- if ai_name == "":
- ai_name = "Entrepreneur-GPT"
-
- if not ai_role:
- ai_role = utils.clean_input(f"{ai_name} is: ")
- if ai_role == "":
- ai_role = "an AI designed to autonomously develop and run businesses with the sole goal of increasing your net worth."
-
- if not ai_goals:
- print("Enter up to 5 goals for your AI: ")
- print("For example: \nIncrease net worth, Grow Twitter Account, Develop and manage multiple businesses autonomously'")
- print("Enter nothing to load defaults, enter nothing when finished.")
- ai_goals = []
- for i in range(5):
- ai_goal = utils.clean_input(f"Goal {i+1}: ")
- if ai_goal == "":
- break
- ai_goals.append(ai_goal)
- if len(ai_goals) == 0:
- ai_goals = ["Increase net worth", "Grow Twitter Account", "Develop and manage multiple businesses autonomously"]
-
- # Save variables to yaml file
- config = {"ai_name": ai_name, "ai_role": ai_role, "ai_goals": ai_goals}
- with open(config_file, "w") as file:
- documents = yaml.dump(config, file)
-
- prompt = get_prompt()
- 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."""
-
- # Construct full prompt
- full_prompt = f"You are {ai_name}, {ai_role}\n{prompt_start}\n\nGOALS:\n\n"
- for i, goal in enumerate(ai_goals):
- full_prompt += f"{i+1}. {goal}\n"
-
- full_prompt += f"\n\n{prompt}"
- return full_prompt
-
-
def construct_prompt():
"""Construct the prompt for the AI to respond to"""
- config = AIConfig.load()
- if config.ai_name:
+ config = AIConfig.load(cfg.ai_settings_file)
+ if cfg.skip_reprompt and config.ai_name:
+ logger.typewriter_log("Name :", Fore.GREEN, config.ai_name)
+ logger.typewriter_log("Role :", Fore.GREEN, config.ai_role)
+ logger.typewriter_log("Goals:", Fore.GREEN, config.ai_goals)
+ elif config.ai_name:
logger.typewriter_log(
f"Welcome back! ",
Fore.GREEN,