Merge branch 'add-log'
Browse files- lightrag/api/routers/document_routes.py +4 -0
- lightrag/lightrag.py +3 -0
- pyproject.toml +4 -1
lightrag/api/routers/document_routes.py
CHANGED
@@ -714,6 +714,10 @@ async def pipeline_enqueue_file(rag: LightRAG, file_path: Path) -> bool:
|
|
714 |
|
715 |
# Insert into the RAG queue
|
716 |
if content:
|
|
|
|
|
|
|
|
|
717 |
await rag.apipeline_enqueue_documents(content, file_paths=file_path.name)
|
718 |
logger.info(f"Successfully fetched and enqueued file: {file_path.name}")
|
719 |
return True
|
|
|
714 |
|
715 |
# Insert into the RAG queue
|
716 |
if content:
|
717 |
+
# Check if content contains only whitespace characters
|
718 |
+
if not content.strip():
|
719 |
+
logger.warning(f"File contains only whitespace characters. file_paths={file_path.name}")
|
720 |
+
|
721 |
await rag.apipeline_enqueue_documents(content, file_paths=file_path.name)
|
722 |
logger.info(f"Successfully fetched and enqueued file: {file_path.name}")
|
723 |
return True
|
lightrag/lightrag.py
CHANGED
@@ -965,6 +965,9 @@ class LightRAG:
|
|
965 |
)
|
966 |
}
|
967 |
|
|
|
|
|
|
|
968 |
# Process document in two stages
|
969 |
# Stage 1: Process text chunks and docs (parallel execution)
|
970 |
doc_status_task = asyncio.create_task(
|
|
|
965 |
)
|
966 |
}
|
967 |
|
968 |
+
if not chunks:
|
969 |
+
logger.warning("No document chunks to process")
|
970 |
+
|
971 |
# Process document in two stages
|
972 |
# Stage 1: Process text chunks and docs (parallel execution)
|
973 |
doc_status_task = asyncio.create_task(
|
pyproject.toml
CHANGED
@@ -11,7 +11,7 @@ authors = [
|
|
11 |
description = "LightRAG: Simple and Fast Retrieval-Augmented Generation"
|
12 |
readme = "README.md"
|
13 |
license = {text = "MIT"}
|
14 |
-
requires-python = ">=3.
|
15 |
classifiers = [
|
16 |
"Development Status :: 4 - Beta",
|
17 |
"Programming Language :: Python :: 3",
|
@@ -91,3 +91,6 @@ version = {attr = "lightrag.__version__"}
|
|
91 |
|
92 |
[tool.setuptools.package-data]
|
93 |
lightrag = ["api/webui/**/*"]
|
|
|
|
|
|
|
|
11 |
description = "LightRAG: Simple and Fast Retrieval-Augmented Generation"
|
12 |
readme = "README.md"
|
13 |
license = {text = "MIT"}
|
14 |
+
requires-python = ">=3.10"
|
15 |
classifiers = [
|
16 |
"Development Status :: 4 - Beta",
|
17 |
"Programming Language :: Python :: 3",
|
|
|
91 |
|
92 |
[tool.setuptools.package-data]
|
93 |
lightrag = ["api/webui/**/*"]
|
94 |
+
|
95 |
+
[tool.ruff]
|
96 |
+
target-version = "py310"
|