Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7cf35ca8
authored
Feb 23, 2026
by
Calcium-Ion
Committed by
GitHub
Feb 23, 2026
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2994 from seefs001/fix/grok-violates-check
fix: violation fee check
parents
194b53f0
b15ad292
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
service/violation_fee.go
+4
-3
No files found.
service/violation_fee.go
View file @
7cf35ca8
...
...
@@ -19,7 +19,8 @@ import (
const
(
ViolationFeeCodePrefix
=
"violation_fee."
CSAMViolationMarker
=
"Failed check: SAFETY_CHECK_TYPE_CSAM"
CSAMViolationMarker
=
"Failed check: SAFETY_CHECK_TYPE"
ContentViolatesUsageMarker
=
"Content violates usage guidelines"
)
func
IsViolationFeeCode
(
code
types
.
ErrorCode
)
bool
{
...
...
@@ -30,11 +31,11 @@ func HasCSAMViolationMarker(err *types.NewAPIError) bool {
if
err
==
nil
{
return
false
}
if
strings
.
Contains
(
err
.
Error
(),
CSAMViolationMarker
)
{
if
strings
.
Contains
(
err
.
Error
(),
CSAMViolationMarker
)
||
strings
.
Contains
(
err
.
Error
(),
ContentViolatesUsageMarker
)
{
return
true
}
msg
:=
err
.
ToOpenAIError
()
.
Message
return
strings
.
Contains
(
msg
,
CSAMViolationMarker
)
return
strings
.
Contains
(
msg
,
CSAMViolationMarker
)
||
strings
.
Contains
(
err
.
Error
(),
ContentViolatesUsageMarker
)
}
func
WrapAsViolationFeeGrokCSAM
(
err
*
types
.
NewAPIError
)
*
types
.
NewAPIError
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment