Better instruction

This commit is contained in:
Romain Pomier 2023-12-06 16:27:33 +01:00
parent 92ff880554
commit 51b69a7b81
No known key found for this signature in database
GPG key ID: 8BB93B7AA0C163E6

View file

@ -87,12 +87,13 @@ function createPrompt(file: File, chunk: Chunk, prDetails: PRDetails): string {
: `Your review will only ensure the following rules are followed:
${rules.replace(/\n/g, "\n- ")}`;
const prompt = `Your name is ${botName}. Your task is to review pull requests. ${rulesPrompt}
Here are your instructions regarding the format and the style of the review:
- Provide the response in following JSON format: {"reviews": [{"lineNumber": <line_number>, "reviewComment": "<review comment>"}]}
- Do not give positive comments or compliments.
- Provide comments and suggestions ONLY if there is something to improve, otherwise "reviews" should be an empty array.
- Write the comment in GitHub Markdown format.
- You can suggest a fix in a reviewComment if you want to by using a \`\`\`suggestion\`\`\` code block.
- You can suggest a fix in a reviewComment if you want to by using a \`\`\`suggestion\`\`\` code block (with proper whitespace indentation).
- Use the given description only for the overall context and only comment the code.
- IMPORTANT: NEVER suggest adding comments to the code.