You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
body: ress.length ? "Code review by ChatGPT" : "LGTM 👍",
150523
150525
event: 'COMMENT',
150524
150526
commit_id: commits[commits.length - 1].sha,
150525
150527
comments: ress,
@@ -150588,15 +150590,23 @@ class Chat {
150588
150590
const answerLanguage = process.env.LANGUAGE
150589
150591
? `Answer me in ${process.env.LANGUAGE},`
150590
150592
: '';
150591
-
const prompt = process.env.PROMPT ||
150592
-
'Below is a code patch, please help me do a brief code review on it. Any bug risks and/or improvement suggestions are welcome:';
150593
-
return `${prompt}, ${answerLanguage}:
150594
-
${patch}
150593
+
const userPrompt = process.env.PROMPT || 'Please review the following code patch. Focus on potential bugs, risks, and improvement suggestions.';
150594
+
const jsonFormatRequirement = '\nProvide your feedback in a strict JSON format with the following structure:\n' +
150595
+
'{\n' +
150596
+
' "lgtm": boolean, // true if the code looks good to merge, false if there are concerns\n' +
150597
+
' "review_comment": string // Your detailed review comments. You can use markdown syntax in this string, but the overall response must be a valid JSON\n' +
Copy file name to clipboardExpand all lines: src/chat.ts
+31-9Lines changed: 31 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -31,18 +31,26 @@ export class Chat {
31
31
? `Answer me in ${process.env.LANGUAGE},`
32
32
: '';
33
33
34
-
constprompt=
35
-
process.env.PROMPT||
36
-
'Below is a code patch, please help me do a brief code review on it. Any bug risks and/or improvement suggestions are welcome:';
34
+
constuserPrompt=process.env.PROMPT||'Please review the following code patch. Focus on potential bugs, risks, and improvement suggestions.';
35
+
36
+
constjsonFormatRequirement='\nProvide your feedback in a strict JSON format with the following structure:\n'+
37
+
'{\n'+
38
+
' "lgtm": boolean, // true if the code looks good to merge, false if there are concerns\n'+
39
+
' "review_comment": string // Your detailed review comments. You can use markdown syntax in this string, but the overall response must be a valid JSON\n'+
0 commit comments