Download app/routers/sessions.py from acpcchatbotadmin/acpcchatbot_testing_first: direct link, hf CLI and curl.
- Browser
- Download file 496 Bytes
-
https://huggingface.co/spaces/acpcchatbotadmin/acpcchatbot_testing_first/resolve/main/app/routers/sessions.py
- Command line
-
hf download hf://spaces/acpcchatbotadmin/acpcchatbot_testing_first/app/routers/sessions.py
-
curl -L -o sessions.py https://huggingface.co/spaces/acpcchatbotadmin/acpcchatbot_testing_first/resolve/main/app/routers/sessions.py
496 Bytes
| from fastapi import APIRouter, HTTPException | |
| from app.memory.session_store import delete_session | |
| router = APIRouter(prefix="/api/sessions", tags=["sessions"]) | |
| async def clear_session(session_id: str): | |
| """Clear conversation history for a session.""" | |
| deleted = delete_session(session_id) | |
| if not deleted: | |
| raise HTTPException(status_code=404, detail="Session not found.") | |
| return {"success": True, "message": "Session cleared."} | |