Add conversation history to naive_query prompt

This commit is contained in:
yangdx
2025-01-25 16:29:18 +08:00
parent 207c0e8299
commit d1969515d3

View File

@@ -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: