-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code review #17
Code review #17
Conversation
@@ -0,0 +1,29 @@ | |||
name: Code Reviewer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'name' field is not necessary in this workflow. It can be removed.
@@ -0,0 +1,29 @@ | |||
name: Code Reviewer | |||
run-name: Action started by ${{ github.actor }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'run-name' field is not a valid field in a workflow. It should be removed.
- opened | ||
- synchronize | ||
|
||
permissions: write-all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'permissions' field is not necessary in this workflow. It can be removed.
append_prompt: | | ||
- Give a maximum of 4 suggestions | ||
- Do not suggest code formatting issues. | ||
- Do not suggest imports issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be a newline at the end of the file.
for (const file of parsedDiff) { | ||
if (file.to === "/dev/null") continue; // Ignore deleted files | ||
for (const chunk of file.chunks) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable 'messages' is not defined before it is used in the 'getAIResponse' function.
} | ||
|
||
var systemPrompt = | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable 'systemPrompt' is defined but never used.
} | ||
|
||
// Array<{ body: string; path: string; line: number }> | ||
function createComment(file, chunk, aiResponses) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function 'createComment' is defined but never used.
@@ -29,6 +29,18 @@ class SimpleChatGptService { | |||
throw error; | |||
} | |||
} | |||
|
|||
// chatCompletionParams: ChatCompletionParams |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider removing this commented out code.
// chatCompletionParams: ChatCompletionParams | ||
async fromParams({ chatCompletionParams }) { | ||
try { | ||
const response = await this.service.chatCompletions(chatCompletionParams); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding error handling for failed API requests.
console.error('[SimpleChatGptService]', error); | ||
throw error; | ||
} | ||
} | ||
} | ||
|
||
module.exports = SimpleChatGptService; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a newline at the end of the file.
No description provided.