From 0dbc3d9b2cc59b121650337b71b3b8a755e0ec16 Mon Sep 17 00:00:00 2001 From: Luis Lopez <29587742+toast22a@users.noreply.github.com> Date: Fri, 26 May 2023 10:25:36 +0800 Subject: [PATCH] Fix get_documents_ids_distances return error when n_results = 0 (#2347) --- extensions/superbooga/chromadb.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/superbooga/chromadb.py b/extensions/superbooga/chromadb.py index 8120e79..1fb7a71 100644 --- a/extensions/superbooga/chromadb.py +++ b/extensions/superbooga/chromadb.py @@ -50,7 +50,7 @@ class ChromaCollector(Collecter): def get_documents_ids_distances(self, search_strings: list[str], n_results: int): n_results = min(len(self.ids), n_results) if n_results == 0: - return [], [] + return [], [], [] result = self.collection.query(query_texts=search_strings, n_results=n_results, include=['documents', 'distances']) documents = result['documents'][0]