Skip to content

Commit

Permalink
always return usedTools meta
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardobl committed May 28, 2024
1 parent 8f6f8be commit 402b4a3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/rag/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 402b4a3

Please sign in to comment.