fix multi-dataset retrieve score limit (#2050)

Co-authored-by: jyong <jyong@dify.ai>
This commit is contained in:
Jyong 2024-01-16 14:14:34 +08:00 committed by GitHub
parent 1a2eacc5a6
commit 790b885d0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -166,8 +166,7 @@ class DatasetRetrievalFeature:
dataset_ids=[dataset.id for dataset in available_datasets],
tenant_id=tenant_id,
top_k=retrieve_config.top_k or 2,
score_threshold=(retrieve_config.score_threshold or 0.5)
if retrieve_config.reranking_model.get('score_threshold_enabled', False) else None,
score_threshold=retrieve_config.score_threshold,
hit_callbacks=[hit_callback],
return_resource=return_resource,
retriever_from=invoke_from.to_source(),