Hi!
We noticed this issue happening a couple of time for the past weeks
Usually, when we get a Content Filtered response from our Azure deployment, it raises a status 400 and we were able to handle it correctly
For the past weeks, we noticed that some of these requests are returning a
Success
status and the payload is very different from the normal filtered cases... I believe it might be an issue on Helicone because we didn't updated/changed/deployed the model since last year
Example:
Helicone ID: 5eaa6e7f-29c1-4cde-adf0-3075e69bac93
JSON response:
{
"choices": [
{
"content_filter_results": {
"hate": {
"filtered": false,
"severity": "safe"
},
"self_harm": {
"filtered": false,
"severity": "safe"
},
"sexual": {
"filtered": true,
"severity": "medium"
},
"violence": {
"filtered": false,
"severity": "safe"
}
},
"finish_reason": "content_filter",
"index": 0,
"message": {
"role": "assistant"
}
}
],
"created": 1714756169,
"id": "chatcmpl-9KqhV3YNO7FpPCsk8VlYDVbbF4KJe",
"model": "gpt-4",
"object": "chat.completion",
"prompt_filter_results": [
{
"prompt_index": 0,
"content_filter_results": {
"hate": {
"filtered": false,
"severity": "safe"
},
"self_harm": {
"filtered": false,
"severity": "safe"
},
"sexual": {
"filtered": false,
"severity": "safe"
},
"violence": {
"filtered": false,
"severity": "safe"
}
}
}
],
"system_fingerprint": "fp_2f57f81c11",
"usage": {
"completion_tokens": 120,
"prompt_tokens": 715,
"total_tokens": 835
}
}
Expected response
ID: d2064246-399d-4978-a571-ddfdfbcaf19e
payload:
{
"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"
},
"self_harm": {
"filtered": false,
"severity": "safe"
},
"sexual": {
"filtered": true,
"severity": "medium"
},
"violence": {
"filtered": false,
"severity": "safe"
}
}
}
}
}