Spaces:
Running
Running
from fastapi import APIRouter, Depends, File, UploadFile | |
from app.modules.documentHandeler.controllers.document_handeler_controller import \ | |
DocumentHandelerController | |
from app.modules.documentHandeler.dependencies.dependencies import \ | |
get_document_handeler_controller | |
router = APIRouter() | |
async def get_all_documents( | |
controller: DocumentHandelerController = Depends(get_document_handeler_controller), | |
): | |
return await controller.get_all_chunks() | |
async def delete_document( | |
filename: str, | |
controller: DocumentHandelerController = Depends(get_document_handeler_controller), | |
): | |
return await controller.delete_document(filename) | |
async def upload_file( | |
file: UploadFile = File(...), | |
controller: DocumentHandelerController = Depends(get_document_handeler_controller), | |
): | |
return await controller.handle_file_upload(file) | |