FastAPI-RAG-API / app /utils.py
HamidOmarov's picture
fix(runtime): strip U+FEFF (BOM/ZWNBSP) from Python sources
2690221
raw
history blame contribute delete
234 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)