This commit is contained in:
hzywhite 2025-09-05 15:04:34 +08:00
parent e07d4bb70b
commit a33484bdb7
5 changed files with 18 additions and 13 deletions

View file

@ -181,8 +181,8 @@ class SchemesResponse(BaseModel):
class ScanRequest(BaseModel): class ScanRequest(BaseModel):
"""Request model for document scanning operations. """Request model for document scanning operations."""
"""
schemeConfig: SchemeConfig = Field(..., description="Scanning scheme configuration") schemeConfig: SchemeConfig = Field(..., description="Scanning scheme configuration")
@ -1406,7 +1406,7 @@ async def pipeline_index_files_raganything(
file_paths: List[Path], file_paths: List[Path],
scheme_name: str = None, scheme_name: str = None,
parser: str = None, parser: str = None,
source: str = None source: str = None,
): ):
"""Index multiple files using RAGAnything framework for multimodal processing. """Index multiple files using RAGAnything framework for multimodal processing.
@ -1445,7 +1445,7 @@ async def pipeline_index_files_raganything(
parse_method="auto", parse_method="auto",
scheme_name=scheme_name, scheme_name=scheme_name,
parser=parser, parser=parser,
source=source source=source,
) )
if success: if success:
pass pass
@ -1489,7 +1489,7 @@ async def run_scanning_process(
rag_anything: RAGAnything, rag_anything: RAGAnything,
doc_manager: DocumentManager, doc_manager: DocumentManager,
track_id: str = None, track_id: str = None,
schemeConfig = None, schemeConfig=None,
): ):
"""Background task to scan and index documents """Background task to scan and index documents
@ -1537,7 +1537,11 @@ async def run_scanning_process(
) )
elif scheme_name == "raganything": elif scheme_name == "raganything":
await pipeline_index_files_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( logger.info(
f"Scanning process completed with raganything: {total_files} files Processed." f"Scanning process completed with raganything: {total_files} files Processed."
@ -1855,7 +1859,9 @@ def create_document_routes(
item["name"] = updated_item["name"] item["name"] = updated_item["name"]
item["config"]["framework"] = updated_item["config"]["framework"] item["config"]["framework"] = updated_item["config"]["framework"]
item["config"]["extractor"] = updated_item["config"]["extractor"] item["config"]["extractor"] = updated_item["config"]["extractor"]
item["config"]["modelSource"] = updated_item["config"]["modelSource"] item["config"]["modelSource"] = updated_item["config"][
"modelSource"
]
break break
# 写回文件 # 写回文件
@ -2112,7 +2118,7 @@ def create_document_routes(
parse_method="auto", parse_method="auto",
scheme_name=current_framework, scheme_name=current_framework,
parser=current_extractor, parser=current_extractor,
source=current_modelSource source=current_modelSource,
) )
await rag.doc_status.upsert( await rag.doc_status.upsert(

View file

@ -967,14 +967,13 @@ class LightRAG:
self.move_file_to_enqueue(current_file_path) self.move_file_to_enqueue(current_file_path)
else: else:
continue continue
await self.apipeline_process_enqueue_documents( await self.apipeline_process_enqueue_documents(
split_by_character, split_by_character_only split_by_character, split_by_character_only
) )
return track_id return track_id
def move_file_to_enqueue(self, file_path): def move_file_to_enqueue(self, file_path):
try: try:
enqueued_dir = file_path.parent / "__enqueued__" enqueued_dir = file_path.parent / "__enqueued__"

View file

@ -1777,7 +1777,7 @@ async def merge_nodes_and_edges(
existing_relation_pairs = set() existing_relation_pairs = set()
if existing_relations_data and existing_relations_data.get( if existing_relations_data and existing_relations_data.get(
"relation_pairs" "relation_pairs"
): ):
for pair in existing_relations_data["relation_pairs"]: for pair in existing_relations_data["relation_pairs"]:
existing_relation_pairs.add(tuple(sorted(pair))) existing_relation_pairs.add(tuple(sorted(pair)))

View file

@ -64,7 +64,7 @@ export default function UploadDocumentsDialog({ onDocumentsUploaded }: UploadDoc
toast.error(t('schemeManager.upload.noSchemeSelected')); toast.error(t('schemeManager.upload.noSchemeSelected'));
return; return;
} }
setIsUploading(true) setIsUploading(true)
let hasSuccessfulUpload = false let hasSuccessfulUpload = false

View file

@ -412,7 +412,7 @@ export default function DocumentManager() {
processing: 0, processing: 0,
handling: 0, handling: 0,
pending: 0, pending: 0,
ready: 0, ready: 0,
failed: 0 failed: 0
}) })