yangdx
commited on
Commit
·
3664fb0
1
Parent(s):
3deb059
Add logging for chunk truncation in mix_kg_vector_query
Browse files- lightrag/operate.py +2 -1
lightrag/operate.py
CHANGED
|
@@ -911,7 +911,8 @@ async def mix_kg_vector_query(
|
|
| 911 |
if c["created_at"]:
|
| 912 |
chunk_text = f"[Created at: {time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(c['created_at']))}]\n{chunk_text}"
|
| 913 |
formatted_chunks.append(chunk_text)
|
| 914 |
-
|
|
|
|
| 915 |
return "\n--New Chunk--\n".join(formatted_chunks)
|
| 916 |
except Exception as e:
|
| 917 |
logger.error(f"Error in get_vector_context: {e}")
|
|
|
|
| 911 |
if c["created_at"]:
|
| 912 |
chunk_text = f"[Created at: {time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(c['created_at']))}]\n{chunk_text}"
|
| 913 |
formatted_chunks.append(chunk_text)
|
| 914 |
+
|
| 915 |
+
logger.info(f"Truncate {len(chunks)} to {len(formatted_chunks)} chunks")
|
| 916 |
return "\n--New Chunk--\n".join(formatted_chunks)
|
| 917 |
except Exception as e:
|
| 918 |
logger.error(f"Error in get_vector_context: {e}")
|