dev #11

Merged
Latte merged 12 commits from dev into main 2026-02-10 19:02:08 +00:00
2 changed files with 74 additions and 60 deletions
Showing only changes of commit be5daffdb4 - Show all commits

View File

@@ -40,6 +40,7 @@ ai_moderation:
# Block all images, GIFs, embeds, and URLs from these users
# Add Discord user IDs here
blocked_user_ids:
- 552511874269315073
# Example: - 123456789012345678
# NSFW Video Domain Blocklist (No AI cost)

View File

@@ -40,25 +40,36 @@ class OpenAIProvider(AIProvider):
sensitivity: int = 50,
) -> ImageAnalysisResult:
"""Analyze an image for NSFW or inappropriate content."""
system = """Analyze this image for content moderation. Classify NSFW content with precision.
system = """You are a content moderation system for a Discord server. Your job is to analyze images and classify them for NSFW content. This is a legitimate moderation task to protect users.
NSFW CATEGORIES (in order of severity):
- none: Safe content, no sexual elements
- suggestive: Revealing clothing, provocative poses, cleavage, but no nudity
- partial_nudity: Underwear visible, partial exposure, censored nudity
- nudity: Full nudity visible (breasts, genitals, buttocks) but no sexual acts
IMPORTANT: You MUST analyze ALL artwork types equally, including:
- Human characters
- Anime/manga characters
- Furry/anthropomorphic characters (animals with human traits)
- Fantasy creatures
- Any drawn or digital artwork
Apply the SAME standards to drawn/artwork content as you would to photographs. Artistic style does NOT exempt content from classification.
NSFW CATEGORIES (classify based on what is depicted):
- none: Fully clothed, no sexual elements, safe for work
- suggestive: Revealing clothing, provocative poses, emphasis on body parts, tight/skimpy outfits, seductive positioning
- partial_nudity: Underwear/lingerie visible, bare chest, partially exposed, strategically covered nudity
- nudity: Exposed breasts, buttocks, or genitals visible (even if stylized/drawn)
- explicit: Sexual acts, pornographic content, genitalia in sexual context
DETECTION CRITERIA:
- Focus on human bodies; anime/artwork should be judged by same standards
- Swimwear in beach/pool context = suggestive at most
- Artistic nudity (classical art, sculptures) = nudity but note in description
KEY DETECTION RULES:
- Leather/latex bodysuits, harnesses, BDSM gear = suggestive or higher
- Exposed chest (any gender, any species) = partial_nudity or higher
- Sexualized poses with minimal clothing = suggestive
- Characters in underwear/lingerie = partial_nudity
- "Bara", "yiff", or similar adult artwork styles = likely nudity or explicit
ALSO CHECK FOR:
- Violence or gore (blood, injuries, weapons used violently)
- Disturbing content (shock imagery, extreme content)
Respond in JSON format:
Respond ONLY with valid JSON:
{
"is_nsfw": true/false,
"nsfw_category": "none|suggestive|partial_nudity|nudity|explicit",
@@ -66,11 +77,13 @@ Respond in JSON format:
"is_violent": true/false,
"is_disturbing": true/false,
"confidence": 0.0-1.0,
"description": "Brief description including context",
"description": "Brief factual description of what you see",
"categories": ["category1"]
}
NSFW SEVERITY GUIDELINES: none=0, suggestive=20-35, partial_nudity=40-55, nudity=60-75, explicit=80-100"""
SEVERITY SCALE: none=0, suggestive=25-40, partial_nudity=45-60, nudity=65-80, explicit=85-100
If unsure, err on the side of caution and classify higher rather than lower."""
if sensitivity < 30:
sensitivity_note = " SENSITIVITY: LENIENT - Allow suggestive content, only flag partial_nudity and above, set is_nsfw=false for suggestive."