Skip to content

Commit 9685cb9

Browse files
ignore duplicate passages (#125)
1 parent 60c0a42 commit 9685cb9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

example-apps/chatbot-rag-app/frontend/src/store/provider.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ const globalSlice = createSlice({
4343
const rootSource = state.sources.find((s) => s.name === source.name)
4444

4545
if (rootSource) {
46-
rootSource.summary = [...rootSource.summary, source.summary]
46+
if (!rootSource.summary.find((summary) => summary === source.summary)) {
47+
rootSource.summary = [...rootSource.summary, source.summary]
48+
}
4749
} else {
4850
state.sources.push({ ...source, summary: [source.summary] })
4951
}

0 commit comments

Comments
 (0)