File tree Expand file tree Collapse file tree 3 files changed +3
-7
lines changed
Expand file tree Collapse file tree 3 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -413,4 +413,3 @@ RESET_PASSWORD_TOKEN_EXPIRY_MINUTES=5
413413
414414CREATE_TIDB_SERVICE_JOB_ENABLED = false
415415
416- RETRIEVAL_TOP_N = 0
Original file line number Diff line number Diff line change @@ -626,8 +626,6 @@ class DataSetConfig(BaseSettings):
626626 default = 30 ,
627627 )
628628
629- RETRIEVAL_TOP_N : int = Field (description = "number of retrieval top_n" , default = 0 )
630-
631629
632630class WorkspaceConfig (BaseSettings ):
633631 """
Original file line number Diff line number Diff line change 33
44from flask import Flask , current_app
55
6- from configs import DifyConfig
76from core .rag .data_post_processor .data_post_processor import DataPostProcessor
87from core .rag .datasource .keyword .keyword_factory import Keyword
98from core .rag .datasource .vdb .vector_factory import Vector
@@ -114,7 +113,7 @@ def retrieve(
114113 query = query ,
115114 documents = all_documents ,
116115 score_threshold = score_threshold ,
117- top_n = DifyConfig . RETRIEVAL_TOP_N or top_k ,
116+ top_n = top_k ,
118117 )
119118
120119 return all_documents
@@ -186,7 +185,7 @@ def embedding_search(
186185 query = query ,
187186 documents = documents ,
188187 score_threshold = score_threshold ,
189- top_n = DifyConfig . RETRIEVAL_TOP_N or len (documents ),
188+ top_n = len (documents ),
190189 )
191190 )
192191 else :
@@ -231,7 +230,7 @@ def full_text_index_search(
231230 query = query ,
232231 documents = documents ,
233232 score_threshold = score_threshold ,
234- top_n = DifyConfig . RETRIEVAL_TOP_N or len (documents ),
233+ top_n = len (documents ),
235234 )
236235 )
237236 else :
You can’t perform that action at this time.
0 commit comments