Spaces:
Sleeping
Sleeping
feat: add centralized config layer
Browse files- core/config.py +20 -0
core/config.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from functools import lru_cache
|
| 2 |
+
from pydantic_settings import BaseSettings, SettingsConfigDict
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
class Settings(BaseSettings):
|
| 6 |
+
APP_NAME: str = "Eroha AI Core"
|
| 7 |
+
DEBUG: bool = False
|
| 8 |
+
|
| 9 |
+
OPENAI_API_KEY: str = ""
|
| 10 |
+
MODEL_NAME: str = "gpt-4o-mini"
|
| 11 |
+
|
| 12 |
+
RATE_LIMIT: int = 20
|
| 13 |
+
TIMEOUT_SECONDS: int = 60
|
| 14 |
+
|
| 15 |
+
model_config = SettingsConfigDict(env_file=".env", extra="ignore")
|
| 16 |
+
|
| 17 |
+
|
| 18 |
+
@lru_cache
|
| 19 |
+
def get_settings() -> Settings:
|
| 20 |
+
return Settings()
|