mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-05-05 09:47:47 +08:00
Fix: failing p3 test for SDK/HTTP APIs (#13062)
### What problem does this PR solve? Adjust highlight parsing, add row-count SQL override, tweak retrieval thresholding, and update tests with engine-aware skips/utilities. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -1549,10 +1549,18 @@ async def retrieval_test(tenant_id):
|
||||
similarity_threshold = float(req.get("similarity_threshold", 0.2))
|
||||
vector_similarity_weight = float(req.get("vector_similarity_weight", 0.3))
|
||||
top = int(req.get("top_k", 1024))
|
||||
if req.get("highlight") == "False" or req.get("highlight") == "false":
|
||||
highlight_val = req.get("highlight", None)
|
||||
if highlight_val is None:
|
||||
highlight = False
|
||||
elif isinstance(highlight_val, bool):
|
||||
highlight = highlight_val
|
||||
elif isinstance(highlight_val, str):
|
||||
if highlight_val.lower() in ["true", "false"]:
|
||||
highlight = highlight_val.lower() == "true"
|
||||
else:
|
||||
return get_error_data_result("`highlight` should be a boolean")
|
||||
else:
|
||||
highlight = True
|
||||
return get_error_data_result("`highlight` should be a boolean")
|
||||
try:
|
||||
tenant_ids = list(set([kb.tenant_id for kb in kbs]))
|
||||
e, kb = KnowledgebaseService.get_by_id(kb_ids[0])
|
||||
|
||||
Reference in New Issue
Block a user