You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const genAI = new GoogleGenerativeAI("${{ secrets.GEMINI_API_KEY }}");
57
+
const model = genAI.getGenerativeModel({ model: "gemini-1.5-flash"});
58
+
59
+
// PR과 Push에 따라 다른 프롬프트 사용
60
+
let prompt;
61
+
if (process.env.EVENT_TYPE === 'pull_request') {
62
+
prompt = `Explain in korean. You are a senior software engineer and need to perform a code review based on the results of a given git diff. Review the changed code from different perspectives and let us know if there are any changes that need to be made. If you see any code that needs to be fixed in the result of the git diff, you need to calculate the exact line number by referring to the "@@ -0,0 +0,0 @@" part. The output format is \[{"path":"{ filepath }", "line": { line }, "text": { review comment }, "side": "RIGHT"}\] format must be respected.\n<git diff>${diff_output}</git diff>`;
63
+
} else {
64
+
prompt = `Explain in korean. You are a senior software engineer and need to perform a code review based on the results of a given git diff. Provide a detailed review of the code changes, focusing on code quality, readability, performance, and security. Format your response in Markdown with clear headings for each file reviewed.\n<git diff>${diff_output}</git diff>`;
65
+
}
66
+
67
+
const result = await model.generateContent(prompt);
0 commit comments