Skip to content
Merged
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
6 changes: 4 additions & 2 deletions kaizen/helpers/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@

PR_COLLAPSIBLE_TEMPLATE = """
<details>
<summary>[{confidence}] -> {comment}</summary>
**Fix:** {solution}
<summary>[{confidence}] -> {comment} | \n
**Potential Solution:**: {solution}</summary>


{file_name} | {start_line} - {end_line}
</details>

Expand Down
1 change: 1 addition & 0 deletions kaizen/llms/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def chat_completion(self, prompt, user: str = None):
return response["choices"][0]["message"]["content"], response["usage"]

def is_inside_token_limit(self, PROMPT, percentage=0.7):
# TODO: Also include system prompt
messages = [{"user": "role", "content": PROMPT}]
if (
litellm.token_counter(model=self.model, messages=messages)
Expand Down
13 changes: 4 additions & 9 deletions kaizen/reviewer/code_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,9 @@ def create_pr_review_text(self, topics):
file_name=review.get("file_name", "NA"),
)
markdown_output += ct + "\n"

if high_ranked_issues > 0:
markdown_output = (
"❗ This review needs attention. 🚨\n\nHere are some feedback:\n\n"
+ markdown_output
)
status_msg = "❗ Attention Required: This PR has potential issues. 🚨\n\n"
else:
markdown_output = (
"✅ This is a good review! 👍\n\nHere are some feedback:\n\n"
+ markdown_output
)
return markdown_title + markdown_output
status_msg = "✅ All Clear: This PR is ready to merge! 👍\n\n"
return markdown_title + status_msg + markdown_output