Getting useful content filtering result for troubleshooting in Azure OpenAI

GDB 6 Reputation points
2024-09-03T06:47:39.0533333+00:00

Hello there,

I'm calling Azure Open AI from Power Automate and want to see what's causing the trouble when prompt completion is stopped by (none other than) the content filter. However the returned body is not showing anything useful. Below is a sample of a blocked prompt. The 'content_filter_results' section is the same as a successful one (all 'safe'), while 'prompt_filter_results' indeed is only found in unsuccessful requests - but again it looks all normal (filtered = false, severity = safe, detected = false). Is there anyway to make get more info from the returned responses for troubleshooting?

"body": {
        "choices": [
            {
                "content_filter_results": {
                    "hate": {
                        "filtered": false,
                        "severity": "safe"
                    },
                    "self_harm": {
                        "filtered": false,
                        "severity": "safe"
                    },
                    "sexual": {
                        "filtered": false,
                        "severity": "safe"
                    },
                    "violence": {
                        "filtered": false,
                        "severity": "safe"
                    }
                },
                "finish_reason": "content_filter",
                "index": 0,
                "logprobs": null,
                "message": {
                    "role": "assistant"
                }
            }
        ],
        "created": 1725333306,
        "id": "chatcmpl-A3EIUYJ1OzMRICPnE8oZfGibYRpUh",
        "model": "gpt-4o-mini",
        "object": "chat.completion",
        "prompt_filter_results": [
            {
                "prompt_index": 0,
                "content_filter_results": {
                    "hate": {
                        "filtered": false,
                        "severity": "safe"
                    },
                    "jailbreak": {
                        "filtered": false,
                        "detected": false
                    },
                    "self_harm": {
                        "filtered": false,
                        "severity": "safe"
                    },
                    "sexual": {
                        "filtered": false,
                        "severity": "safe"
                    },
                    "violence": {
                        "filtered": false,
                        "severity": "safe"
                    }
                }
            }
        ],

Cheers,

GDB

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
2,916 questions
{count} votes

1 answer

Sort by: Most helpful
  1. GDB 6 Reputation points
    2024-09-04T07:09:08.1066667+00:00

    Hi @romungi-MSFT , yes tried the interactive OpenAI studio and it's showing sth similar. Maybe that's the most OpenAI will provide? Wanna know at least the category triggering the filter.User's image

    	{
    		"role": "assistant",
    		"content": [
    			{
    				"type": "text",
    				"text": "\n\n**The prompt was filtered due to triggering Azure OpenAI’s content filtering system. Please modify your prompt and retry.** [Learn more](https://go.microsoft.com/fwlink/?linkid=2198766)"
    			}
    		]
    	}
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.