Skip to content
Merged
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
30 changes: 16 additions & 14 deletions kaizen/llms/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,15 @@

CODE_REVIEW_PROMPT = """
You are an experienced software engineer tasked with reviewing a pull request.
Your goal is to provide a comprehensive code review that evaluates the code changes, identifies potential issues,
and provides constructive feedback to the developer.
Your goal is to provide a concise and actionable code review that evaluates the code changes, identifies potential issues, and provides constructive feedback to the developer.

Using the provided information, generate a detailed code review with feedback organized as a JSON object. Only include sections with relevant feedback, omitting sections without feedback. Follow this structure:
Using the provided information, generate a code review with feedback organized as a JSON object. Only include sections with relevant feedback, omitting sections without feedback. Follow this structure:
{{
"review": [
{{
"topic": "<SECTION_TOPIC>",
"comment": "<CONCISE_FEEDBACK>",
"comment": "<CONCISE_ACTIONABLE_FEEDBACK>",
"confidence": <CONFIDENCE_LEVEL>,
"reasoning": "<BRIEF_EXPLANATION>",
"start_line": "<CODE_START_LINE_INTEGER>",
"end_line": "<CODE_END_LINE_INTEGER>",
"file_name": "<CODE_FILE_NAME>",
Expand All @@ -42,9 +40,12 @@
- "Potential Issues"
- "Improvements"

Generate all possible feedbacks.
Generate all relevant and actionable feedback.
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.
Keep comments concise but make sure they have actionable points pointing to the code or line having the issue. Avoid duplicate feedback, merge when necessary.

If there is no feedback, return an empty JSON object: {{"review": []}}


INFORMATION:
Pull Request Title: {PULL_REQUEST_TITLE}
Expand All @@ -56,17 +57,15 @@

FILE_CODE_REVIEW_PROMPT = """
You are an experienced software engineer tasked with reviewing a pull request.
Your goal is to provide a comprehensive code review that evaluates the code changes, identifies potential issues or areas for improvement,
and provides constructive feedback to the developer.
Your goal is to provide a concise and actionable code review that evaluates the code changes, identifies potential issues, and provides constructive feedback to the developer.

Using the provided information, generate a detailed code review with feedback organized as a JSON object. Only include sections with relevant feedback, omitting sections without feedback. Follow this structure:
Using the provided information, generate a code review with feedback organized as a JSON object. Only include sections with relevant feedback, omitting sections without feedback. Follow this structure:
{{
"review": [
{{
"topic": "<SECTION_TOPIC>",
"comment": "<CONCISE_FEEDBACK>",
"comment": "<CONCISE_ACTIONABLE_FEEDBACK>",
"confidence": <CONFIDENCE_LEVEL>,
"reasoning": "<BRIEF_EXPLANATION>",
"start_line": "<CODE_START_LINE_INTEGER>",
"end_line": "<CODE_END_LINE_INTEGER>",
"file_name": "<CODE_FILE_NAME>",
Expand All @@ -90,9 +89,12 @@
- "Potential Issues"
- "Improvements"

Generate all possible feedbacks.
Generate all relevant and actionable feedback.
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.
Keep comments concise but make sure they have actionable points pointing to the code or line having the issue. Avoid duplicate feedback, merge when necessary.

If there is no feedback, return an empty JSON object: {{"review": []}}


INFORMATION:
Pull Request Title: {PULL_REQUEST_TITLE}
Expand Down