feat: add Groq Llama Prompt Guard moderation integration

- Updated .env.example to include Groq API configuration.
- Enhanced config schema in config.ts to support Groq API keys and settings.
- Implemented Groq moderation API call in indonesianTextNormalizer.ts as a fallback for badword detection.
- Removed the Indonesian slang normalization function and related tests to streamline moderation logic.
- Updated tests to reflect changes in moderation strategy, focusing on emoji normalization and badword detection.
This commit is contained in:
MythEclipse
2026-05-31 19:42:39 +07:00
parent c30785a978
commit 47bac6ff8f
5 changed files with 106 additions and 830 deletions
+5
View File
@@ -52,6 +52,11 @@ AI_LLM_MODEL=free
# NVIDIA Nemotron Content Safety Configuration
NVIDIA_NEMOTRON_API_KEY=your_nvidia_api_key_here
# Groq Llama Prompt Guard Fallback Configuration
GROQ_API_KEY=your_groq_api_key_here
GROQ_MODERATION_MODEL=meta-llama/llama-prompt-guard-2-86m
GROQ_MODERATION_BASE_URL=https://api.groq.com/openai/v1/chat/completions
# Database Configuration (PostgreSQL)
# Option 1: Use DATABASE_URL for connection string
# DATABASE_URL=postgresql://user:password@localhost:5432/discord_bot