From ef3bd336d41539d314ddcd96aec0d3798ee1f341 Mon Sep 17 00:00:00 2001 From: tokebe <43009413+tokebe@users.noreply.github.com> Date: Wed, 13 Dec 2023 15:40:33 -0500 Subject: [PATCH] fix: description results count --- src/inferred_mode/inferred_mode.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/inferred_mode/inferred_mode.ts b/src/inferred_mode/inferred_mode.ts index 727f8c52..31b2169f 100644 --- a/src/inferred_mode/inferred_mode.ts +++ b/src/inferred_mode/inferred_mode.ts @@ -603,13 +603,13 @@ export default class InferredQueryHandler { ); } const response = combinedResponse as unknown as TrapiResponse; - response.description = `Query processed successfully, retrieved ${response.message.results.length} results.`; // sort records by score response.message.results = Object.values(combinedResponse.message.results).sort((a, b) => { return b.analyses[0].score - a.analyses[0].score ? b.analyses[0].score - a.analyses[0].score : 0; }); // trim extra results and prune kg response.message.results = response.message.results.slice(0, this.CREATIVE_LIMIT); + response.description = `Query processed successfully, retrieved ${response.message.results.length} results.`; this.pruneKnowledgeGraph(response); // get the final summary log if (successfulQueries) {