File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,9 @@ import (
1818)
1919
2020const (
21- ViolationFeeCodePrefix = "violation_fee."
22- CSAMViolationMarker = "Failed check: SAFETY_CHECK_TYPE_CSAM"
21+ ViolationFeeCodePrefix = "violation_fee."
22+ CSAMViolationMarker = "Failed check: SAFETY_CHECK_TYPE"
23+ ContentViolatesUsageMarker = "Content violates usage guidelines"
2324)
2425
2526func IsViolationFeeCode (code types.ErrorCode ) bool {
@@ -30,11 +31,11 @@ func HasCSAMViolationMarker(err *types.NewAPIError) bool {
3031 if err == nil {
3132 return false
3233 }
33- if strings .Contains (err .Error (), CSAMViolationMarker ) {
34+ if strings .Contains (err .Error (), CSAMViolationMarker ) || strings . Contains ( err . Error (), ContentViolatesUsageMarker ) {
3435 return true
3536 }
3637 msg := err .ToOpenAIError ().Message
37- return strings .Contains (msg , CSAMViolationMarker )
38+ return strings .Contains (msg , CSAMViolationMarker ) || strings . Contains ( err . Error (), ContentViolatesUsageMarker )
3839}
3940
4041func WrapAsViolationFeeGrokCSAM (err * types.NewAPIError ) * types.NewAPIError {
You can’t perform that action at this time.
0 commit comments