From 7d9cfbd0aa6c7b1afc84f4ebe18aeb8d9dd631f9 Mon Sep 17 00:00:00 2001 From: revastanislav Date: Thu, 30 Oct 2025 16:45:51 +0200 Subject: [PATCH] Add updates to AI code review. Set gpt-4o as default. Also added reviewPrompt --- .github/workflows/code_review.yml | 4 +++- action.yml | 2 +- dist/index.js | 12 +++++++++++- src/main.ts | 15 +++++++++++++-- 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/.github/workflows/code_review.yml b/.github/workflows/code_review.yml index 2216c3d..716ddf0 100644 --- a/.github/workflows/code_review.yml +++ b/.github/workflows/code_review.yml @@ -16,5 +16,7 @@ jobs: with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - OPENAI_API_MODEL: "o3-mini" + OPENAI_API_MODEL: "gpt-4o" exclude: "yarn.lock,dist/**" + reviewPrompt: | + You are an expert code reviewer. For the following code diff, provide detailed, constructive feedback, highlight design issues, potential bugs, style improvement opportunities, and any best practices not followed. Write clear, actionable comments for **every notable point you can find**. diff --git a/action.yml b/action.yml index cbcf370..d111ef2 100644 --- a/action.yml +++ b/action.yml @@ -10,7 +10,7 @@ inputs: OPENAI_API_MODEL: description: "OpenAI API model." required: false - default: "o3-mini" + default: "gpt-4o" exclude: description: "Glob patterns to exclude files from the diff analysis" required: false diff --git a/dist/index.js b/dist/index.js index fa09411..4f556b0 100644 --- a/dist/index.js +++ b/dist/index.js @@ -147,11 +147,21 @@ function getAIResponse(prompt) { max_completion_tokens: 1400, }; } + else if (OPENAI_API_MODEL === "gpt-4o") { + return { + model: "gpt-4o", + temperature: 0.7, + max_completion_tokens: 4096, + top_p: 1, + frequency_penalty: 0.2, + presence_penalty: 0, + }; + } else { return { model: OPENAI_API_MODEL, temperature: 1, - max_completion_tokens: 1400, + max_completion_tokens: 3000, top_p: 1, frequency_penalty: 0, presence_penalty: 0 diff --git a/src/main.ts b/src/main.ts index 64b2a44..5a0ba19 100644 --- a/src/main.ts +++ b/src/main.ts @@ -125,11 +125,22 @@ async function getAIResponse(prompt: string): Promise