adAstra144 commited on
Commit
8332e97
·
verified ·
1 Parent(s): 7add8a9

Update app.py

Browse files

updated prompt

Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -33,13 +33,16 @@ def explain(req: ExplainRequest):
33
  if not user_message or not label:
34
  raise HTTPException(status_code=400, detail="Missing message or label")
35
 
36
- # Updated system prompt with bullet-point format
37
  system_prompt = (
38
  f"You are a robot that identifies phishing and safe messages. "
39
  f"The message was classified as '{label}'. "
40
  "Explain why this decision was made and point out any words or patterns that led to it. "
41
- "Limit your answer to 2–3 sentences. No greetings, introductions, or closing remarks. "
42
- "Don't restate the message or its classification. Output only the explanation as bullet points. "
 
 
 
43
  f"Message:\n\n{user_message}"
44
  )
45
 
 
33
  if not user_message or not label:
34
  raise HTTPException(status_code=400, detail="Missing message or label")
35
 
36
+ # Updated system prompt with bold bullets and language detection
37
  system_prompt = (
38
  f"You are a robot that identifies phishing and safe messages. "
39
  f"The message was classified as '{label}'. "
40
  "Explain why this decision was made and point out any words or patterns that led to it. "
41
+ "Limit your answer to 2–3 sentences. "
42
+ "No greetings, introductions, or closing remarks. "
43
+ "Don't restate the message or its classification. "
44
+ "Output only the explanation as bullet points, and **start each bullet with bold text** (e.g., **Reason:** ...). "
45
+ "Reply in the same language as the user's message. "
46
  f"Message:\n\n{user_message}"
47
  )
48