fix(RetrievalTesting): Limit the length of conversation history records
This commit is contained in:
parent
1c1afb4eaf
commit
6009c25886
1 changed files with 1 additions and 0 deletions
|
|
@ -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 }))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue