diff --git a/backend/open_webui/routers/knowledge.py b/backend/open_webui/routers/knowledge.py index 87e8599ed..12cb2acf3 100644 --- a/backend/open_webui/routers/knowledge.py +++ b/backend/open_webui/routers/knowledge.py @@ -520,6 +520,7 @@ async def reset_knowledge_by_id(id: str, user=Depends(get_verified_user)): @router.post("/{id}/files/batch/add", response_model=Optional[KnowledgeFilesResponse]) def add_files_to_knowledge_batch( + request: Request, id: str, form_data: list[KnowledgeFileIdForm], user=Depends(get_verified_user), @@ -555,7 +556,9 @@ def add_files_to_knowledge_batch( # Process files try: result = process_files_batch( - BatchProcessFilesForm(files=files, collection_name=id) + request=request, + form_data=BatchProcessFilesForm(files=files, collection_name=id), + user=user ) except Exception as e: log.error( diff --git a/backend/open_webui/routers/retrieval.py b/backend/open_webui/routers/retrieval.py index d6ff463a9..c791bde84 100644 --- a/backend/open_webui/routers/retrieval.py +++ b/backend/open_webui/routers/retrieval.py @@ -1458,6 +1458,7 @@ class BatchProcessFilesResponse(BaseModel): @router.post("/process/files/batch") def process_files_batch( + request: Request, form_data: BatchProcessFilesForm, user=Depends(get_verified_user), ) -> BatchProcessFilesResponse: @@ -1504,7 +1505,10 @@ def process_files_batch( if all_docs: try: save_docs_to_vector_db( - docs=all_docs, collection_name=collection_name, add=True + request=request, + docs=all_docs, + collection_name=collection_name, + add=True, ) # Update all files with collection name