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):
"""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(

View file

@ -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__"

View file

@ -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)))

View file

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

View file

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