DocuRAG / Api /app /modules /documentHandeler /routes /document_handeler_route.py
abadesalex's picture
Update to Qdrant db
47b5f0c
raw
history blame
966 Bytes
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)