[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 GitHub
parent f4905cbba7
commit e1e8e55c83
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