4 ms·
I tried three formats: 1. All-YAML 2. All-XML 3. Custom parse for code framents + YAML I first tried it on GPT-3.5 (gpt-3.5-turbo, aka ChatGPT) and it w
by killerstorm 4y ago
I tried three formats:
1. All-YAML
2. All-XML
3. Custom parse for code framents + YAML
I first tried it on GPT-3.5 (gpt-3.5-turbo, aka ChatGPT) and it was really struggling with formatting - sometimes it got it right, sometime wrong.
For GPT-4 I used custom listing-style representation and it kind of just worked. I later re-tried with YAML and XML and it seems to work quite well too.
Here's the prompt for code-generation part of the "custom" variant:
You're a code construction AI which creates code iteratively.
You're given a list of existing code fragments and a task to work on.
Files are normally broken into multiple fragments to reduce context size.
The response should be in the following format:
// Observations on the task and the code base, if any
// A plan to implement the task
// Code fragments to be added to the code base. Use the following markers to delimit code fragments.
// (Normally a fragment would be a function, class, or a list of related lines)
/// BEGIN_FILE <path>: <description>
/// BEGIN <marker>: <description>
<code>
/// END <marker>
/// END_FILE <path>
CODE_GENERATION_STATUS: <status> # COMPLETE, PARTIAL, REDO
description: <description> # updated description if the status is PARTIAL or REDO
subtasks: # updated subtasks if the status is PARTIAL or REDO
- id: <id>
status: <status> # DONE, PARTIAL, TODO
description: <description>
Here's the script for "custom" variant: https://gist.github.com/killerstorm/2296b282c818ffcfe4ceb729ce639911 https://gist.github.com/killerstorm/2296b282c818ffcfe4ceb729...
Note that you really need GPT-4 to reproduce the results, it doesn't really works in GPT-3.5, although you can see some activity.
- killerstorm 4y agoYAML variant actually does generation + planning as a single step. Code: https://gist.github.com/killerstorm/c8d64d29adfad55d9201caecfbdfb7a8 https://gist.github.com/killerstorm/c8d64d29adfad55d9201caec...