From 9f68bd394b5085a80fe803e94482da3029b070bc Mon Sep 17 00:00:00 2001 From: Letong Han <106566639+letonghan@users.noreply.github.com> Date: Fri, 1 Nov 2024 15:58:36 +0800 Subject: [PATCH] enable parameter k to get web resources (#844) Signed-off-by: letonghan --- comps/web_retrievers/chroma/langchain/retriever_chroma.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/comps/web_retrievers/chroma/langchain/retriever_chroma.py b/comps/web_retrievers/chroma/langchain/retriever_chroma.py index 83e0876a9..f84c831e6 100644 --- a/comps/web_retrievers/chroma/langchain/retriever_chroma.py +++ b/comps/web_retrievers/chroma/langchain/retriever_chroma.py @@ -73,7 +73,7 @@ async def web_retrieve(input: EmbedDoc) -> SearchedDoc: embedding = input.embedding # Google Search the results, parse the htmls - search_results = get_urls(query) + search_results = get_urls(query=query, num_search_result=input.k) urls_to_look = [] for res in search_results: if res.get("link", None): @@ -94,7 +94,7 @@ async def web_retrieve(input: EmbedDoc) -> SearchedDoc: dump_docs(unique_documents) # Do the retrieval - search_res = await vector_db.asimilarity_search_by_vector(embedding=embedding) + search_res = await vector_db.asimilarity_search_by_vector(embedding=embedding, k=input.k) searched_docs = []