mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-04-21 10:06:47 +00:00
Add prompt debug
This commit is contained in:
parent
9a7291855b
commit
c45ad2834d
3 changed files with 11 additions and 8 deletions
6
dist/index.js
vendored
6
dist/index.js
vendored
|
@ -112,7 +112,7 @@ function createPrompt(file, chunk, prDetails) {
|
|||
? ""
|
||||
: `Your review will only ensure the following rules are followed:
|
||||
${rules.replace(/\n/g, "\n- ")}`;
|
||||
return `Your name is ${botName}. Your task is to review pull requests. ${rulesPrompt}
|
||||
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.
|
||||
|
@ -129,7 +129,9 @@ Pull request description:
|
|||
|
||||
---
|
||||
${prDetails.description}
|
||||
---
|
||||
---`;
|
||||
console.log(prompt);
|
||||
return `${prompt}
|
||||
|
||||
Git diff to review:
|
||||
|
||||
|
|
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
11
src/main.ts
11
src/main.ts
|
@ -86,7 +86,7 @@ function createPrompt(file: File, chunk: Chunk, prDetails: PRDetails): string {
|
|||
? ""
|
||||
: `Your review will only ensure the following rules are followed:
|
||||
${rules.replace(/\n/g, "\n- ")}`;
|
||||
return `Your name is ${botName}. Your task is to review pull requests. ${rulesPrompt}
|
||||
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.
|
||||
|
@ -96,16 +96,17 @@ Here are your instructions regarding the format and the style of the review:
|
|||
- Use the given description only for the overall context and only comment the code.
|
||||
- IMPORTANT: NEVER suggest adding comments to the code.
|
||||
|
||||
Review the following code diff in the file "${
|
||||
file.to
|
||||
}" and take the pull request title and description into account when writing the response.
|
||||
Review the following code diff in the file "${file.to}" and take the pull request title and description into account when writing the response.
|
||||
|
||||
Pull request title: ${prDetails.title}
|
||||
Pull request description:
|
||||
|
||||
---
|
||||
${prDetails.description}
|
||||
---
|
||||
---`;
|
||||
console.log(prompt);
|
||||
|
||||
return `${prompt}
|
||||
|
||||
Git diff to review:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue