diff --git a/examples/generate_codebase_playable_snake.py b/examples/generate_codebase_playable_snake.py index 7c648313..9658cd67 100644 --- a/examples/generate_codebase_playable_snake.py +++ b/examples/generate_codebase_playable_snake.py @@ -1,5 +1,8 @@ from l2mac import generate_codebase -codebase: dict = generate_codebase("Create a beautiful playable python snake game with pygame") +codebase: dict = generate_codebase( + "Create a beautiful playable python snake game with pygame. Make the snake move a step size of 10 each key press, and generate the food on this same step size grid too.", + steps=2, +) print(codebase) # it will print the codebase (repo) complete with all the files as a dictionary diff --git a/l2mac/l2mac.py b/l2mac/l2mac.py index 59286027..f213ceb0 100644 --- a/l2mac/l2mac.py +++ b/l2mac/l2mac.py @@ -106,7 +106,7 @@ def reset(self): self.message_hash = hash_messages([]) self.log_folder_path = f"{self.config.setup.log_path.split('.txt')[0]}_{self.env.env_name}_{self.env.seed}/" - self.folder_path = f"workspace/{self.project_name}_{self.config.setup.log_path.split('_')[0].split('/')[1]}/" + self.folder_path = f"workspace/{self.project_name + '_' if self.project_name else ''}{self.config.setup.log_path.split('_')[0].split('/')[1]}/" Path(self.folder_path).mkdir(parents=True, exist_ok=True) Path(self.log_folder_path).mkdir(parents=True, exist_ok=True) write_files_from_dict(self.file_dict, base_dir=f"{self.folder_path}") @@ -212,7 +212,7 @@ def get_function_names_as_str(self): def get_file_names(self): # Simple implementation, for now, can be improved. - return self.get_file_names() + return list(self.file_dict.keys()) def run(self, steps: int = 10): return self._run(steps=steps) diff --git a/l2mac/prompts/load_prompts.py b/l2mac/prompts/load_prompts.py index 34c46277..847ccf9d 100644 --- a/l2mac/prompts/load_prompts.py +++ b/l2mac/prompts/load_prompts.py @@ -12,6 +12,12 @@ class L2MACPrompts(BaseModel): system: str first_message: str reflect_on_prompt_program: str + test_writing_advice: str + control_unit_execute_instruction: str + control_unit_exhaust_context_window: str + control_unit_instruction_complete_summarize_output: str + control_unit_instruction_erroring_fix_the_code: str + control_unit_cycle_message_to_check_if_instruction_complete: str def get_l2mac_prompts(prompts_file_path: Optional[str], domain: Domain) -> L2MACPrompts: