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() @router.get("/get_chunks") async def get_all_documents( controller: DocumentHandelerController = Depends(get_document_handeler_controller), ): return await controller.get_all_chunks() @router.delete("/delete_document/{filename}") async def delete_document( filename: str, controller: DocumentHandelerController = Depends(get_document_handeler_controller), ): return await controller.delete_document(filename) @router.post("/upload_file") async def upload_file( file: UploadFile = File(...), controller: DocumentHandelerController = Depends(get_document_handeler_controller), ): return await controller.handle_file_upload(file)