Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -33,15 +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
|
| 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
|
|
|
|
|
|
|
| 45 |
"Reply in the same language as the user's message. "
|
| 46 |
f"Message:\n\n{user_message}"
|
| 47 |
)
|
|
|
|
| 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 and language adaptation
|
| 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 |
"No greetings, introductions, or closing remarks. "
|
| 42 |
"Don't restate the message or its classification. "
|
| 43 |
+
"Output only the explanation as bullet points. "
|
| 44 |
+
"Limit each bullet to 1–2 sentences. "
|
| 45 |
+
"Limit the number of bullets to 3-4 "
|
| 46 |
"Reply in the same language as the user's message. "
|
| 47 |
f"Message:\n\n{user_message}"
|
| 48 |
)
|