ArnoChen
commited on
Commit
·
f456d4f
1
Parent(s):
dff8a57
fix retrieval testing and query settings
Browse files
lightrag_webui/src/components/retrieval/QuerySettings.tsx
CHANGED
@@ -75,7 +75,7 @@ export default function QuerySettings() {
|
|
75 |
</SelectTrigger>
|
76 |
<SelectContent>
|
77 |
<SelectGroup>
|
78 |
-
<SelectItem value="Multiple Paragraphs">
|
79 |
<SelectItem value="Single Paragraph">Single Paragraph</SelectItem>
|
80 |
<SelectItem value="Bullet Points">Bullet Points</SelectItem>
|
81 |
</SelectGroup>
|
|
|
75 |
</SelectTrigger>
|
76 |
<SelectContent>
|
77 |
<SelectGroup>
|
78 |
+
<SelectItem value="Multiple Paragraphs">Multiple Paragraphs</SelectItem>
|
79 |
<SelectItem value="Single Paragraph">Single Paragraph</SelectItem>
|
80 |
<SelectItem value="Bullet Points">Bullet Points</SelectItem>
|
81 |
</SelectGroup>
|
lightrag_webui/src/features/RetrievalTesting.tsx
CHANGED
@@ -37,11 +37,10 @@ export default function RetrievalTesting() {
|
|
37 |
role: 'assistant'
|
38 |
}
|
39 |
|
|
|
|
|
40 |
// Add messages to chatbox
|
41 |
-
setMessages(
|
42 |
-
const newMessages = [...prev, userMessage, assistantMessage]
|
43 |
-
return newMessages
|
44 |
-
})
|
45 |
|
46 |
// Clear input and set loading
|
47 |
setInputValue('')
|
@@ -65,7 +64,7 @@ export default function RetrievalTesting() {
|
|
65 |
const queryParams = {
|
66 |
...state.querySettings,
|
67 |
query: userMessage.content,
|
68 |
-
conversation_history:
|
69 |
}
|
70 |
|
71 |
try {
|
@@ -84,11 +83,7 @@ export default function RetrievalTesting() {
|
|
84 |
setIsLoading(false)
|
85 |
useSettingsStore
|
86 |
.getState()
|
87 |
-
.setRetrievalHistory([
|
88 |
-
...useSettingsStore.getState().retrievalHistory,
|
89 |
-
userMessage,
|
90 |
-
assistantMessage
|
91 |
-
])
|
92 |
}
|
93 |
},
|
94 |
[inputValue, isLoading, messages, setMessages]
|
|
|
37 |
role: 'assistant'
|
38 |
}
|
39 |
|
40 |
+
const prevMessages = [...messages]
|
41 |
+
|
42 |
// Add messages to chatbox
|
43 |
+
setMessages([...prevMessages, userMessage, assistantMessage])
|
|
|
|
|
|
|
44 |
|
45 |
// Clear input and set loading
|
46 |
setInputValue('')
|
|
|
64 |
const queryParams = {
|
65 |
...state.querySettings,
|
66 |
query: userMessage.content,
|
67 |
+
conversation_history: prevMessages
|
68 |
}
|
69 |
|
70 |
try {
|
|
|
83 |
setIsLoading(false)
|
84 |
useSettingsStore
|
85 |
.getState()
|
86 |
+
.setRetrievalHistory([...prevMessages, userMessage, assistantMessage])
|
|
|
|
|
|
|
|
|
87 |
}
|
88 |
},
|
89 |
[inputValue, isLoading, messages, setMessages]
|