Fixed code monkey code writing

This commit is contained in:
Zvonimir Sabljic
2023-08-03 11:20:11 +02:00
parent f5bc046e1c
commit 7496dceb7d
2 changed files with 5 additions and 3 deletions

View File

@@ -22,12 +22,12 @@ class CodeMonkey(Agent):
convo.save_branch('after_code_changes_breakdown')
for i, step in enumerate(steps):
convo.load_branch('after_code_changes_breakdown')
if step['type'] == 'run_command':
run_command_until_success(step['command'], step['description'], convo)
if step['type'] == 'command':
run_command_until_success(step['command'], step['command_timeout'], convo)
elif step['type'] == 'code_change':
files_needed = convo.send_message('development/task/request_files_for_code_changes.prompt', {
"instructions": code_changes_description,
"step_description": step['description'],
"step_description": step['code_change_description'],
"directory_tree": self.project.get_directory_tree(),
}, GET_FILES)

View File

@@ -14,3 +14,5 @@ You are currently working on this step from the instructions above:
```
I will give you each file that needs to be changed and you will implement changes from the instructions. To do this, you will need to see the currently implemented files so first, filter the files outlined above that are relevant for the instructions. Then, tell me files that you need to see so that you can make appropriate changes to the code. If no files are needed (eg. if you need to create a file), just return an empty array.
Remember, ask for files relative to the project root. For example, if you need a file with path `{project_root}/models/model.py`, you need to request the file `models/model.py`.