Spaces:
Sleeping
Sleeping
File size: 471 Bytes
0743bb0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
from fastapi import APIRouter, File, UploadFile, HTTPException
from core.journal_reading.upload import upload_file
router = APIRouter(tags=["Journal Reading"])
@router.post("/upload")
async def upload_journal(file: UploadFile = File(...)):
try :
documents = await upload_file(file)
return {"Success"}
except Exception as e:
raise HTTPException(
status_code=400, detail=f"Error processing file: {str(e)}"
)
|