From fb3b1ceba22c91e20833a57d0e49116a7de9c149 Mon Sep 17 00:00:00 2001 From: Adam Treat Date: Mon, 4 Dec 2023 12:58:40 -0500 Subject: [PATCH] Do not attempt to do a blocking retrieval if we don't have any collections. --- gpt4all-chat/chatllm.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gpt4all-chat/chatllm.cpp b/gpt4all-chat/chatllm.cpp index 6e49d712..e5a84548 100644 --- a/gpt4all-chat/chatllm.cpp +++ b/gpt4all-chat/chatllm.cpp @@ -534,8 +534,10 @@ bool ChatLLM::promptInternal(const QList &collectionList, const QString QList databaseResults; const int retrievalSize = MySettings::globalInstance()->localDocsRetrievalSize(); - emit requestRetrieveFromDB(collectionList, prompt, retrievalSize, &databaseResults); // blocks - emit databaseResultsChanged(databaseResults); + if (!collectionList.isEmpty()) { + emit requestRetrieveFromDB(collectionList, prompt, retrievalSize, &databaseResults); // blocks + emit databaseResultsChanged(databaseResults); + } // Augment the prompt template with the results if any QList augmentedTemplate;