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: 6 additions & 0 deletions kaizen/helpers/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@
PR_COLLAPSIBLE_TEMPLATE = """
<details>
<summary>[{confidence}] -> {reasoning}</summary>
{file_name} | {start_line} - {end_line}
</details>

"""

DESC_COLLAPSIBLE_TEMPLATE = """
<details>
<summary>Original Description</summary>
{desc}
</details>

"""


Expand All @@ -47,6 +50,9 @@ def create_pr_review_from_json(reviews):
comment=review.get("comment", "NA"),
reasoning=review.get("reasoning", "NA"),
confidence=review.get("confidence", "NA"),
start_line=review.get("start_line", "NA"),
end_line=review.get("end_line", "NA"),
file_name=review.get("file_name", "NA"),
)
markdown_output += ct + "\n"

Expand Down
14 changes: 10 additions & 4 deletions kaizen/llms/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
"topic": "<SECTION_TOPIC>",
"comment": "<CONCISE_FEEDBACK>",
"confidence": <CONFIDENCE_LEVEL>,
"reasoning": "<BRIEF_EXPLANATION>"
"reasoning": "<BRIEF_EXPLANATION>",
"start_line": "<CODE_START_LINE_INTEGER>",
"end_line": "<CODE_END_LINE_INTEGER>",
"file_name": "<CODE_FILE_NAME>",
}},
...
]
Expand All @@ -40,7 +43,7 @@
- "Improvements"

Generate all possible feedbacks.
For each piece of feedback, clearly reference the specific file(s) and line number(s) of code being addressed. Use markdown code blocks to quote relevant snippets of code when necessary.
For each piece of feedback, clearly reference the specific file(s) and line number(s) of code being addressed for each comment. Use markdown code blocks to quote relevant snippets of code when necessary.
Keep comments short but make sure it has actionable points pointing to the code or line having the issue. Avoid duplicate feedback, merge when necessary.

INFORMATION:
Expand All @@ -63,7 +66,10 @@
"topic": "<SECTION_TOPIC>",
"comment": "<CONCISE_FEEDBACK>",
"confidence": <CONFIDENCE_LEVEL>,
"reasoning": "<BRIEF_EXPLANATION>"
"reasoning": "<BRIEF_EXPLANATION>",
"start_line": "<CODE_START_LINE_INTEGER>",
"end_line": "<CODE_END_LINE_INTEGER>",
"file_name": "<CODE_FILE_NAME>",
}},
...
]
Expand All @@ -85,7 +91,7 @@
- "Improvements"

Generate all possible feedbacks.
For each piece of feedback, clearly reference the specific file(s) and line number(s) of code being addressed. Use markdown code blocks to quote relevant snippets of code when necessary.
For each piece of feedback, clearly reference the specific file(s) and line number(s) of code being addressed for each comment. Use markdown code blocks to quote relevant snippets of code when necessary.
Keep comments short but make sure it has actionable points pointing to the code or line having the issue. Avoid duplicate feedback, merge when necessary.

INFORMATION:
Expand Down