Skip to content
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

detailed Content filter info #55

Closed
wolfgangschneider opened this issue Jun 14, 2024 · 2 comments
Closed

detailed Content filter info #55

wolfgangschneider opened this issue Jun 14, 2024 · 2 comments

Comments

@wolfgangschneider
Copy link

wolfgangschneider commented Jun 14, 2024

When completion is cancelnd in case of contentfilter Version one throes an Azure.RequestFailedException with detailed information as Json stored in Content:

_Azure.RequestFailedException: 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
Status: 400 (model_error)
ErrorCode: content_filter


Content:
{"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":"high"},"violence":{"filtered":false,"severity":"safe"}}}}}_

Version 2 throws System.ClientModel.ClientResultException without this information

_System.ClientModel.ClientResultException: HTTP 400 (content_filter)
Parameter: prompt

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_

Is it possible to get the Content filter reason in one or an other way?

@joseharriaga
Copy link
Collaborator

Hello, @wolfgangschneider. Thank you for reaching out! This repo is for the official OpenAI library for .NET. If you're working with Azure OpenAI and using the Azure.AI.OpenAI library, please open an issue in the azure-sdk-for-net repo instead.

@wolfgangschneider
Copy link
Author

I will do so

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants