Spaces:
Sleeping
Sleeping
JerameeUC
16th Commit added the ability to Auto-document, and a file that explains how to run it named AutoDoc_README.md
d53c2a8 | from fastapi import FastAPI | |
| from fastapi.responses import JSONResponse | |
| from .schemas import MessageIn, MessageOut | |
| from .guardrails import enforce_guardrails | |
| from .rules import route | |
| app = FastAPI(title='Anonymous Rule-Based Bot', version='1.0') | |
| # No sessions, cookies, or user IDs — truly anonymous and stateless. | |
| # No logging of raw user input here (keeps it anonymous and reduces risk). | |
| def message(inbound: MessageIn): | |
| ok, cleaned_or_reason = enforce_guardrails(inbound.message) | |
| if not ok: | |
| return JSONResponse(status_code=200, | |
| content={'reply': cleaned_or_reason, 'blocked': True}) | |
| # Rule-based reply (deterministic: no persistence) | |
| reply = route(cleaned_or_reason) | |
| return {'reply': reply, 'blocked': False} |