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/c6a1bc3ea73fc96da43723fed95e46422eef9bae/app/utils.py
- Command line
-
hf download hf://spaces/HamidOmarov/FastAPI-RAG-API@c6a1bc3ea73fc96da43723fed95e46422eef9bae/app/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/HamidOmarov/FastAPI-RAG-API/resolve/c6a1bc3ea73fc96da43723fed95e46422eef9bae/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) | |