choizhang commited on
Commit
47a8a07
·
1 Parent(s): 18f6e39

fix(RetrievalTesting): Limit the length of conversation history records

Browse files
lightrag_webui/src/features/RetrievalTesting.tsx CHANGED
@@ -69,6 +69,7 @@ export default function RetrievalTesting() {
69
  query: userMessage.content,
70
  conversation_history: prevMessages
71
  .filter((m) => m.isError !== true)
 
72
  .map((m) => ({ role: m.role, content: m.content }))
73
  }
74
 
 
69
  query: userMessage.content,
70
  conversation_history: prevMessages
71
  .filter((m) => m.isError !== true)
72
+ .slice(-(state.querySettings.history_turns || 0) * 2)
73
  .map((m) => ({ role: m.role, content: m.content }))
74
  }
75