Spaces:
Sleeping
Sleeping
Download app/utils.py from HamidOmarov/FastAPI-RAG-API: direct link, hf CLI and curl.
- Browser
- Download file 233 Bytes
-
https://huggingface.co/spaces/HamidOmarov/FastAPI-RAG-API/resolve/a46e32d53cb37a7930786ca367eab60ae08268f8/app/utils.py
- Command line
-
hf download hf://spaces/HamidOmarov/FastAPI-RAG-API@a46e32d53cb37a7930786ca367eab60ae08268f8/app/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/HamidOmarov/FastAPI-RAG-API/resolve/a46e32d53cb37a7930786ca367eab60ae08268f8/app/utils.py
233 Bytes
| # app/utils.py | |
| import uuid | |
| from fastapi import HTTPException | |
| def ensure_session(session_id: str | None) -> str: | |
| return session_id or str(uuid.uuid4()) | |
| def http400(msg: str): | |
| raise HTTPException(status_code=400, detail=msg) | |