Skip to content

Commit 672a8f7

Browse files
committed
update prompts for better format compliance
1 parent 8651d1b commit 672a8f7

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

codegpt/gpt_interface.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,28 +44,36 @@ def send_iffy_edit(prompt: str, code: Dict[str, str], clipboard: bool = False, y
4444
if clipboard:
4545
full_prompt += dedent("""
4646
47-
Answer in the following format:
47+
Answer in the following format, using '> ' to indent values:
4848
4949
explanation:
5050
> <The changes that you made>
5151
code:
5252
> <the code to be output line 1>
53-
> <the code to be output, line n...>""")
53+
> <the code to be output, line n...>
54+
55+
You must include an explanation of what you did, and the code to be output, regardless of the format or file.
56+
57+
OUTPUT:""")
5458

5559
else:
5660
full_prompt += dedent("""
5761
58-
You may only output complete files.
59-
60-
If you add or modify a file, return it in this exact format:
62+
You may only send me complete files.
6163
64+
For each file, return one block in this format, using '> ' to indent values:
65+
6266
filename:
6367
> <the filename to be output>
6468
explanation:
6569
> <The changes that you made>
6670
code:
6771
> <code line 1>
68-
> <code line n...>""")
72+
> <code line n...>
73+
74+
You must include the filename, an explanation of what you did, and the code for the file to be output, regardless of the format or file.
75+
76+
OUTPUT:""")
6977

7078
max_tokens = confirm_send(full_prompt, yes=yes, silent=clipboard)
7179

0 commit comments

Comments
 (0)