From 8ce8346000ea8fa3c79294726ad7f354a66e6d61 Mon Sep 17 00:00:00 2001 From: tabbi89 Date: Thu, 4 Jul 2024 08:25:39 +0200 Subject: [PATCH] chore(core): changed model and added prompt --- package.json | 18 ++-- src/main.ts | 5 +- yarn.lock | 298 ++++++++++++++++++++------------------------------- 3 files changed, 128 insertions(+), 193 deletions(-) diff --git a/package.json b/package.json index 5ec57c8..ea468a5 100644 --- a/package.json +++ b/package.json @@ -12,17 +12,17 @@ "lint": "prettier --check ." }, "dependencies": { - "@actions/core": "^1.10.0", - "@octokit/rest": "^19.0.7", - "minimatch": "^7.4.2", - "openai": "^4.20.1", + "@actions/core": "^1.10.1", + "@octokit/rest": "^21.0.0", + "minimatch": "^9.0.5", + "openai": "^4.52.3", "parse-diff": "^0.11.1", - "ts-node": "^10.9.1" + "ts-node": "^10.9.2" }, "devDependencies": { - "@types/node": "^18.15.5", - "@vercel/ncc": "^0.36.1", - "prettier": "^2.8.6", - "typescript": "^5.0.2" + "@types/node": "^20.14.9", + "@vercel/ncc": "^0.38.1", + "prettier": "^3.3.2", + "typescript": "^5.5.3" } } diff --git a/src/main.ts b/src/main.ts index 13677ae..40d368e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -82,6 +82,7 @@ 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": , "reviewComment": ""}]} - Do not give positive comments or compliments. +- Identify any potential bugs, suggest improvements, and ensure the code follows best practices. - 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. - Use the given description only for the overall context and only comment the code. @@ -117,7 +118,7 @@ async function getAIResponse(prompt: string): Promise