azure openai filter flag while details are safe

Fares 0 Reputation points
2024-04-02T10:15:33.1333333+00:00

With Azure Openai deployment, I am getting this response: "finish_reason": "content_filter"

while the content_filter_results gives safe results:


"content_filter_results": {
            "hate": {
              "filtered": false,
              "severity": "safe"
            },
            "self_harm": {
              "filtered": false,
              "severity": "safe"
            },
            "sexual": {
              "filtered": false,
              "severity": "safe"
            },
            "violence": {
              "filtered": false,
              "severity": "safe"
            }
          }
{

  "ChatCompletion": {

    "id": "chatcmpl-99VEsuqNEjwnYclTzKk..........",

    "choices": [

      {

        "finish_reason": "content_filter",

        "index": 0,

        "logprobs": null,

        "message": {

          "content": null,

          "role": "assistant",

          "function_call": null,

          "tool_calls": null

        },

        "content_filter_results": {

          "hate": {

            "filtered": false,

            "severity": "safe"

          },

          "self_harm": {

            "filtered": false,

            "severity": "safe"

          },

          "sexual": {

            "filtered": false,

            "severity": "safe"

          },

          "violence": {

            "filtered": false,

            "severity": "safe"

          }

        }

      }

    ],

    "created": 1712052062,

    "model": "gpt-35-turbo",

    "object": "chat.completion",

    "system_fingerprint": "fp_2f57......",

    "usage": {

      "completion_tokens": 220,

      "prompt_tokens": 1925,

      "total_tokens": 2145

    },

    "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"

          }

        }

      }

    ]

  }

}


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

1 answer

Sort by: Most helpful
  1. Sina Salam 3,476 Reputation points
    2024-04-02T12:14:47.1633333+00:00

    Hello Fares,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    Problem

    Sequel to your post, I understand that you are having issues with the response from Azure OpenAI deployment claims to have filtered the content ("finish_reason": "content_filter"), but when peeking into the content_filter_results, everything seems to be marked as safe, and despite the system supposedly filtering content, the actual content appears unfiltered, creating doubts about the effectiveness of the deployed solution.

    Solution

    Absolutely frustrating to encounter such a glitch! But fear not, we can tackle this head-on and get things back on track with your Azure OpenAI deployment. Remember, patience and perseverance are key when troubleshooting technical issues. Let's dissect this situation and find a solution that brings peace of mind. We need to delve deep into the inner workings of our Azure OpenAI deployment:

    1. Your Content Filtering Mechanism needs to be checked. Investigate the algorithms and mechanisms responsible for content filtering within Azure OpenAI. Are they accurately flagging unsafe content? Are there any glitches or oversights in the process?
    2. You have to review the Integration. Verify the integration between your application and Azure OpenAI deployment. Are there any hiccups in the communication that might be causing this miscommunication? Double-check the API requests and responses to ensure they align with expectations.
    3. Implement thorough debugging and testing procedures. Feed the system with a variety of content samples, including known unsafe content, to see how it's being handled. This will help pinpoint any specific areas of concern and guide our troubleshooting efforts.
    4. Once the root cause has been identified, fine-tune the content filtering mechanism accordingly. Adjust parameters, thresholds, or algorithms as needed to ensure a more accurate and reliable filtering process.

    Finally

    Since, there is no specific error report, we can unravel the mystery behind the conflicting signals from Azure OpenAI deployment. It's all about restoring trust and confidence in the system, ensuring that you're provided with the safe and secure experience you deserve. Kindly, follow the above steps for better results and error report.

    References

    You can read more from the right side provided additional contents on these issues. Especially:

    I hope this is helpful! Do not hesitate to let me know if you have any other questions.

    Please remember to "Accept Answer" if answer helped, so that others in the community facing similar issues can easily find the solution.

    Best Regards,

    Sina Salam

    0 comments No comments