mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-25 09:32:38 +08:00
Refactor: do not include compliation chunks in retrieval testing (#18364)
Retrieval Testing: do not include compilation result. Search: include compilation result.
This commit is contained in:
@@ -515,7 +515,7 @@ async def search_datasets(tenant_id):
|
||||
POST /api/v1/datasets/search
|
||||
JSON body: {"dataset_ids": list[str] (required), "question": str (required), "doc_ids": list[str], "top_k": int, "page": int, "size": int,
|
||||
"similarity_threshold": float, "vector_similarity_weight": float, "use_kg": bool,
|
||||
"cross_languages": list[str], "keyword": bool, "meta_data_filter": dict}
|
||||
"cross_languages": list[str], "keyword": bool, "meta_data_filter": dict, "include_knowledge_compilation": bool (default true)}
|
||||
Success: {"code": 0, "data": {"chunks": [...], "total": int, "labels": [...]}}
|
||||
Errors: ARGUMENT_ERROR (101) for invalid payload; DATA_ERROR (102) for access denied or internal errors.
|
||||
"""
|
||||
@@ -538,7 +538,7 @@ async def search(tenant_id, dataset_id):
|
||||
POST /api/v1/datasets/<dataset_id>/search
|
||||
JSON body: {"question": str (required), "doc_ids": list[str], "top_k": int, "page": int, "size": int,
|
||||
"similarity_threshold": float, "vector_similarity_weight": float, "use_kg": bool,
|
||||
"cross_languages": list[str], "keyword": bool, "meta_data_filter": dict}
|
||||
"cross_languages": list[str], "keyword": bool, "meta_data_filter": dict, "include_knowledge_compilation": bool (default true)}
|
||||
Success: {"code": 0, "data": {"chunks": [...], "total": int, "labels": [...]}}
|
||||
Errors: ARGUMENT_ERROR (101) for invalid payload; DATA_ERROR (102) for access denied or internal errors.
|
||||
"""
|
||||
|
||||
@@ -1530,6 +1530,7 @@ async def search_datasets(tenant_id: str, req: dict):
|
||||
rerank_mdl=rerank_mdl,
|
||||
rank_feature=labels,
|
||||
trace_id=search_id,
|
||||
must_not=None if req.get("include_knowledge_compilation", True) else {"exists": "compile_kwd"},
|
||||
)
|
||||
|
||||
if use_kg:
|
||||
|
||||
@@ -992,6 +992,7 @@ class SearchDatasetReq(BaseModel):
|
||||
rerank_id: Annotated[str | None, Field(default=None)]
|
||||
tenant_rerank_id: Annotated[str | None, Field(default=None)]
|
||||
meta_data_filter: Annotated[dict | None, Field(default=None)]
|
||||
include_knowledge_compilation: Annotated[bool, Field(default=True)]
|
||||
|
||||
|
||||
class SearchDatasetsReq(BaseModel):
|
||||
@@ -1014,6 +1015,7 @@ class SearchDatasetsReq(BaseModel):
|
||||
rerank_id: Annotated[str | None, Field(default=None)]
|
||||
tenant_rerank_id: Annotated[str | None, Field(default=None)]
|
||||
meta_data_filter: Annotated[dict | None, Field(default=None)]
|
||||
include_knowledge_compilation: Annotated[bool, Field(default=True)]
|
||||
|
||||
|
||||
class BaseListReq(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user