package and update the model used, remove unused code

This commit is contained in:
Ville Saukkonen 2023-12-02 23:02:38 +02:00
parent 80ca662b5f
commit 5c13a26204
6 changed files with 12970 additions and 8370 deletions

View file

@ -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>"}]}