Find answers from the community

Updated 3 months ago

Hi, I am using the

Hi, I am using the QueryFusionTransformer -
retriever = QueryFusionRetriever(
[index_1.as_retriever(), index_2.as_retriever()],
similarity_top_k=5,
num_queries=4, # set this to 1 to disable query generation
use_async=True,
verbose=True,
# query_gen_prompt="...", # we could override the query generation prompt here
)
Can we inject our own query into the generated queries list and then proceed ahead for the retrieval? Also, while doing filtering, will it be passed through both indexes? More importantly how to do filtering using this retriever.
W
P
6 comments
I dont think you can inject your own query directly. Maybe create the queries at your side and add your queries and then pass it to the next intended operation.
what about filters?
where to pass it?
lol tell me something xD
For adding more queries, i think you can subclass and update the following method as per your need to add extra queries: https://github.com/run-llama/llama_index/blob/ca9634e660b91799a86ee9f9f0a697eb236bcefd/llama-index-core/llama_index/core/retrievers/fusion_retriever.py#L83

For the filters: Not much idea
Hi, getting this error - ImportError: cannot import name 'BaseNodePostprocessor' from 'llama_index.core.postprocessor' (/usr/local/lib/python3.10/dist-packages/llama_index/core/postprocessor/init.py)
Add a reply
Sign up and join the conversation on Discord