diff --git a/lightrag/api/routers/document_routes.py b/lightrag/api/routers/document_routes.py index 2293a0e6..012b0396 100644 --- a/lightrag/api/routers/document_routes.py +++ b/lightrag/api/routers/document_routes.py @@ -181,8 +181,8 @@ class SchemesResponse(BaseModel): class ScanRequest(BaseModel): - """Request model for document scanning operations. - """ + """Request model for document scanning operations.""" + schemeConfig: SchemeConfig = Field(..., description="Scanning scheme configuration") @@ -1406,7 +1406,7 @@ async def pipeline_index_files_raganything( file_paths: List[Path], scheme_name: str = None, parser: str = None, - source: str = None + source: str = None, ): """Index multiple files using RAGAnything framework for multimodal processing. @@ -1445,7 +1445,7 @@ async def pipeline_index_files_raganything( parse_method="auto", scheme_name=scheme_name, parser=parser, - source=source + source=source, ) if success: pass @@ -1489,7 +1489,7 @@ async def run_scanning_process( rag_anything: RAGAnything, doc_manager: DocumentManager, track_id: str = None, - schemeConfig = None, + schemeConfig=None, ): """Background task to scan and index documents @@ -1537,7 +1537,11 @@ async def run_scanning_process( ) elif scheme_name == "raganything": await pipeline_index_files_raganything( - rag_anything, new_files, scheme_name=scheme_name, parser=extractor, source=modelSource + rag_anything, + new_files, + scheme_name=scheme_name, + parser=extractor, + source=modelSource, ) logger.info( f"Scanning process completed with raganything: {total_files} files Processed." @@ -1855,7 +1859,9 @@ def create_document_routes( item["name"] = updated_item["name"] item["config"]["framework"] = updated_item["config"]["framework"] item["config"]["extractor"] = updated_item["config"]["extractor"] - item["config"]["modelSource"] = updated_item["config"]["modelSource"] + item["config"]["modelSource"] = updated_item["config"][ + "modelSource" + ] break # 写回文件 @@ -2112,7 +2118,7 @@ def create_document_routes( parse_method="auto", scheme_name=current_framework, parser=current_extractor, - source=current_modelSource + source=current_modelSource, ) await rag.doc_status.upsert( diff --git a/lightrag/lightrag.py b/lightrag/lightrag.py index 447b0bcb..df64dca7 100644 --- a/lightrag/lightrag.py +++ b/lightrag/lightrag.py @@ -967,14 +967,13 @@ class LightRAG: self.move_file_to_enqueue(current_file_path) else: continue - + await self.apipeline_process_enqueue_documents( split_by_character, split_by_character_only ) return track_id - def move_file_to_enqueue(self, file_path): try: enqueued_dir = file_path.parent / "__enqueued__" diff --git a/lightrag/operate.py b/lightrag/operate.py index 459a644e..1b2f13e9 100644 --- a/lightrag/operate.py +++ b/lightrag/operate.py @@ -1777,7 +1777,7 @@ async def merge_nodes_and_edges( existing_relation_pairs = set() if existing_relations_data and existing_relations_data.get( - "relation_pairs" + "relation_pairs" ): for pair in existing_relations_data["relation_pairs"]: existing_relation_pairs.add(tuple(sorted(pair))) diff --git a/lightrag_webui/src/components/documents/UploadDocumentsDialog.tsx b/lightrag_webui/src/components/documents/UploadDocumentsDialog.tsx index a9176481..1906cde1 100644 --- a/lightrag_webui/src/components/documents/UploadDocumentsDialog.tsx +++ b/lightrag_webui/src/components/documents/UploadDocumentsDialog.tsx @@ -64,7 +64,7 @@ export default function UploadDocumentsDialog({ onDocumentsUploaded }: UploadDoc toast.error(t('schemeManager.upload.noSchemeSelected')); return; } - + setIsUploading(true) let hasSuccessfulUpload = false diff --git a/lightrag_webui/src/features/DocumentManager.tsx b/lightrag_webui/src/features/DocumentManager.tsx index 8ee1f471..22a2dffd 100644 --- a/lightrag_webui/src/features/DocumentManager.tsx +++ b/lightrag_webui/src/features/DocumentManager.tsx @@ -412,7 +412,7 @@ export default function DocumentManager() { processing: 0, handling: 0, pending: 0, - ready: 0, + ready: 0, failed: 0 })