mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Feat: Add metadata filtering function for /api/v1/retrieval (#9877)
-Added the metadata_dedition parameter in the document retrieval interface to filter document metadata -Updated the API documentation and added explanations for the metadata_dedition parameter ### What problem does this PR solve? Make /api/v1/retrieval api also can use metadata filter ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -197,7 +197,8 @@ class RAGFlow:
|
||||
top_k=1024,
|
||||
rerank_id: str | None = None,
|
||||
keyword: bool = False,
|
||||
cross_languages: list[str]|None = None
|
||||
cross_languages: list[str]|None = None,
|
||||
metadata_condition: dict | None = None,
|
||||
):
|
||||
if document_ids is None:
|
||||
document_ids = []
|
||||
@ -212,7 +213,8 @@ class RAGFlow:
|
||||
"question": question,
|
||||
"dataset_ids": dataset_ids,
|
||||
"document_ids": document_ids,
|
||||
"cross_languages": cross_languages
|
||||
"cross_languages": cross_languages,
|
||||
"metadata_condition": metadata_condition
|
||||
}
|
||||
# Send a POST request to the backend service (using requests library as an example, actual implementation may vary)
|
||||
res = self.post("/retrieval", json=data_json)
|
||||
|
||||
Reference in New Issue
Block a user