From 402b4a39cc076c417fd335d5e5cbc54675c23fb1 Mon Sep 17 00:00:00 2001 From: Riccardo Balbo Date: Tue, 28 May 2024 16:42:12 +0200 Subject: [PATCH] always return usedTools meta --- src/rag/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rag/index.js b/src/rag/index.js index acdb9fe..1ccbcd6 100644 --- a/src/rag/index.js +++ b/src/rag/index.js @@ -77,7 +77,9 @@ async function run() { } let newContext = ""; - let meta={}; + let meta={ + usedTools: [] + }; if (documentsUrls.length>0||documents.length>0){ Job.log("Starting rag pipeline with k="+topK+", max-tokens="+maxTokens+", quantize="+quantize+", overlap="+overlap+", cache-duration-hint="+cacheDurationHint+", no-cache="+noCache); @@ -184,7 +186,6 @@ async function run() { if(typeof msg == "object" && msg.sources){ for(const source of msg.sources){ // newContext += "Source: "+source.name+"\n"; - meta.usedTools = meta.usedTools || []; meta.usedTools.push(source.id); } }