mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-20 12:39:14 +08:00
fix: fix the data validation consistency issue in keyword content review (#8908)
This commit is contained in:
parent
ada9d408ac
commit
503561f464
@ -18,8 +18,12 @@ class KeywordsModeration(Moderation):
|
|||||||
if not config.get("keywords"):
|
if not config.get("keywords"):
|
||||||
raise ValueError("keywords is required")
|
raise ValueError("keywords is required")
|
||||||
|
|
||||||
if len(config.get("keywords")) > 1000:
|
if len(config.get("keywords")) > 10000:
|
||||||
raise ValueError("keywords length must be less than 1000")
|
raise ValueError("keywords length must be less than 10000")
|
||||||
|
|
||||||
|
keywords_row_len = config["keywords"].split("\n")
|
||||||
|
if len(keywords_row_len) > 100:
|
||||||
|
raise ValueError("the number of rows for the keywords must be less than 100")
|
||||||
|
|
||||||
def moderation_for_inputs(self, inputs: dict, query: str = "") -> ModerationInputsResult:
|
def moderation_for_inputs(self, inputs: dict, query: str = "") -> ModerationInputsResult:
|
||||||
flagged = False
|
flagged = False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user