pkheria commited on
Commit
2133d08
·
verified ·
1 Parent(s): 582d969

fixed system prompt

Browse files
Files changed (1) hide show
  1. app.py +37 -12
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 code reviewer. Given a git diff for ONE file, output EXACTLY:
51
- - 1 sentence: what changed (be specific, name functions/classes if relevant)
52
- - 1 sentence: likely reason for the change
 
 
 
 
 
53
 
54
  Reason:
55
- - If the reason is explicitly evident from the diff, state it in 1 sentence.
56
- - Otherwise output exactly:
57
- Reason not evident from the diff.
 
 
 
 
58
 
59
  Rules:
60
- - Total response MUST be under 120 words
61
- - No preamble, no "Sure!", no restating the filename
62
- - No internal reasoning, no <tool_call> blocks final answer only
63
- - Use plain text, no markdown headers
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.