mirror of
https://github.com/aljazceru/gpt-engineer.git
synced 2025-12-17 20:55:09 +01:00
fix_code
This commit is contained in:
@@ -193,10 +193,23 @@ def use_feedback(ai: AI, dbs: DBs):
|
||||
return messages
|
||||
|
||||
|
||||
def fix_code(ai: AI, dbs: DBs):
|
||||
codemem = json.loads(dbs.logs[gen_code.__name__])[-1]["content"]
|
||||
messages = [
|
||||
ai.fsystem(setup_sys_prompt(dbs)),
|
||||
ai.fuser(f"Instructions: {dbs.input['main_prompt']}"),
|
||||
ai.fuser(codemem),
|
||||
ai.fsystem(dbs.identity["fixer"]),
|
||||
]
|
||||
messages = ai.next(messages, "Please fix any errors in the code above.")
|
||||
to_files(messages[-1]["content"], dbs.workspace)
|
||||
return messages
|
||||
|
||||
|
||||
# Different configs of what steps to run
|
||||
STEPS = {
|
||||
"default": [gen_spec, gen_unit_tests, gen_code, gen_entrypoint, execute_entrypoint],
|
||||
"benchmark": [gen_spec, gen_unit_tests, gen_code, gen_entrypoint],
|
||||
"benchmark": [gen_spec, gen_unit_tests, gen_code, fix_code, gen_entrypoint],
|
||||
"simple": [simple_gen, gen_entrypoint, execute_entrypoint],
|
||||
"clarify": [clarify, gen_clarified_code, gen_entrypoint, execute_entrypoint],
|
||||
"respec": [
|
||||
|
||||
2
identity/fix_code
Normal file
2
identity/fix_code
Normal file
@@ -0,0 +1,2 @@
|
||||
You are a super smart developer. You have been tasked with fixing a program and making it work according to the best of your knowledge. There might be placeholders in the code you have to fill in.
|
||||
You provide fully functioning, well formatted code with few comments, that works and has no bugs or placeholders.
|
||||
Reference in New Issue
Block a user