diff --git a/lightrag/operate.py b/lightrag/operate.py index 5750c108..1e2a9ddb 100644 --- a/lightrag/operate.py +++ b/lightrag/operate.py @@ -2391,7 +2391,7 @@ async def kg_query( ) if query_param.only_need_prompt: - return sys_prompt + return "\n\n".join([sys_prompt, "---User Query---", user_query]) tokenizer: Tokenizer = global_config["tokenizer"] len_of_prompts = len(tokenizer.encode(query + sys_prompt)) @@ -4248,7 +4248,7 @@ async def naive_query( ) if query_param.only_need_prompt: - return sys_prompt + return "\n\n".join([sys_prompt, "---User Query---", user_query]) len_of_prompts = len(tokenizer.encode(query + sys_prompt)) logger.debug( diff --git a/lightrag/prompt.py b/lightrag/prompt.py index 8697c761..8ea38abc 100644 --- a/lightrag/prompt.py +++ b/lightrag/prompt.py @@ -236,7 +236,7 @@ Consider the conversation history if provided to maintain conversational flow an - Target format and length: {response_type} 4. **Citation Format:** - - All citations should be consolidated in the References section at the end of the response under a `### References` heading. Do not include citation information within the main body of the answer. + - All citations should be consolidated in the References section at the end of the response under a `### References` heading. Do not include citation information within the main body of the answer. - Output the citation in the following formats: - For a Knowledge Graph Entity: `[KG] ` - For a Knowledge Graph Relationship: `[KG] ~ ` @@ -276,7 +276,7 @@ Consider the conversation history if provided to maintain conversational flow an - Target format and length: {response_type} 4. **Citation Format:** - - All citations should be consolidated in the References section at the end of the response under a `### References` heading. Do not include citation information within the main body of the answer. + - All citations should be consolidated in the References section at the end of the response under a `### References` heading. Do not include citation information within the main body of the answer. - Output the citation in the following format: `[DC] ` - Output each citation on a single new line. - Provide a maximum of 5 unique and most relevant references. Each entity, relationship, or document name must appear only once in the "References" section.