Skip to content
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

Review prompt improvements #10

Closed
wants to merge 4 commits into from
Closed

Conversation

ravilushqa
Copy link
Owner

@ravilushqa ravilushqa commented May 7, 2023

Description

This pull request aims to improve the review prompt functionality by refactoring the code to use OpenAI API for code review comments. Additionally, it adds the ability to create GitHub pull request comments based on the review results. A Review struct has been added to parse the JSON response from the OpenAI API and create GitHub comments for any issues found in the code.

Changes

  • Refactored code in cmd/review/main.go to use OpenAI API for code review comments
  • Added functionality to create GitHub pull request comments based on the review results
  • Added a Review struct to parse the JSON response from the OpenAI API and create GitHub comments for any issues found in the code
  • Added embedded file assets/review.txt for review prompt in openai/openai.go
  • Set temperature to 0.1 for better response generation in openai/openai.go

File: cmd/review/main.go

Description: Added functionality to generate comments on a pull request based on an AI review of the code changes. The AI review is generated using OpenAI's GPT-3 language model and checks for potential issues in the code changes. The comments are created for each file that has changes and include the line number and description of the issue. The overall review is also generated and added as a comment to the pull request.

File: openai/assets/review.txt

Description: This pull request introduces CodeReviewGPT, an AI agent that specializes in generating code reviews for software projects using advanced natural language processing and machine learning techniques. The agent's goals are to analyze structure and logic to provide comprehensive feedback on code quality, readability, maintainability, and performance, identify potential bugs, security vulnerabilities, and other issues that may impact the functionality and stability of the software, and generate a JSON report in a specific format to help developers improve their code. The agent will respond with a quality value of good, bad, or neutral, and if the quality is good, issues will be empty. The response format will be in JSON format, as described in the code patch.

File: openai/openai.go

Description: Added embedded file assets/review.txt for review prompt. Also set temperature to 0.1 for ChatCompletion function.

@ravilushqa ravilushqa self-assigned this May 7, 2023
Repository owner deleted a comment from github-actions bot May 7, 2023
@ravilushqa ravilushqa closed this May 7, 2023
@ravilushqa ravilushqa deleted the review_prompt_improvements branch May 7, 2023 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant