mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-12 03:49:04 +08:00
fix score_threshold is none, return all top K documents (#7581)
This commit is contained in:
parent
ad13011043
commit
f29685f8a1
@ -614,7 +614,7 @@ class DatasetRetrieval:
|
||||
top_k: int, score_threshold: float) -> list[Document]:
|
||||
filter_documents = []
|
||||
for document in all_documents:
|
||||
if score_threshold and document.metadata['score'] >= score_threshold:
|
||||
if score_threshold is None or document.metadata['score'] >= score_threshold:
|
||||
filter_documents.append(document)
|
||||
if not filter_documents:
|
||||
return []
|
||||
|
Loading…
x
Reference in New Issue
Block a user