diff --git a/lightrag/operate.py b/lightrag/operate.py index 75bb2c25..74ffa462 100644 --- a/lightrag/operate.py +++ b/lightrag/operate.py @@ -1534,9 +1534,16 @@ async def naive_query( if query_param.only_need_context: return section + # Process conversation history + history_context = "" + if query_param.conversation_history: + history_context = get_conversation_turns( + query_param.conversation_history, query_param.history_turns + ) + sys_prompt_temp = PROMPTS["naive_rag_response"] sys_prompt = sys_prompt_temp.format( - content_data=section, response_type=query_param.response_type + content_data=section, response_type=query_param.response_type, history=history_context ) if query_param.only_need_prompt: