be more specific for error message (#1409)

### What problem does this PR solve?

#918 

### Type of change

- [x] Refactoring
This commit is contained in:
KevinHuSh
2024-07-08 09:32:44 +08:00
committed by GitHub
parent dcb3fb2073
commit b3ebc66b13
9 changed files with 126 additions and 61 deletions

View File

@@ -40,10 +40,10 @@ class RetrievalParam(ComponentParamBase):
self.empty_response = ""
def check(self):
self.check_decimal_float(self.similarity_threshold, "Similarity threshold")
self.check_decimal_float(self.keywords_similarity_weight, "Keywords similarity weight")
self.check_positive_number(self.top_n, "Top N")
self.check_empty(self.kb_ids, "Knowledge bases")
self.check_decimal_float(self.similarity_threshold, "[Retrieval] Similarity threshold")
self.check_decimal_float(self.keywords_similarity_weight, "[Retrieval] Keywords similarity weight")
self.check_positive_number(self.top_n, "[Retrieval] Top N")
self.check_empty(self.kb_ids, "[Retrieval] Knowledge bases")
class Retrieval(ComponentBase, ABC):