From d03192a3bdfe1411e31a8961754b11e8b96415bd Mon Sep 17 00:00:00 2001 From: iridium-soda Date: Sat, 11 Jan 2025 09:27:53 +0000 Subject: [PATCH] fix: Resolve 500 error caused by missing `len()` for `LightRAG` --- lightrag/api/lollms_lightrag_server.py | 2 +- lightrag/api/ollama_lightrag_server.py | 2 +- lightrag/api/openai_lightrag_server.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lightrag/api/lollms_lightrag_server.py b/lightrag/api/lollms_lightrag_server.py index 8a2804a0..50a47ec1 100644 --- a/lightrag/api/lollms_lightrag_server.py +++ b/lightrag/api/lollms_lightrag_server.py @@ -376,7 +376,7 @@ def create_app(args): return InsertResponse( status="success", message="Text successfully inserted", - document_count=len(rag), + document_count=1, ) except Exception as e: raise HTTPException(status_code=500, detail=str(e)) diff --git a/lightrag/api/ollama_lightrag_server.py b/lightrag/api/ollama_lightrag_server.py index b3140aba..66b272d8 100644 --- a/lightrag/api/ollama_lightrag_server.py +++ b/lightrag/api/ollama_lightrag_server.py @@ -375,7 +375,7 @@ def create_app(args): return InsertResponse( status="success", message="Text successfully inserted", - document_count=len(rag), + document_count=1, ) except Exception as e: raise HTTPException(status_code=500, detail=str(e)) diff --git a/lightrag/api/openai_lightrag_server.py b/lightrag/api/openai_lightrag_server.py index 349c09da..d65eaa34 100644 --- a/lightrag/api/openai_lightrag_server.py +++ b/lightrag/api/openai_lightrag_server.py @@ -390,7 +390,7 @@ def create_app(args): return InsertResponse( status="success", message="Text successfully inserted", - document_count=len(rag), + document_count=1, ) except Exception as e: raise HTTPException(status_code=500, detail=str(e))