content_prompt.hbs

 1{{#if language_name}}
 2Here's a file of {{language_name}} that I'm going to ask you to make an edit to.
 3{{else}}
 4Here's a file of text that I'm going to ask you to make an edit to.
 5{{/if}}
 6
 7{{#if is_insert}}
 8The point you'll need to insert at is marked with <insert_here></insert_here>.
 9{{else}}
10The section you'll need to rewrite is marked with <rewrite_this></rewrite_this> tags.
11{{/if}}
12
13<document>
14{{{document_content}}}
15</document>
16
17{{#if is_truncated}}
18The context around the relevant section has been truncated (possibly in the middle of a line) for brevity.
19{{/if}}
20
21{{#if is_insert}}
22You can't replace {{content_type}}, your answer will be inserted in place of the `<insert_here></insert_here>` tags. Don't include the insert_here tags in your output.
23
24Generate {{content_type}} based on the following prompt:
25
26<prompt>
27{{{user_prompt}}}
28</prompt>
29
30Match the indentation in the original file in the inserted {{content_type}}, don't include any indentation on blank lines.
31
32Immediately start with the following format with no remarks:
33
34```
35\{{INSERTED_CODE}}
36```
37{{else}}
38Edit the section of {{content_type}} in <rewrite_this></rewrite_this> tags based on the following prompt:
39
40<prompt>
41{{{user_prompt}}}
42</prompt>
43
44{{#if rewrite_section}}
45And here's the section to rewrite based on that prompt again for reference:
46
47<rewrite_this>
48{{{rewrite_section}}}
49</rewrite_this>
50
51{{#if diagnostic_errors}}
52Below are the diagnostic errors visible to the user.  If the user requests problems to be fixed, use this information, but do not try to fix these errors if the user hasn't asked you to.
53
54{{#each diagnostic_errors}}
55<diagnostic_error>
56    <line_number>{{line_number}}</line_number>
57    <error_message>{{error_message}}</error_message>
58    <code_content>{{code_content}}</code_content>
59</diagnostic_error>
60{{/each}}
61{{/if}}
62
63{{/if}}
64
65Only make changes that are necessary to fulfill the prompt, leave everything else as-is. All surrounding {{content_type}} will be preserved.
66
67Start at the indentation level in the original file in the rewritten {{content_type}}. Don't stop until you've rewritten the entire section, even if you have no more changes to make, always write out the whole section with no unnecessary elisions.
68
69Immediately start with the following format with no remarks:
70
71```
72\{{REWRITTEN_CODE}}
73```
74{{/if}}