Spaces:
Sleeping
Sleeping
Rajan Sharma
commited on
Update safety.py
Browse files
safety.py
CHANGED
|
@@ -1,9 +1,15 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
blocked = False
|
| 5 |
reason = ""
|
| 6 |
return text, blocked, reason
|
| 7 |
|
| 8 |
def refusal_reply(reason: str):
|
| 9 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
POLICY_NOTICE = (
|
| 2 |
+
"ClarityOps provides operational & executive decision support. "
|
| 3 |
+
"It is not a diagnostic tool. For clinical decisions, follow institutional protocols and escalate as required."
|
| 4 |
+
)
|
| 5 |
+
|
| 6 |
+
def safety_filter(text: str, mode: str = "input"):
|
| 7 |
+
# Add real safety stack here (prompt attack detection, prohibited intents, etc.)
|
| 8 |
blocked = False
|
| 9 |
reason = ""
|
| 10 |
return text, blocked, reason
|
| 11 |
|
| 12 |
def refusal_reply(reason: str):
|
| 13 |
+
if reason:
|
| 14 |
+
return f"Sorry, I can’t help with that. {POLICY_NOTICE}"
|
| 15 |
+
return f"Sorry, I can’t help with that. {POLICY_NOTICE}"
|