MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / CheckSensitiveInput

Function CheckSensitiveInput

service/sensitive.go:42–54  ·  view source on GitHub ↗
(input any)

Source from the content-addressed store, hash-verified

40}
41
42func CheckSensitiveInput(input any) ([]string, error) {
43 switch v := input.(type) {
44 case string:
45 return CheckSensitiveText(v)
46 case []string:
47 var builder strings.Builder
48 for _, s := range v {
49 builder.WriteString(s)
50 }
51 return CheckSensitiveText(builder.String())
52 }
53 return CheckSensitiveText(fmt.Sprintf("%v", input))
54}
55
56// SensitiveWordContains 是否包含敏感词,返回是否包含敏感词和敏感词列表
57func SensitiveWordContains(text string) (bool, []string) {

Callers 5

checkInputSensitiveFunction · 0.92
getAndValidImageRequestFunction · 0.92
getAndValidAudioRequestFunction · 0.92
checkRequestSensitiveFunction · 0.92

Calls 1

CheckSensitiveTextFunction · 0.85

Tested by

no test coverage detected