Spaces:
Runtime error
Runtime error
Download server/safety/__init__.py from TheAbyss99/abyss-api: direct link, hf CLI and curl.
- Browser
- Download file 902 Bytes
-
https://huggingface.co/spaces/TheAbyss99/abyss-api/resolve/main/server/safety/__init__.py
- Command line
-
hf download hf://spaces/TheAbyss99/abyss-api/server/safety/__init__.py
-
curl -L -o __init__.py https://huggingface.co/spaces/TheAbyss99/abyss-api/resolve/main/server/safety/__init__.py
902 Bytes
| """Phase W - The Abyss safety / moderation layer (self-hosted, from scratch). | |
| Layers: input moderation, output moderation, agent tool-call screening, and an | |
| audit trail - with tiered-by-severity enforcement (low -> log, medium -> soft | |
| refusal, high -> block). Engine = weighted lexical rules + co-occurrence, no | |
| external API. | |
| """ | |
| from server.safety import config | |
| from server.safety import rules | |
| from server.safety import classifier | |
| from server.safety import injection | |
| from server.safety import audit | |
| from server.safety.moderator import ( | |
| ModerationResult, | |
| moderate_input, | |
| moderate_output, | |
| ) | |
| from server.safety.toolguard import screen_tool_call | |
| SAFETY_ENABLED = config.SAFETY_ENABLED | |
| __all__ = [ | |
| "config", | |
| "rules", | |
| "classifier", | |
| "injection", | |
| "audit", | |
| "ModerationResult", | |
| "moderate_input", | |
| "moderate_output", | |
| "screen_tool_call", | |
| "SAFETY_ENABLED", | |
| ] | |