mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-04-20 01:26:47 +00:00
package and update the model used, remove unused code
This commit is contained in:
parent
80ca662b5f
commit
5c13a26204
6 changed files with 12970 additions and 8370 deletions
16
src/main.ts
16
src/main.ts
|
@ -78,22 +78,6 @@ async function analyzeCode(
|
|||
return comments;
|
||||
}
|
||||
|
||||
async function getBaseAndHeadShas(
|
||||
owner: string,
|
||||
repo: string,
|
||||
pull_number: number
|
||||
): Promise<{ baseSha: string; headSha: string }> {
|
||||
const prResponse = await octokit.pulls.get({
|
||||
owner,
|
||||
repo,
|
||||
pull_number,
|
||||
});
|
||||
return {
|
||||
baseSha: prResponse.data.base.sha,
|
||||
headSha: prResponse.data.head.sha,
|
||||
};
|
||||
}
|
||||
|
||||
function createPrompt(file: File, chunk: Chunk, prDetails: PRDetails): string {
|
||||
return `Your task is to review pull requests. Instructions:
|
||||
- Provide the response in following JSON format: {"reviews": [{"lineNumber": <line_number>, "reviewComment": "<review comment>"}]}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue