Skip to content

Instantly share code, notes, and snippets.

@OatmealLick
Created July 26, 2023 07:59
Show Gist options
  • Save OatmealLick/b7c1ffae1c5448efb180d2eaa1cd8d9a to your computer and use it in GitHub Desktop.
Save OatmealLick/b7c1ffae1c5448efb180d2eaa1cd8d9a to your computer and use it in GitHub Desktop.
Creating JSON payload for AI Code Reviewer
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