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."}