[feat] ai-security-guard support checking prompt and image in request body (#3206)

This commit is contained in:
rinfx
2025-12-22 09:36:49 +08:00
committed by jingze
parent 6311fecfce
commit 0ade9504be
6 changed files with 494 additions and 18 deletions

View File

@@ -219,8 +219,8 @@ func GenerateRequestForImage(config cfg.AISecurityConfig, checkAction, checkServ
if imgUrl != "" {
serviceParameters["imageUrls"] = []string{imgUrl}
}
serviceParametersJSON, _ := json.Marshal(serviceParameters)
serviceParameters["requestFrom"] = cfg.AliyunUserAgent
serviceParametersJSON, _ := json.Marshal(serviceParameters)
body["ServiceParameters"] = serviceParametersJSON
if imgBase64 != "" {
body["ImageBase64Str"] = imgBase64