feat: casan chat optz
This commit is contained in:
@@ -16,6 +16,8 @@ import tempfile
|
||||
import uuid
|
||||
from datetime import datetime, timezone
|
||||
|
||||
PYTHON_BIN = sys.executable or "/usr/bin/python3"
|
||||
|
||||
GENESIS_HASH = "0" * 64
|
||||
|
||||
|
||||
@@ -137,7 +139,7 @@ def lower(s: str) -> str:
|
||||
|
||||
|
||||
def classify(message: str):
|
||||
r = subprocess.run(["python3", ROUTER, "classify", "--message", message], cwd=ROOT, capture_output=True, text=True)
|
||||
r = subprocess.run([PYTHON_BIN, ROUTER, "classify", "--message", message], cwd=ROOT, capture_output=True, text=True)
|
||||
if r.returncode != 0:
|
||||
return {"mode": "BLOCK", "risk": "high", "reason": "router_failed", "matched_rules": [r.stderr.strip()]}
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user