From d48629d50d2885c69a9e2bb292b590851f9f7947 Mon Sep 17 00:00:00 2001 From: Han Xiao Date: Tue, 18 Mar 2025 12:36:11 +0800 Subject: [PATCH] feat: add hostnames bw filter --- src/agent.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/agent.ts b/src/agent.ts index d8feb08..2606e54 100644 --- a/src/agent.ts +++ b/src/agent.ts @@ -17,7 +17,7 @@ import { SearchResult, EvaluationType, BoostedSearchSnippet, - SearchSnippet, EvaluationResponse, Reference + SearchSnippet, EvaluationResponse, Reference, SERPQuery } from "./types"; import {TrackerContext} from "./types"; import {search} from "./tools/jina-search"; @@ -712,7 +712,7 @@ But then you realized you have asked them before. You decided to to think out of const qOnly = keywordsQueries.filter(q => q.q).map(q => q.q) // avoid exisitng searched queries const uniqQOnly = chooseK((await dedupQueries(qOnly, allKeywords, context.tokenTracker)).unique_queries, MAX_QUERIES_PER_STEP); - keywordsQueries = keywordsQueries.filter(q => q.q).filter(q => uniqQOnly.includes(q.q)); + keywordsQueries = uniqQOnly.map(q => keywordsQueries.find(kq => kq.q === q)) as SERPQuery[]; let anyResult = false;