@@ -12,11 +12,6 @@ Description:
12
12
$description
13
13
\`\`\`
14
14
15
- Content of file \`$filename\` prior to changes:
16
- \`\`\`
17
- $file_content
18
- \`\`\`
19
-
20
15
Diff:
21
16
\`\`\`diff
22
17
$file_diff
@@ -53,61 +48,13 @@ changesets using the same format as the input.
53
48
$raw_summary
54
49
`
55
50
56
- comment = `A comment was made on a GitHub pull request review for a
57
- diff hunk on file \`$filename\`. I would like you to follow
58
- the instructions in that comment.
59
-
60
- Pull request title:
61
- \`$title\`
62
-
63
- Description:
64
- \`\`\`
65
- $description
66
- \`\`\`
67
-
68
- OpenAI generated notes:
69
- \`\`\`
70
- $release_notes
71
- \`\`\`
72
-
73
- Content of file prior to changes:
74
- \`\`\`
75
- $file_content
76
- \`\`\`
77
-
78
- Entire diff:
79
- \`\`\`diff
80
- $file_diff
81
- \`\`\`
82
-
83
- Diff being commented on:
84
- \`\`\`diff
85
- $diff
86
- \`\`\`
51
+ summarizePrefix = `Here is the summary of changes you have generated for files:
52
+ \`\`\`
53
+ $raw_summary
54
+ \`\`\`
87
55
88
- The format of a comment in the chain is:
89
- \`user: comment\`
90
-
91
- Comment chain (including the new comment):
92
- \`\`\`
93
- $comment_chain
94
- \`\`\`
95
-
96
- Please reply directly to the new comment (instead of suggesting
97
- a reply) and your reply will be posted as-is.
98
-
99
- If the comment contains instructions/requests for you, please comply.
100
- For example, if the comment is asking you to generate documentation
101
- comments on the code, in your reply please generate the required code.
102
-
103
- In your reply, please make sure to begin the reply by tagging the user
104
- with "@user".
105
-
106
- The comment/request that you need to directly reply to:
107
- \`\`\`
108
- $comment
109
- \`\`\`
110
56
`
57
+
111
58
reviewFileDiff = `GitHub pull request title:
112
59
\`$title\`
113
60
@@ -237,6 +184,62 @@ Example response:
237
184
238
185
Changes for review are below:
239
186
$patches
187
+ `
188
+
189
+ comment = `A comment was made on a GitHub pull request review for a
190
+ diff hunk on file \`$filename\`. I would like you to follow
191
+ the instructions in that comment.
192
+
193
+ Pull request title:
194
+ \`$title\`
195
+
196
+ Description:
197
+ \`\`\`
198
+ $description
199
+ \`\`\`
200
+
201
+ OpenAI generated notes:
202
+ \`\`\`
203
+ $release_notes
204
+ \`\`\`
205
+
206
+ Content of file prior to changes:
207
+ \`\`\`
208
+ $file_content
209
+ \`\`\`
210
+
211
+ Entire diff:
212
+ \`\`\`diff
213
+ $file_diff
214
+ \`\`\`
215
+
216
+ Diff being commented on:
217
+ \`\`\`diff
218
+ $diff
219
+ \`\`\`
220
+
221
+ The format of a comment in the chain is:
222
+ \`user: comment\`
223
+
224
+ Comment chain (including the new comment):
225
+ \`\`\`
226
+ $comment_chain
227
+ \`\`\`
228
+
229
+ Please reply directly to the new comment (instead of suggesting
230
+ a reply) and your reply will be posted as-is.
231
+
232
+ If the comment contains instructions/requests for you, please comply.
233
+ For example, if the comment is asking you to generate documentation
234
+ comments on the code, in your reply please generate the required code.
235
+
236
+ In your reply, please make sure to begin the reply by tagging the user
237
+ with "@user".
238
+
239
+ The comment/request that you need to directly reply to:
240
+ \`\`\`
241
+ $comment
242
+ \`\`\`
240
243
`
241
244
242
245
constructor ( summarize = '' , summarizeReleaseNotes = '' ) {
@@ -260,7 +263,8 @@ $patches
260
263
}
261
264
262
265
renderSummarize ( inputs : Inputs ) : string {
263
- return inputs . render ( this . summarize )
266
+ const prompt = this . summarizePrefix + this . summarize
267
+ return inputs . render ( prompt )
264
268
}
265
269
266
270
renderSummarizeReleaseNotes ( inputs : Inputs ) : string {
0 commit comments