I am facing the same issue. Deployed gpt-4o-mini model:
- When using the DefaultV2 content filter, the content filter works.
- When using custom content filter, the content filter does not work at all
Here is the bicep used to create the custom content filter
param location string = 'australiaeast'
param openAiServiceName string = 'openai-service'
param raiPolicyName string = 'content-filtering'
param blocklistName string = 'blocklist'
// Resources
resource openAiService 'Microsoft.CognitiveServices/accounts@2024-10-01' existing = {
name: openAiServiceName
}
resource raiPolicy 'Microsoft.CognitiveServices/accounts/raiPolicies@2024-10-01' = {
parent: openAiService
name: raiPolicyName
location: location
properties: {
basePolicyName: 'Microsoft.DefaultV2'
contentFilters: [
{
name: 'Violence'
blocking: true
enabled: true
severityThreshold: 'Low'
source: 'Prompt'
}
{
name: 'Violence'
blocking: true
enabled: true
severityThreshold: 'Medium'
source: 'Completion'
}
{
name: 'Hate'
blocking: true
enabled: true
severityThreshold: 'Low'
source: 'Prompt'
}
{
name: 'Hate'
blocking: true
enabled: true
severityThreshold: 'Medium'
source: 'Completion'
}
{
name: 'Sexual'
blocking: true
enabled: true
severityThreshold: 'Low'
source: 'Prompt'
}
{
name: 'Sexual'
blocking: true
enabled: true
severityThreshold: 'Medium'
source: 'Completion'
}
{
name: 'Selfharm'
blocking: true
enabled: true
severityThreshold: 'Low'
source: 'Prompt'
}
{
name: 'Selfharm'
blocking: true
enabled: true
severityThreshold: 'Medium'
source: 'Completion'
}
{
name: 'Jailbreak'
blocking: true
enabled: true
severityThreshold: 'Low'
source: 'Prompt'
}
{
name: 'Indirect Attack'
blocking: true
enabled: true
severityThreshold: 'Low'
source: 'Prompt'
}
]
customBlocklists: [
{
blocking: true
blocklistName: blocklistName
source: 'Prompt'
}
]
mode: 'Default'
}
}