From a6f0c0b33bc808a01aa88fd5dfd84ae092d0e7cf Mon Sep 17 00:00:00 2001 From: yangdx Date: Wed, 23 Apr 2025 18:55:03 +0800 Subject: [PATCH] Simplify entity extraction prompt formatting logic --- lightrag/operate.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lightrag/operate.py b/lightrag/operate.py index eb027325..3a7f663e 100644 --- a/lightrag/operate.py +++ b/lightrag/operate.py @@ -601,9 +601,7 @@ async def extract_entities( file_path = chunk_dp.get("file_path", "unknown_source") # Get initial extraction - hint_prompt = entity_extract_prompt.format( - **context_base, input_text="{input_text}" - ).format(**context_base, input_text=content) + hint_prompt = entity_extract_prompt.format(**{**context_base, "input_text": content}) final_result = await use_llm_func_with_cache( hint_prompt,