line-webhook / config.py
Therdpoom's picture
Upload 10 files
82eac1b verified
Raw History Blame Contribute Delete
762 Bytes
"""
Configuration — อ่านค่าจาก Environment Variables (.env)
"""
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8")
# LINE
LINE_CHANNEL_SECRET: str
LINE_CHANNEL_ACCESS_TOKEN: str
# HuggingFace
HF_API_TOKEN: str
HF_MODEL_NAME: str = "cardiffnlp/twitter-xlm-roberta-base-sentiment"
# Database
DATABASE_URL: str = "postgresql://user:password@localhost:5432/sentiment_db"
# Redis
REDIS_URL: str = "redis://localhost:6379"
# Alert threshold — negative score ≥ ค่านี้จะ trigger alert
NEGATIVE_ALERT_THRESHOLD: float = 0.80
settings = Settings()