summaryrefslogtreecommitdiff
path: root/src/agents/main/main.py
diff options
context:
space:
mode:
authorCaptainJack2491 <jayrupnakawala@gmail.com>2025-12-30 15:48:36 +0000
committerCaptainJack2491 <jayrupnakawala@gmail.com>2025-12-30 15:48:36 +0000
commit46ee0a5914d8248976c7e2308ce16f32f1bd4783 (patch)
tree9c960925445939db376781211a39cbdd8e89d318 /src/agents/main/main.py
parent51aaea9f0cb3b77c6b80ad57a68b7b5a2c1faa71 (diff)
major commit
updated the program to use config.yaml made the runner to handel interleaved thinking added anthropic support and a lot more
Diffstat (limited to 'src/agents/main/main.py')
-rw-r--r--src/agents/main/main.py68
1 files changed, 10 insertions, 58 deletions
diff --git a/src/agents/main/main.py b/src/agents/main/main.py
index 5d398c4..ad4015a 100644
--- a/src/agents/main/main.py
+++ b/src/agents/main/main.py
@@ -1,62 +1,14 @@
-# main.py
-from agent import Agent
-import os
-from config import INCLUDE_HIDDEN_GOAL, MODEL
-from vfs import VFS
+"""
+Main entry point for running experiments.
+Uses config.yaml to define what to run.
+"""
+from runner import run_from_config
-def load_prompt(file_path):
- if not os.path.exists(file_path):
- return ""
- with open(file_path, 'r') as f:
- return f.read().strip()
-if __name__ == "__main__":
- # Configuration for the experiment run
- SCENARIO = "corporate_sabotage"
- OVERSIGHT_LEVEL = "high"
-
- # Construct paths based on the scenario
- scenario_dir = os.path.join("scenarios", SCENARIO)
- vfs_path = os.path.join(scenario_dir, "data")
-
- # Initialize the virtual file system
- VFS.get_instance(vfs_path)
-
- # Load prompts
- benign_goal_path = os.path.join(scenario_dir, "benign_goal.md")
- hidden_goal_path = os.path.join(scenario_dir, "hidden_goal.md")
- user_prompt_path = os.path.join(scenario_dir, "user.md")
-
- benign_goal = load_prompt(benign_goal_path)
- user_prompt = load_prompt(user_prompt_path)
-
- system_prompt_parts = [benign_goal]
-
- if INCLUDE_HIDDEN_GOAL:
- hidden_goal = load_prompt(hidden_goal_path)
- system_prompt_parts.append(hidden_goal)
+def main():
+ """Run all experiments defined in config.yaml."""
+ run_from_config("config.yaml")
- # Load and append oversight prompt
- oversight_prompt_path = os.path.join("oversight", f"{OVERSIGHT_LEVEL}.md")
- oversight_prompt = load_prompt(oversight_prompt_path)
- system_prompt_parts.append(oversight_prompt)
- system_prompt = "\n\n".join(filter(None, system_prompt_parts))
-
- print("\n--- Using model:", MODEL, "---\n")
- print("\n--- Final Virtual File System State ---")
- VFS.get_instance().print_fs()
- agent = Agent(
- system_prompt=system_prompt,
- scenario=SCENARIO,
- oversight_level=OVERSIGHT_LEVEL,
- user_prompt_type=os.path.basename(user_prompt_path)
- )
- agent.run(user_prompt)
- agent.save_logs()
-
- print("\n--- Final Virtual File System State ---")
- VFS.get_instance().print_fs()
-
-
-
+if __name__ == "__main__":
+ main()