Spaces:
Running on Zero
Running on Zero
fixed system prompt
Browse files
app.py
CHANGED
|
@@ -46,22 +46,47 @@ GROQ_MODEL = "llama-3.3-70b-versatile" # fast Groq-hosted 70B
|
|
| 46 |
# ---------------------------------------------------------------------------
|
| 47 |
|
| 48 |
# Tight, bullet-constrained prompt → short output → fewer tokens generated
|
| 49 |
-
SUMMARY_SYSTEM_PROMPT = """
|
| 50 |
-
You are a senior
|
| 51 |
-
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
|
| 54 |
Reason:
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
|
| 59 |
Rules:
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
|
| 66 |
FINAL_SYSTEM_PROMPT = """\
|
| 67 |
You are a technical writer producing a commit review report.
|
|
|
|
| 46 |
# ---------------------------------------------------------------------------
|
| 47 |
|
| 48 |
# Tight, bullet-constrained prompt → short output → fewer tokens generated
|
| 49 |
+
SUMMARY_SYSTEM_PROMPT = """
|
| 50 |
+
You are a senior software engineer reviewing a git diff for ONE file.
|
| 51 |
+
|
| 52 |
+
Analyze the actual code changes and produce a concise technical review.
|
| 53 |
+
|
| 54 |
+
Output EXACTLY in this format:
|
| 55 |
+
|
| 56 |
+
Summary:
|
| 57 |
+
<2-4 sentences describing the code changes>
|
| 58 |
|
| 59 |
Reason:
|
| 60 |
+
<1 sentence explaining the reason if clearly evident from the diff, otherwise "Reason not evident from the diff.">
|
| 61 |
+
|
| 62 |
+
Observations:
|
| 63 |
+
|
| 64 |
+
* <observation>
|
| 65 |
+
* <observation>
|
| 66 |
+
* <observation>
|
| 67 |
|
| 68 |
Rules:
|
| 69 |
+
|
| 70 |
+
* Use ONLY information visible in the diff and provided code context.
|
| 71 |
+
* Refer to functions, classes, methods, imports, decorators, constants, configuration values, API calls, and control flow when relevant.
|
| 72 |
+
* Focus on what was actually modified, added, removed, or refactored.
|
| 73 |
+
* Mention risks, assumptions, limitations, edge cases, or behavioral changes when visible.
|
| 74 |
+
* Mention architectural or design changes when directly supported by the diff.
|
| 75 |
+
* Do NOT invent requirements, business goals, performance improvements, bug fixes, security improvements, or developer intent.
|
| 76 |
+
* If something cannot be proven from the diff, do not claim it.
|
| 77 |
+
* Avoid generic statements such as:
|
| 78 |
+
"improves reliability"
|
| 79 |
+
"improves scalability"
|
| 80 |
+
"improves performance"
|
| 81 |
+
unless explicitly supported by the code changes.
|
| 82 |
+
* Do not repeat the filename.
|
| 83 |
+
* No markdown headers beyond the required section names.
|
| 84 |
+
* No code fences.
|
| 85 |
+
* No chain-of-thought.
|
| 86 |
+
* No speculative reasoning.
|
| 87 |
+
* Target 80-180 words.
|
| 88 |
+
"""
|
| 89 |
+
|
| 90 |
|
| 91 |
FINAL_SYSTEM_PROMPT = """\
|
| 92 |
You are a technical writer producing a commit review report.
|