R2R icon indicating copy to clipboard operation
R2R copied to clipboard

Unable to filter using metadata in the new version

Open kiran-bal opened this issue 5 months ago • 0 comments

Iam using R2R version 3.6.1 with ollama - llama3.1 model. I have added a pdf document to the R2R using the custom ingestion_mode. When iam using the rag stream iam unable the filter not getting applied. Please see the below code and let me know if this is not the right approach for metadata filtering in rag stream.

search_settings = {
    "use_semantic_search": True,
    "filters": {"metadata.doc_type": {"$eq": "video"}}
}


result =r2r_client.retrieval.rag(
query=query,
task_prompt=R2R_DOC_CHAT_TEMPLATE,
search_settings=search_settings,
rag_generation_config={
    "stream": True
}
)

kiran-bal avatar May 14 '25 12:05 kiran-bal