diff --git a/lightrag/api/lightrag_server.py b/lightrag/api/lightrag_server.py index 673177ac..9b2a1c76 100644 --- a/lightrag/api/lightrag_server.py +++ b/lightrag/api/lightrag_server.py @@ -181,6 +181,8 @@ def create_app(args): "Skip document scanning(another scanning is active)" ) + ASCIIColors.green("\nServer is ready to accept connections! 🚀\n") + yield finally: diff --git a/lightrag/api/routers/document_routes.py b/lightrag/api/routers/document_routes.py index 25ca24e4..5c742f39 100644 --- a/lightrag/api/routers/document_routes.py +++ b/lightrag/api/routers/document_routes.py @@ -161,7 +161,7 @@ class DocumentManager: """Scan input directory for new files""" new_files = [] for ext in self.supported_extensions: - logging.info(f"Scanning for {ext} files in {self.input_dir}") + logging.debug(f"Scanning for {ext} files in {self.input_dir}") for file_path in self.input_dir.rglob(f"*{ext}"): if file_path not in self.indexed_files: new_files.append(file_path) diff --git a/lightrag/api/utils_api.py b/lightrag/api/utils_api.py index a78a6e93..17f19627 100644 --- a/lightrag/api/utils_api.py +++ b/lightrag/api/utils_api.py @@ -492,7 +492,5 @@ def display_splash_screen(args: argparse.Namespace) -> None: Make sure to include the X-API-Key header in all your requests. """) - ASCIIColors.green("Server is ready to accept connections! 🚀\n") - # Ensure splash output flush to system log sys.stdout.flush() diff --git a/lightrag/lightrag.py b/lightrag/lightrag.py index 8ac41721..fa39db59 100644 --- a/lightrag/lightrag.py +++ b/lightrag/lightrag.py @@ -581,7 +581,7 @@ class LightRAG: await self._insert_done() async def apipeline_enqueue_documents( - self, input: str | list[str], ids: list[str] | None + self, input: str | list[str], ids: list[str] | None = None ) -> None: """ Pipeline for Processing Documents @@ -595,9 +595,6 @@ class LightRAG: if isinstance(input, str): input = [input] - # Clean input text and remove duplicates - input = list(set(self.clean_text(doc) for doc in input)) - # 1. Validate ids if provided or generate MD5 hash IDs if ids is not None: # Check if the number of IDs matches the number of documents @@ -611,6 +608,8 @@ class LightRAG: # Generate contents dict of IDs provided by user and documents contents = {id_: doc for id_, doc in zip(ids, input)} else: + # Clean input text and remove duplicates + input = list(set(self.clean_text(doc) for doc in input)) # Generate contents dict of MD5 hash IDs and documents contents = {compute_mdhash_id(doc, prefix="doc-"): doc for doc in input}