From ada6797f8dc3ffcc6d8abf32178bdaa404714fe0 Mon Sep 17 00:00:00 2001 From: letonghan Date: Tue, 13 Aug 2024 16:38:08 +0800 Subject: [PATCH] fix empty content issue Signed-off-by: letonghan --- comps/retrievers/haystack/qdrant/retriever_qdrant.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comps/retrievers/haystack/qdrant/retriever_qdrant.py b/comps/retrievers/haystack/qdrant/retriever_qdrant.py index d57232563..c2cc8735b 100644 --- a/comps/retrievers/haystack/qdrant/retriever_qdrant.py +++ b/comps/retrievers/haystack/qdrant/retriever_qdrant.py @@ -31,7 +31,7 @@ def initialize_qdrant_retriever() -> QdrantEmbeddingRetriever: @traceable(run_type="retriever") def retrieve(input: EmbedDoc) -> SearchedDoc: search_res = retriever.run(query_embedding=input.embedding)["documents"] - searched_docs = [TextDoc(text=r.content) for r in search_res] + searched_docs = [TextDoc(text=r.content) for r in search_res if r.content] result = SearchedDoc(retrieved_docs=searched_docs, initial_query=input.text) return result