Spaces:
Sleeping
Sleeping
from fastapi import APIRouter, File, UploadFile, HTTPException | |
from core.journal_reading.upload import upload_file | |
router = APIRouter(tags=["Journal Reading"]) | |
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)}" | |
) | |