feat: inject search result doc in the response, not the query

this is to handle when we have multiple models selected or regenerate a
response, it'll only add it to the model's response and not add dupes on
the user message
This commit is contained in:
Jun Siang Cheah
2024-05-12 20:45:46 +08:00
parent 44c8b0bb83
commit f49e1afaa6
3 changed files with 96 additions and 55 deletions
+3 -4
View File
@@ -327,11 +327,10 @@
messages = messages;
return;
}
const parentMessage = history.messages[parentId];
if (!parentMessage.files) {
parentMessage.files = [];
if (!responseMessage.files) {
responseMessage.files = [];
}
parentMessage.files.push({
responseMessage.files.push({
collection_name: searchDocument!.collection_name,
name: searchQuery,
type: 'websearch',