fix: 敏感词库为空时,不检测
This commit is contained in:
1 parent
38305d7703
commit
eda2ac4390
2 files changed
+13
-1
No files matched your search
@@ -23,7 +23,13 @@ func SensitiveWordsToString() string {
|
||||
}
|
||||
|
||||
func SensitiveWordsFromString(s string) {
|
||||
SensitiveWords = strings.Split(s, "\n")
|
||||
sw := strings.Split(s, "\n")
|
||||
for _, w := range sw {
|
||||
w = strings.TrimSpace(w)
|
||||
if w != "" {
|
||||
SensitiveWords = append(SensitiveWords, w)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func ShouldCheckPromptSensitive() bool {
|
||||
|
||||
Reference in new issue
Block a user