Skip to content

Commit

Permalink
Refine Prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
mono-chrome committed Feb 2, 2023
1 parent 309787b commit fdca664
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions review.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ def get_review():
explanation = f"Each patch entry has the commit message in the Subject line followed by the code changes (diffs) in a unidiff format.\n"
patch_info = f"Patch of the Pull Request to review:\n\n{PR_PATCH}\n"
task_headline = f"As a code reviewer, your task is:\n"
task_list = f"- Review the code changes (diffs) in the patch and provide feedback.\n- If there are any bugs, highlight them.\n - Do not highlight minor issues and nitpicks.\n - Look out for typos in repeating variables.\n - Use markdown formatting.\n - Use bullet points if you have multiple comments.\n"
task_list = f"- Review the code changes (diffs) and provide feedback.\n- If there are any bugs, highlight them.\n- Do not highlight minor issues and nitpicks.\n- View this as one pull request and don't mention individual patches.\n- Look out for typos in repeating variables.\n- Use markdown formatting.\n- Use bullet points if you have multiple comments.\n"
prompt = intro + explanation + patch_info + task_headline + task_list

print(f"Prompt sent to GPT-3: {prompt}")
print(f"\nPrompt sent to GPT-3: {prompt}\n")

response = openai.Completion.create(
engine=model,
Expand All @@ -41,7 +41,7 @@ def get_review():

data = {"body": review, "commit_id": GIT_COMMIT_HASH, "event": "COMMENT"}
data = json.dumps(data)
print(f"\n\nResponse from GPT-3: {data}\n\n")
print(f"\nResponse from GPT-3: {data}\n")

OWNER = pr_link.split("/")[-4]
REPO = pr_link.split("/")[-3]
Expand Down

0 comments on commit fdca664

Please sign in to comment.