acpcchatbotadmin's picture
Upload 40 files
481dfe6 verified
Raw History Blame Contribute Delete
496 Bytes
from fastapi import APIRouter, HTTPException
from app.memory.session_store import delete_session
router = APIRouter(prefix="/api/sessions", tags=["sessions"])
@router.delete("/{session_id}")
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."}