Skip to content

Commit

Permalink
Update model to gpt-4-32k. Minor prompt change.
Browse files Browse the repository at this point in the history
  • Loading branch information
suarezafelipe committed Apr 15, 2023
1 parent eb5ae2c commit 8a2499c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
PATCH_PR: ${{ github.event.pull_request.number }}
PATCH_REPO: ${{ github.repository }}
- id: review
uses: mono-chrome/GPTReviewWorkflow@main
uses: suarezafelipe/GPTReviewWorkflow@main
with:
GIT_COMMIT_HASH: ${{ github.event.pull_request.head.sha }}
GIT_PATCH_OUTPUT: ${{ env.GIT_PATCH_OUTPUT }}
Expand Down
6 changes: 3 additions & 3 deletions review.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
def get_review():
ACCESS_TOKEN = os.getenv("GITHUB_TOKEN")
GIT_COMMIT_HASH = os.getenv("GIT_COMMIT_HASH")
model = "gpt-4-0314"
model = "gpt-4-32k"
openai.api_key = os.getenv("OPENAI_API_KEY")
openai.organization = os.getenv("OPENAI_ORG_KEY")
pr_link = os.getenv("LINK")
Expand All @@ -32,13 +32,13 @@ 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_details_response.text}\n"
task_headline = f"As a code reviewer, your task is:\n"
task_list = f"- Review the code changes (diffs) and provide feedback.\n- If you don't have enough information to provide accurate feedback, please say 'Looks good to me' or provide a very brief response based on the information available.'\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 only in the patch files.\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 you don't have enough information to provide accurate feedback, refrain from making up responses.'\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 only in the patch files.\n- Use markdown formatting.\n- Use bullet points if you have multiple comments.\n"
prompt = intro + explanation + task_headline + task_list + patch_info

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

messages = [
{"role": "system", "content": "You are an experienced but nice and humble software developer."},
{"role": "system", "content": "You are an experienced and humble software developer."},
{"role": "user", "content": prompt},
]

Expand Down

0 comments on commit 8a2499c

Please sign in to comment.