{"record":{"id":"52583bab212ba211","repo":"microsoft/autogen","slug":"the-content-is-filtered-because-its-potential-risk","errorCode":null,"errorMessage":"The content is filtered because its potential risk. Please try another input.","messagePattern":"The content is filtered because its potential risk\\. Please try another input\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"dotnet/src/AutoGen.AzureAIInference/Middleware/AzureAIInferenceChatRequestMessageConnector.cs","lineNumber":132,"sourceCode":"        {\n            return new ToolCallMessageUpdate(currentToolName, functionArgumentsUpdate, from: update.From);\n        }\n        else if (update.Content.ToolCallUpdate is StreamingFunctionToolCallUpdate tooCallUpdate && currentToolName is string)\n        {\n            return new ToolCallMessageUpdate(tooCallUpdate.Name ?? currentToolName, tooCallUpdate.ArgumentsUpdate, from: update.From);\n        }\n        else\n        {\n            return null;\n        }\n    }\n\n    private IMessage PostProcessChatCompletions(IMessage<ChatCompletions> message)\n    {\n        // throw exception if prompt filter results is not null\n        if (message.Content.Choices[0].FinishReason == CompletionsFinishReason.ContentFiltered)\n        {\n            throw new InvalidOperationException(\"The content is filtered because its potential risk. Please try another input.\");\n        }\n\n        return PostProcessChatResponseMessage(message.Content.Choices[0].Message, message.From);\n    }\n\n    private IMessage PostProcessChatResponseMessage(ChatResponseMessage chatResponseMessage, string? from)\n    {\n        var textContent = chatResponseMessage.Content;\n        if (chatResponseMessage.ToolCalls.Where(tc => tc is ChatCompletionsFunctionToolCall).Any())\n        {\n            var functionToolCalls = chatResponseMessage.ToolCalls\n                .Where(tc => tc is ChatCompletionsFunctionToolCall)\n                .Select(tc => (ChatCompletionsFunctionToolCall)tc);\n\n            var toolCalls = functionToolCalls.Select(tc => new ToolCall(tc.Name, tc.Arguments) { ToolCallId = tc.Id });\n\n            return new ToolCallMessage(toolCalls, from)\n            {","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/microsoft/autogen/blob/027ecf0a379bcc1d09956d46d12d44a3ad9cee14/dotnet/src/AutoGen.AzureAIInference/Middleware/AzureAIInferenceChatRequestMessageConnector.cs#L114-L150","documentation":"Error \"The content is filtered because its potential risk. Please try another input.\" thrown in microsoft/autogen.","triggerScenarios":"Thrown at dotnet/src/AutoGen.AzureAIInference/Middleware/AzureAIInferenceChatRequestMessageConnector.cs:132 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rephrase the input to comply with content policy, or adjust filter settings"],"exampleFix":"Modify the prompt to remove flagged content and retry","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"027ecf0a379bcc1d09956d46d12d44a3ad9cee14","analyzedAt":"2026-08-15T03:38:00.719Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}