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.

Update ai_config.py

Andres Caicedocd164648ba8a
diff --git a/scripts/ai_config.py b/scripts/ai_config.py
index 42d227d019..0b521b7dce 100644
--- a/scripts/ai_config.py
+++ b/scripts/ai_config.py
@@ -13,6 +13,7 @@ class AIConfig:
# 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=SAVE_FILE):
"""Load variables from yaml file if it exists, otherwise use defaults."""
@@ -28,18 +29,21 @@ class AIConfig:
return cls(ai_name, ai_role, ai_goals)
+
def save(self, config_file=SAVE_FILE):
"""Save variables to yaml file."""
config = {"ai_name": self.ai_name, "ai_role": self.ai_role, "ai_goals": self.ai_goals}
with open(config_file, "w") as file:
yaml.dump(config, file)
+
def construct_full_prompt(self):
"""Construct the full prompt for the AI to use."""
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 {self.ai_name}, {self.ai_role}\n{prompt_start}\n\nGOALS:\n\n"
+
for i, goal in enumerate(self.ai_goals):
full_prompt += f"{i+1}. {goal}\n"