File size: 552 Bytes
cd05673
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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()