diff --git a/lightrag/operate.py b/lightrag/operate.py index 15ba7696..cd8d8a64 100644 --- a/lightrag/operate.py +++ b/lightrag/operate.py @@ -3233,7 +3233,7 @@ async def _build_llm_context( text_units_str = "\n".join( json.dumps(text_unit, ensure_ascii=False) for text_unit in text_units_context ) - reference_list_str = "\n\n".join( + reference_list_str = "\n".join( f"[{ref['reference_id']}] {ref['file_path']}" for ref in reference_list if ref["reference_id"] @@ -4124,7 +4124,7 @@ async def naive_query( text_units_str = "\n".join( json.dumps(text_unit, ensure_ascii=False) for text_unit in text_units_context ) - reference_list_str = "\n\n".join( + reference_list_str = "\n".join( f"[{ref['reference_id']}] {ref['file_path']}" for ref in reference_list if ref["reference_id"] diff --git a/lightrag/prompt.py b/lightrag/prompt.py index bd010cd2..ded23c7e 100644 --- a/lightrag/prompt.py +++ b/lightrag/prompt.py @@ -340,7 +340,7 @@ Document Chunks (Each entry has a reference_id refer to the `Reference Document Reference Document List (Each entry starts with a [reference_id] that corresponds to entries in the Document Chunks): -```text +``` {reference_list_str} ``` @@ -355,7 +355,7 @@ Document Chunks (Each entry has a reference_id refer to the `Reference Document Reference Document List (Each entry starts with a [reference_id] that corresponds to entries in the Document Chunks): -```text +``` {reference_list_str} ```