-
Notifications
You must be signed in to change notification settings - Fork 863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed a spelling error in the deserialization of the message returned when the completions API triggers the content filter. #23936
Conversation
…ge returned when the completions API triggers the content filter. "innererror" has been corrected to "inner_error".
…ge returned when the completions API triggers the content filter. "content_filter_results" has been corrected to "content_filter_result".
Thank you for your contribution @bilinxing! We will review the pull request and get back to you soon. |
@bilinxing, I've just run this same test and the JSON is formatted as we have it in our current code (not your patch). I'm wondering if this is a possible difference in models, or possibly API version. Can you tell me:
|
model : gpt-4o(2024-11-20) Even if we use curl to request the original API, we will still get a response that is inconsistent with the document definition: {
"error": {
"inner_error": {
"code": "ResponsibleAIPolicyViolation",
"content_filter_results": {
"sexual": {
"filtered": true,
"severity": "medium"
},
"violence": {
"filtered": false,
"severity": "safe"
},
"hate": {
"filtered": false,
"severity": "safe"
},
"self_harm": {
"filtered": false,
"severity": "safe"
}
}
},
"code": "content_filter",
"message": "The response was filtered due to the prompt triggering Azure OpenAI's content management policy. Please modify your prompt and retry. To learn more about our content filtering policies please read our documentation: \r\nhttps://go.microsoft.com/fwlink/?linkid=2198766.",
"param": "prompt",
"type": null
}
} |
@bilinxing, I've tried several ways to trigger this, but I can't. I've matched your exact model, using the latest API version, and I don't see any differences. The results always look like this: "error": {
"message": "The response was filtered due to the prompt triggering Azure OpenAI's content management policy. Please modify your prompt and retry. To learn more about our content filtering policies please read our documentation: https://go.microsoft.com/fwlink/?linkid=2198766",
"type": null,
"param": "prompt",
"code": "content_filter",
"status": 400,
"innererror": {
"code": "ResponsibleAIPolicyViolation",
"content_filter_result": {
"hate": {
"filtered": false,
"severity": "safe"
},
"jailbreak": {
"filtered": false,
"detected": false
},
"self_harm": {
"filtered": false,
"severity": "safe"
},
"sexual": {
"filtered": false,
"severity": "safe"
},
"violence": {
"filtered": true,
"severity": "medium"
}
}
}
} Looking at your result, I note you're missing some fields that should be present, like "status". It's possible there's something specific to your instance, or deployment, that causes it to return different results, in which case you'll need to file a support ticket so someone can look at the your OpenAI instance, and help you troubleshoot. Instructions for that are here: link I also wonder if you, possibly, have a proxy or some intervening software that is changing the results in-transit. Closing this PR, as I can't reproduce the issue, and we wouldn't want to take the fix, as-is, until we know the cause. |
Fixed a spelling error in the deserialization of the message returned when the completions API triggers the content filter. "innererror" 、 "content_filter_results" has been corrected to "inner_error" 、"content_filter_result",
Microsoft's documentation also has a spelling error for "innererror"、"content_filter_result". When I actually called the API, it returned "inner_error" 、 "content_filter_result". I don't know where the problem is, but to ensure my program can run correctly, please merge this pull request. Thank you.
Here are the actual return data when calling the API:
@microsoft-github-policy-service agree