I keep getting this error - Exception in chat message: Azure has not provided the response due to a content filter being triggered

Alan John 5 Reputation points
2023-06-02T18:38:29.21+00:00

Hi,

I just migrated my chatbot from using opanai chatgpt35-turbo model to using Azure openai chatgpt35-turbo model. While the latency and SLA's are great I keep running into one issue which is "Exception in chat message: Azure has not provided the response due to a content filter being triggered"

My chatbot app gets product names and descriptions from the product catalog and then I use chatgpt35-turbo to give out a nice message to my users. Unfortunately for 10% of times I keep getting this error - "Exception in chat message: Azure has not provided the response due to a content filter being triggered".

For 90% of the scenarios I do not get this error.

I am not sure what keywords from the product names or descriptions are triggering this issue. Can you please help me with this. Or provide some guidance on how to handle this as an exception.

Thanks,

Alan

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
37,624 questions
0 comments No comments
{count} vote

3 answers

Sort by: Most helpful
  1. VasimTamboli 4,780 Reputation points
    2023-06-04T12:11:51.7433333+00:00

    Azure has content moderation measures in place to prevent the generation of inappropriate or harmful content. These filters are designed to ensure compliance with ethical guidelines and prevent the dissemination of sensitive, offensive, or unsafe content.

    When the content filter is triggered, it means that the response generated by the model contains content that is potentially in violation of the policies set by Azure. As a result, Azure blocks the response from being delivered.

    To handle this exception, you can consider the following steps:

    Review the content: Take a closer look at the product names, descriptions, or any other input data that you pass to the model. Identify any potentially sensitive, offensive, or inappropriate content that could trigger the content filter.

    Adjust the input: If you can identify specific keywords or phrases that are triggering the content filter, you may need to modify or sanitize the input data to avoid using those specific terms.

    Implement filtering on your side: To proactively prevent the use of content that may trigger the filter, you can implement your own content filtering mechanisms. This can involve using a combination of keyword filters, regular expressions, or custom algorithms to identify and exclude potentially problematic content.

    Contact Azure Support: If you believe that the content filter is producing false positives or if you need further assistance in understanding the specific policies that are triggering the filter, it's recommended to reach out to Azure Support. They can provide more insights and guidance on how to handle this issue in your specific scenario.

    By reviewing and adjusting the content you provide to the Azure OpenAI ChatGPT model and implementing your own content filtering mechanisms, you can mitigate the occurrence of the "content filter being triggered" exception and ensure that the responses from the model align with your desired content standards.

    0 comments No comments

  2. Alan John 5 Reputation points
    2023-06-06T20:15:10.8966667+00:00

    Hi Vasim,

    I am very appreciative of the content moderation that is in place as it serves our business well.

    Unfortunately, I feel like this seems like it is a bit too restrictive based on my current experience. Below are two examples below for questions that were asked to the chatbot just today where I saw this content filtering happening:

    First question - "Traveling to London for a business trip, can you suggest any formal womens outfits". The bot first tries to break this down to 2 searchable terms "womens business suits", "womens business blazers". The next thing I know we got an error saying that - 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

    Second question - Being a well know global fashion retailer that carries women's apparel, shoes, handbags, clutches, etc. the question asked was to show certain colored clutches to match the women's outfit. The content filtering response showed up again.

    Since I cannot tell the retailer to change the products they are carrying or change the names of the products or descriptions, I am trying to figure out if there is another option for me here.

    Looking for a viable solution and appreciate your help here.

    0 comments No comments

  3. Kim Wai Tan 0 Reputation points
    2023-06-19T08:58:52.06+00:00

    I met this problem recently. There are errors due to content filtering. But when I retry the same prompt for second times, I managed to get the response. That means the error is due to ChatGPT output but not my prompt. So I implemented a retry features in my code until it get the correct response. This is a temporary solution as I confirmed that all my prompt are valid.

    0 comments No comments