my-moderation-api / app /core /config.py
AsyncCoder-10's picture
Upload 24 files
cd05673 verified
Raw History Blame Contribute Delete
552 Bytes
from pydantic_settings import BaseSettings
from functools import lru_cache
class Settings(BaseSettings):
openai_api_key: str # Keep for potential LLM rewrites
groq_api_key: str # Keep for potential LLM rewrites
moderation_threshold: float = 0.5
# Use a Hugging Face model ID
hf_moderation_model: str = "textdetox/bert-multilingual-toxicity-classifier"
chat_model: str = "openai/gpt-oss-20b"
class Config:
env_file = ".env"
@lru_cache()
def get_settings() -> Settings:
return Settings()