首次提交by MimoCode
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
from pydantic_settings import BaseSettings
|
||||
from typing import List
|
||||
from functools import lru_cache
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
APP_NAME: str = "药箱"
|
||||
APP_VERSION: str = "1.0.0"
|
||||
DEBUG: bool = False
|
||||
|
||||
DATABASE_URL: str = "sqlite+aiosqlite:///./data/yaoxiang.db"
|
||||
|
||||
JWT_SECRET_KEY: str = "your-secret-key-change-in-production"
|
||||
JWT_ALGORITHM: str = "HS256"
|
||||
JWT_EXPIRATION_HOURS: int = 24
|
||||
|
||||
AI_PROVIDER: str = "openai"
|
||||
OPENAI_API_KEY: str = ""
|
||||
OPENAI_MODEL: str = "gpt-4o"
|
||||
GEMINI_API_KEY: str = ""
|
||||
GEMINI_MODEL: str = "gemini-pro-vision"
|
||||
ANTHROPIC_API_KEY: str = ""
|
||||
ANTHROPIC_MODEL: str = "claude-3-opus-20240229"
|
||||
DEEPSEEK_API_KEY: str = ""
|
||||
DEEPSEEK_MODEL: str = "deepseek-chat"
|
||||
OLLAMA_BASE_URL: str = "http://localhost:11434"
|
||||
OLLAMA_MODEL: str = "llava"
|
||||
|
||||
NOTIFICATION_PROVIDERS: List[str] = []
|
||||
SERVERCHAN_KEY: str = ""
|
||||
PUSHPLUS_TOKEN: str = ""
|
||||
BARK_URL: str = ""
|
||||
WECHAT_WEBHOOK_URL: str = ""
|
||||
TELEGRAM_BOT_TOKEN: str = ""
|
||||
TELEGRAM_CHAT_ID: str = ""
|
||||
SMTP_HOST: str = ""
|
||||
SMTP_PORT: int = 587
|
||||
SMTP_USER: str = ""
|
||||
SMTP_PASSWORD: str = ""
|
||||
SMTP_FROM: str = ""
|
||||
|
||||
UPLOAD_DIR: str = "./data/uploads"
|
||||
MAX_UPLOAD_SIZE: int = 10485760
|
||||
|
||||
EXPIRY_WARNING_DAYS: List[int] = [90, 30, 7]
|
||||
LOW_STOCK_THRESHOLD: int = 5
|
||||
|
||||
CORS_ORIGINS: List[str] = ["http://localhost:5173", "http://localhost:3000"]
|
||||
EXPIRY_GRACE_DAYS_MAX: int = 60
|
||||
|
||||
class Config:
|
||||
env_file = ".env"
|
||||
env_file_encoding = "utf-8"
|
||||
|
||||
|
||||
@lru_cache()
|
||||
def get_settings() -> Settings:
|
||||
return Settings()
|
||||
|
||||
|
||||
settings = get_settings()
|
||||
Reference in New Issue
Block a user