Fix history_context handling error in kg_query

This commit is contained in:
yangdx
2025-01-25 22:54:12 +08:00
parent 2719e07107
commit 86282ba434

View File

@@ -633,11 +633,8 @@ async def kg_query(
# Process conversation history # Process conversation history
history_context = "" history_context = ""
if query_param.conversation_history: if query_param.conversation_history:
recent_history = query_param.conversation_history[ history_context = get_conversation_turns(
-query_param.history_window_size : query_param.conversation_history, query_param.history_turns
]
history_context = "\n".join(
[f"{turn['role']}: {turn['content']}" for turn in recent_history]
) )
sys_prompt_temp = PROMPTS["rag_response"] sys_prompt_temp = PROMPTS["rag_response"]