Created
July 26, 2023 07:59
-
-
Save OatmealLick/b7c1ffae1c5448efb180d2eaa1cd8d9a to your computer and use it in GitHub Desktop.
Creating JSON payload for AI Code Reviewer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
message = openai.ChatCompletion.create( | |
model="gpt-3.5-turbo", | |
messages=[ | |
{ | |
"role": "system", | |
"content": "You are a code reviewer on a Merge Request on Gitlab. Your responsibility is to review " | |
"the provided code and offer" | |
"recommendations for enhancement. Identify any problematic code snippets, " | |
"highlight potential issues, and evaluate the overall quality of the code you review. " | |
"You will be given input in the format PATH: <path of the file changed>; DIFF: <diff>. " | |
"In diffs, plus signs (+) will mean the line has been added and minus signs (-) will " | |
"mean that the line has been removed. Lines will be separated by \\n." | |
}, | |
{ | |
"role": "user", | |
"content": user_message | |
} | |
], | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment