From 2a010c985e1548d295b4972678a56509726a999e Mon Sep 17 00:00:00 2001 From: yangdx Date: Thu, 30 Jan 2025 22:21:52 +0800 Subject: [PATCH] Add logging for chunk truncation in mix_kg_vector_query --- lightrag/operate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lightrag/operate.py b/lightrag/operate.py index d88dc7c2..7fbd23b6 100644 --- a/lightrag/operate.py +++ b/lightrag/operate.py @@ -911,7 +911,8 @@ async def mix_kg_vector_query( if c["created_at"]: chunk_text = f"[Created at: {time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(c['created_at']))}]\n{chunk_text}" formatted_chunks.append(chunk_text) - + + logger.info(f"Truncate {len(chunks)} to {len(formatted_chunks)} chunks") return "\n--New Chunk--\n".join(formatted_chunks) except Exception as e: logger.error(f"Error in get_vector_context: {e}")