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