Spaces:
Paused
Paused
Download config.py from Therdpoom/line-webhook: direct link, hf CLI and curl.
- Browser
- Download file 762 Bytes
-
https://huggingface.co/spaces/Therdpoom/line-webhook/resolve/main/config.py
- Command line
-
hf download hf://spaces/Therdpoom/line-webhook/config.py
-
curl -L -o config.py https://huggingface.co/spaces/Therdpoom/line-webhook/resolve/main/config.py
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() | |