yangdx commited on
Commit
b56bb94
·
1 Parent(s): 71b1e2e

Fix history_context handling error in kg_query

Browse files
Files changed (1) hide show
  1. lightrag/operate.py +2 -5
lightrag/operate.py CHANGED
@@ -633,11 +633,8 @@ async def kg_query(
633
  # Process conversation history
634
  history_context = ""
635
  if query_param.conversation_history:
636
- recent_history = query_param.conversation_history[
637
- -query_param.history_window_size :
638
- ]
639
- history_context = "\n".join(
640
- [f"{turn['role']}: {turn['content']}" for turn in recent_history]
641
  )
642
 
643
  sys_prompt_temp = PROMPTS["rag_response"]
 
633
  # Process conversation history
634
  history_context = ""
635
  if query_param.conversation_history:
636
+ history_context = get_conversation_turns(
637
+ query_param.conversation_history, query_param.history_turns
 
 
 
638
  )
639
 
640
  sys_prompt_temp = PROMPTS["rag_response"]