[.NET] How to catch content filter exception in GetStreamingChatMessageContentsAsync #10843
Replies: 4 comments 4 replies
-
We wanted to understand what model you're using? |
Beta Was this translation helpful? Give feedback.
-
My point is the GetStreamingChatMessageContentsAsync of IChatCompletionService (i'm on Azure Open Ai) throw a generic Exception with a message like : Is there a way to catch an HttpRequestException to have a clear status code of the error or do we have to parse the Exception.message ? |
Beta Was this translation helpful? Give feedback.
-
@romainsemur just to clarify are you getting a 401 when a content filter issue happens? |
Beta Was this translation helpful? Give feedback.
-
Hi again @markwallace-microsoft, I'm using Azure OpenAI (gpt4o-mini) and I often encounter unjustified and intrusive content filters. How can I retrieve the category of the content filter in the exception? |
Beta Was this translation helpful? Give feedback.
-
When the model behind the GetStreamingChatMessageContentsAsync throws a content_filter exception, it just throw a basic exception, is there a way to throws a ContentFilterException ?
Beta Was this translation helpful? Give feedback.
All reactions