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

This commit is contained in:
choizhang
2025-04-10 17:02:28 +08:00
parent 1c1afb4eaf
commit 6009c25886

View File

@@ -69,6 +69,7 @@ export default function RetrievalTesting() {
query: userMessage.content,
conversation_history: prevMessages
.filter((m) => m.isError !== true)
.slice(-(state.querySettings.history_turns || 0) * 2)
.map((m) => ({ role: m.role, content: m.content }))
}