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

1.0.5 #3

Merged
merged 18 commits into from
May 12, 2024
Prev Previous commit
Next Next commit
Update entrypoint.py
rubensflinco authored May 12, 2024
commit 783fd4ced34991d47fd72e8eefdb1bc884e9308d
20 changes: 10 additions & 10 deletions entrypoint.py
Original file line number Diff line number Diff line change
@@ -36,23 +36,23 @@ def check_required_env_vars():
def get_review_prompt(extra_prompt: str = "") -> str:
"""Get a prompt template"""
template = f"""
This is a pull request or a part of a pull request if the pull request is too large.
Please assume you review this PR as a great software engineer and a great security engineer.
This is a pull request or part of a pull request if the pull request is very large.
Suppose you review this PR as an excellent software engineer and an excellent security engineer.
Can you tell me the issues with differences in a pull request and provide suggestions to improve it?
You can provide a summary of the review and comments about issues by file, if any important issues are found.

{extra_prompt}
You can provide a review summary and comments on issues per file if any major issues are found.
Always put the name of the file that is citing the improvement or problem.
You will find the diff below so you can analyze:
"""
return template


def get_summarize_prompt() -> str:
"""Get a prompt template"""
template = """
This is a pull request of a set of reviews of a pull request.
Those are generated by Gemini AI.
Can you summarized them?
It would be good to focus on highlighting issues and providing suggestions to improve the pull request.
This is a pull request from a set of revisions of a pull request.
Can you summarize them?
It would be good to focus on highlighting pressing issues and providing code suggestions to improve the pull request.
Always put the name of the file that is citing the improvement or problem.
"""
return template

@@ -114,7 +114,7 @@ def get_review(
prompt = str(f"""
{str(review_prompt)}

```txt
```
{str(chunked_diff)}
```""")
response = genai_model.generate_content(prompt)