File tree Expand file tree Collapse file tree
backend/open_webui/routers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2580,6 +2580,7 @@ async def process_files_batch(
25802580 request : Request ,
25812581 form_data : BatchProcessFilesForm ,
25822582 user = Depends (get_verified_user ),
2583+ db = None ,
25832584) -> BatchProcessFilesResponse :
25842585 """
25852586 Process a batch of files and save them to the vector database.
@@ -2602,7 +2603,7 @@ async def process_files_batch(
26022603 for file in form_data .files :
26032604 try :
26042605 # Ownership check: verify the requesting user owns the file or is an admin
2605- db_file = Files .get_file_by_id (file .id )
2606+ db_file = Files .get_file_by_id (file .id , db = db )
26062607 if not db_file :
26072608 file_errors .append (
26082609 BatchProcessFilesResult (
@@ -2664,7 +2665,7 @@ async def process_files_batch(
26642665
26652666 # Update all files with collection name
26662667 for file_update , file_result in zip (file_updates , file_results ):
2667- Files .update_file_by_id (id = file_result .file_id , form_data = file_update )
2668+ Files .update_file_by_id (id = file_result .file_id , form_data = file_update , db = db )
26682669 file_result .status = 'completed'
26692670
26702671 except Exception as e :
You can’t perform that action at this time.
0 commit comments