Spaces:
Sleeping
Sleeping
Download python_backend/api/Agents/routes/thread_router.py from VashuTheGreat2/ML-Learner: direct link, hf CLI and curl.
- Browser
- Download file 671 Bytes
-
https://huggingface.co/spaces/VashuTheGreat2/ML-Learner/resolve/main/python_backend/api/Agents/routes/thread_router.py
- Command line
-
hf download hf://spaces/VashuTheGreat2/ML-Learner/python_backend/api/Agents/routes/thread_router.py
-
curl -L -o thread_router.py https://huggingface.co/spaces/VashuTheGreat2/ML-Learner/resolve/main/python_backend/api/Agents/routes/thread_router.py
671 Bytes
| import fastapi | |
| from src.Agents.graphs.interview_graph_builder import deleteThread | |
| import logging | |
| import sys | |
| from exception import MyException | |
| router = fastapi.APIRouter() | |
| async def _deleteThread(thread_id: str): | |
| logging.info(f"Entering deleteThread route for thread {thread_id} (async)") | |
| try: | |
| success = await deleteThread(thread_id=thread_id) | |
| if success: | |
| return {"status": "success", "message": f"Thread {thread_id} deleted"} | |
| else: | |
| return {"status": "error", "message": f"Thread {thread_id} not found or error occurred"} | |
| except Exception as e: | |
| raise MyException(e, sys) | |