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

This is a good PR #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: 'GPTReviewWorkflow'
description: 'Let AI review your code'
branding:
icon: 'eye'
color: 'gray-dark'
inputs:
OPENAI_API_KEY:
description: 'OpenAI API Key'
Expand Down
6 changes: 3 additions & 3 deletions review.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def get_review():
top_p=1.0,
frequency_penalty=0.0,
presence_penalty=0.0
)
) #this si bad
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done on purpose to see if it catches it :)

Copy link
Owner Author

@mono-chrome mono-chrome Jan 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It caught the commment issue here

This would come up every other query but because we're streaming responses I cant do a "Best of N" - otherwise we'd start ramping up github action minutes which burns $$$

review = response['choices'][0]['text']

data = {"body": review, "commit_id": GIT_COMMIT_HASH, "event": "COMMENT"}
Expand All @@ -52,8 +52,8 @@ def get_review():
PR_NUMBER = pr_link.split("/")[-1]

# https://api.github.com/repos/OWNER/REPO/pulls/PULL_NUMBER/reviews
response = requests.post(f'https://api.github.com/repos/{OWNER}/{REPO}/pulls/{PR_NUMBER}/reviews', headers=headers, data=data)
print(response.json())
response = requests(f'https://api.github.com/repos/{OWNER}/{REPO}/pulls/{PR_NUMBER}/reviews', headers=headers, data=data)
print(response.jso())


if __name__ == "__main__":
Expand Down