Spaces:
Running
Running
File size: 781 Bytes
7fafb5b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# core/intent_detector.py
def detect_intent(text: str):
"""
Detects whether input requires full psychological analysis
or is a system/meta/diagnostic message.
"""
lowered = text.lower()
diagnostic_markers = [
"test",
"testing",
"system check",
"confirm",
"working",
"is this working",
"respond with",
"just respond",
"only confirm",
"only a test",
"hello",
"hi",
"ping"
]
for marker in diagnostic_markers:
if marker in lowered:
return "diagnostic"
# length heuristic (very short = not depth material)
if len(text.split()) < 4:
return "minimal"
return "analysis"
|